summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--Makefile.common22
-rw-r--r--Makefile.swig1
-rw-r--r--Makefile.swig.gen.t2
-rw-r--r--config/Makefile.am9
-rw-r--r--config/gr_gcell.m436
-rw-r--r--config/grc_gcell.m477
-rw-r--r--config/grc_gnuradio_core.m46
-rw-r--r--config/grc_gnuradio_examples.m49
-rw-r--r--config/grc_gr_audio.m41
-rw-r--r--config/grc_gr_cvsd_vocoder.m439
-rw-r--r--config/grc_gr_digital.m463
-rw-r--r--config/grc_gr_gcell.m438
-rw-r--r--config/grc_gr_gpio.m438
-rw-r--r--config/grc_gr_gsm_fr_vocoder.m440
-rw-r--r--config/grc_gr_msdd6000.m438
-rw-r--r--config/grc_gr_qtgui.m411
-rw-r--r--config/grc_gr_radar_mono.m445
-rw-r--r--config/grc_gr_sounder.m444
-rw-r--r--config/grc_gr_trellis.m41
-rw-r--r--config/grc_gr_uhd.m45
-rw-r--r--config/grc_gr_vocoder.m449
-rwxr-xr-xconfigure-cell-cross73
-rw-r--r--configure.ac10
-rw-r--r--docs/doxygen/Doxyfile.in3
-rw-r--r--docs/doxygen/other/group_defs.dox13
-rw-r--r--docs/doxygen/other/main_page.dox7
-rw-r--r--docs/doxygen/other/pfb_intro.dox82
-rwxr-xr-xdtools/bin/tweak-cell-for-cross-compiling143
-rw-r--r--gcell/.gitignore10
-rw-r--r--gcell/Makefile.am28
-rw-r--r--gcell/apps/.gitignore12
-rw-r--r--gcell/apps/Makefile.am49
-rw-r--r--gcell/apps/benchmark_dma.cc275
-rw-r--r--gcell/apps/benchmark_nop.cc165
-rw-r--r--gcell/apps/benchmark_roundtrip.cc242
-rwxr-xr-xgcell/apps/gen_script.py119
-rwxr-xr-xgcell/apps/plot_speedup.py122
-rw-r--r--gcell/apps/results-071223126
-rwxr-xr-xgcell/apps/split_and_avg_results.py101
-rw-r--r--gcell/apps/spu/.gitignore8
-rw-r--r--gcell/apps/spu/Makefile.am34
-rw-r--r--gcell/apps/spu/benchmark_procs.c72
-rw-r--r--gcell/apps/test_all.cc43
-rw-r--r--gcell/gcell.pc.in12
-rw-r--r--gcell/gcell_spu.pc.in11
-rw-r--r--gcell/ibm/Makefile.am98
-rw-r--r--gcell/ibm/README10
-rw-r--r--gcell/ibm/sync/ppu_source/atomic.h112
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_add.h62
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_add_return.h66
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_dec.h60
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_dec_and_test.h63
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_dec_if_positive.h76
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_dec_return.h68
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_inc.h59
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_inc_return.h66
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_read.h62
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_set.h66
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_sub.h61
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_sub_and_test.h63
-rw-r--r--gcell/ibm/sync/ppu_source/atomic_sub_return.h65
-rw-r--r--gcell/ibm/sync/ppu_source/complete.h61
-rw-r--r--gcell/ibm/sync/ppu_source/complete_all.h70
-rw-r--r--gcell/ibm/sync/ppu_source/completion.h50
-rw-r--r--gcell/ibm/sync/ppu_source/cond.h65
-rw-r--r--gcell/ibm/sync/ppu_source/cond_broadcast.h70
-rw-r--r--gcell/ibm/sync/ppu_source/cond_init.h66
-rw-r--r--gcell/ibm/sync/ppu_source/cond_signal.h74
-rw-r--r--gcell/ibm/sync/ppu_source/cond_wait.h96
-rw-r--r--gcell/ibm/sync/ppu_source/init_completion.h63
-rw-r--r--gcell/ibm/sync/ppu_source/libsync.h114
-rw-r--r--gcell/ibm/sync/ppu_source/mutex.h46
-rw-r--r--gcell/ibm/sync/ppu_source/mutex_init.h67
-rw-r--r--gcell/ibm/sync/ppu_source/mutex_lock.h78
-rw-r--r--gcell/ibm/sync/ppu_source/mutex_trylock.h81
-rw-r--r--gcell/ibm/sync/ppu_source/mutex_unlock.h64
-rw-r--r--gcell/ibm/sync/ppu_source/pdt_libsync.xml184
-rw-r--r--gcell/ibm/sync/ppu_source/pdt_libsync_config.xml61
-rw-r--r--gcell/ibm/sync/ppu_source/sync_utils.h73
-rw-r--r--gcell/ibm/sync/ppu_source/trace_libsync.h117
-rw-r--r--gcell/ibm/sync/ppu_source/wait_for_completion.h75
-rw-r--r--gcell/ibm/sync/spu_source/atomic.h101
-rw-r--r--gcell/ibm/sync/spu_source/atomic_add.h62
-rw-r--r--gcell/ibm/sync/spu_source/atomic_add_return.h69
-rw-r--r--gcell/ibm/sync/spu_source/atomic_dec.h61
-rw-r--r--gcell/ibm/sync/spu_source/atomic_dec_and_test.h64
-rw-r--r--gcell/ibm/sync/spu_source/atomic_dec_if_positive.h86
-rw-r--r--gcell/ibm/sync/spu_source/atomic_dec_return.h70
-rw-r--r--gcell/ibm/sync/spu_source/atomic_inc.h61
-rw-r--r--gcell/ibm/sync/spu_source/atomic_inc_return.h70
-rw-r--r--gcell/ibm/sync/spu_source/atomic_read.h78
-rw-r--r--gcell/ibm/sync/spu_source/atomic_set.h68
-rw-r--r--gcell/ibm/sync/spu_source/atomic_sub.h64
-rw-r--r--gcell/ibm/sync/spu_source/atomic_sub_and_test.h66
-rw-r--r--gcell/ibm/sync/spu_source/atomic_sub_return.h69
-rw-r--r--gcell/ibm/sync/spu_source/complete.h67
-rw-r--r--gcell/ibm/sync/spu_source/complete_all.h74
-rw-r--r--gcell/ibm/sync/spu_source/completion.h68
-rw-r--r--gcell/ibm/sync/spu_source/cond.h69
-rw-r--r--gcell/ibm/sync/spu_source/cond_broadcast.h73
-rw-r--r--gcell/ibm/sync/spu_source/cond_init.h127
-rw-r--r--gcell/ibm/sync/spu_source/cond_signal.h88
-rw-r--r--gcell/ibm/sync/spu_source/cond_wait.h103
-rw-r--r--gcell/ibm/sync/spu_source/init_completion.h82
-rw-r--r--gcell/ibm/sync/spu_source/libsync.h116
-rw-r--r--gcell/ibm/sync/spu_source/mutex.h178
-rw-r--r--gcell/ibm/sync/spu_source/mutex_init.h64
-rw-r--r--gcell/ibm/sync/spu_source/mutex_lock.h66
-rw-r--r--gcell/ibm/sync/spu_source/mutex_trylock.h70
-rw-r--r--gcell/ibm/sync/spu_source/mutex_unlock.h59
-rw-r--r--gcell/ibm/sync/spu_source/read_lock.h66
-rw-r--r--gcell/ibm/sync/spu_source/read_trylock.h71
-rw-r--r--gcell/ibm/sync/spu_source/read_unlock.h88
-rw-r--r--gcell/ibm/sync/spu_source/rwlock_init.h60
-rw-r--r--gcell/ibm/sync/spu_source/sync_irq.h76
-rw-r--r--gcell/ibm/sync/spu_source/sync_utils.h103
-rw-r--r--gcell/ibm/sync/spu_source/trace_libsync.h117
-rw-r--r--gcell/ibm/sync/spu_source/wait_for_completion.h82
-rw-r--r--gcell/ibm/sync/spu_source/write_lock.h67
-rw-r--r--gcell/ibm/sync/spu_source/write_trylock.h72
-rw-r--r--gcell/ibm/sync/spu_source/write_unlock.h69
-rw-r--r--gcell/include/Makefile.am24
-rw-r--r--gcell/include/gcell/Makefile.am42
-rw-r--r--gcell/include/gcell/compiler.h45
-rw-r--r--gcell/include/gcell/gc_aligned_alloc.h52
-rw-r--r--gcell/include/gcell/gc_atomic.h29
-rw-r--r--gcell/include/gcell/gc_cdefs.h34
-rw-r--r--gcell/include/gcell/gc_declare_proc.h64
-rw-r--r--gcell/include/gcell/gc_jd_queue.h52
-rw-r--r--gcell/include/gcell/gc_jd_queue_data.h52
-rw-r--r--gcell/include/gcell/gc_jd_stack.h70
-rw-r--r--gcell/include/gcell/gc_job_desc.h214
-rw-r--r--gcell/include/gcell/gc_job_desc_private.h39
-rw-r--r--gcell/include/gcell/gc_job_manager.h287
-rw-r--r--gcell/include/gcell/gc_logging.h166
-rw-r--r--gcell/include/gcell/gc_mbox.h53
-rw-r--r--gcell/include/gcell/gc_spu_args.h60
-rw-r--r--gcell/include/gcell/gc_types.h63
-rw-r--r--gcell/include/gcell/gcp_fft_1d_r2.h64
-rw-r--r--gcell/include/gcell/memory_barrier.h64
-rw-r--r--gcell/include/gcell/spu/.gitignore8
-rw-r--r--gcell/include/gcell/spu/Makefile.am30
-rw-r--r--gcell/include/gcell/spu/fft_1d.h103
-rw-r--r--gcell/include/gcell/spu/fft_1d_r2.h529
-rw-r--r--gcell/include/gcell/spu/gc_delay.h27
-rw-r--r--gcell/include/gcell/spu/gc_jd_queue.h59
-rw-r--r--gcell/include/gcell/spu/gc_random.h32
-rw-r--r--gcell/include/gcell/spu/gc_spu_macs.h380
-rw-r--r--gcell/include/gcell/spu/libfft.h113
-rw-r--r--gcell/lib/Makefile.am44
-rw-r--r--gcell/lib/general/.gitignore8
-rw-r--r--gcell/lib/general/Makefile.am23
-rw-r--r--gcell/lib/general/spu/fft_1d_r2.c35
-rw-r--r--gcell/lib/general/spu/memset.S185
-rw-r--r--gcell/lib/general/spu/qa_memset.c201
-rw-r--r--gcell/lib/runtime/.gitignore8
-rw-r--r--gcell/lib/runtime/Makefile.am66
-rw-r--r--gcell/lib/runtime/gc_aligned_alloc.cc55
-rw-r--r--gcell/lib/runtime/gc_client_thread_info.h81
-rw-r--r--gcell/lib/runtime/gc_jd_queue.c78
-rw-r--r--gcell/lib/runtime/gc_jd_stack.c168
-rw-r--r--gcell/lib/runtime/gc_job_manager.cc186
-rw-r--r--gcell/lib/runtime/gc_job_manager_impl.cc1404
-rw-r--r--gcell/lib/runtime/gc_job_manager_impl.h274
-rw-r--r--gcell/lib/runtime/gc_proc_def_utils.cc123
-rw-r--r--gcell/lib/runtime/gc_proc_def_utils.h42
-rwxr-xr-xgcell/lib/runtime/gcell-embedspu-libtool40
-rw-r--r--gcell/lib/runtime/qa_gcell_runtime.cc43
-rw-r--r--gcell/lib/runtime/qa_gcell_runtime.h35
-rw-r--r--gcell/lib/runtime/qa_jd_queue.cc78
-rw-r--r--gcell/lib/runtime/qa_jd_queue.h42
-rw-r--r--gcell/lib/runtime/qa_jd_stack.cc67
-rw-r--r--gcell/lib/runtime/qa_jd_stack.h42
-rw-r--r--gcell/lib/runtime/qa_job_manager.cc790
-rw-r--r--gcell/lib/runtime/qa_job_manager.h89
-rw-r--r--gcell/lib/runtime/spu/.gitignore10
-rw-r--r--gcell/lib/runtime/spu/gc_delay.c58
-rw-r--r--gcell/lib/runtime/spu/gc_logging.c77
-rw-r--r--gcell/lib/runtime/spu/gc_main.c731
-rw-r--r--gcell/lib/runtime/spu/gc_random.c44
-rw-r--r--gcell/lib/runtime/spu/gc_spu_config.h39
-rw-r--r--gcell/lib/runtime/spu/gc_spu_jd_queue.c123
-rw-r--r--gcell/lib/runtime/spu/gcell_runtime_qa.c105
-rw-r--r--gcell/lib/runtime/spu/spu_buffers.c35
-rw-r--r--gcell/lib/runtime/spu/spu_buffers.h32
-rw-r--r--gcell/lib/spu/.gitignore11
-rw-r--r--gcell/lib/spu/Makefile.am138
-rw-r--r--gcell/lib/wrapper/.gitignore8
-rw-r--r--gcell/lib/wrapper/Makefile.am75
-rw-r--r--gcell/lib/wrapper/gcp_fft_1d_r2.cc119
-rw-r--r--gcell/lib/wrapper/qa_gcell_general.cc83
-rw-r--r--gcell/lib/wrapper/qa_gcell_general.h40
-rw-r--r--gcell/lib/wrapper/qa_gcell_wrapper.cc41
-rw-r--r--gcell/lib/wrapper/qa_gcell_wrapper.h35
-rw-r--r--gcell/lib/wrapper/qa_gcp_fft_1d_r2.cc208
-rw-r--r--gcell/lib/wrapper/qa_gcp_fft_1d_r2.h48
-rw-r--r--gcell/lib/wrapper/spu/.gitignore8
-rw-r--r--gcell/lib/wrapper/spu/gcs_fft_1d_r2.c94
-rw-r--r--gnuradio-core/src/guile/tests/filter_ctors.test3
-rw-r--r--gnuradio-core/src/guile/tests/general_ctors.test42
-rw-r--r--gnuradio-core/src/lib/Makefile.am3
-rw-r--r--gnuradio-core/src/lib/filter/Makefile.am11
-rw-r--r--gnuradio-core/src/lib/filter/filter.i4
-rw-r--r--gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.cc88
-rw-r--r--gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.h61
-rw-r--r--gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.i31
-rw-r--r--gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.h62
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h1
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.cc209
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.h177
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.i (renamed from gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i)23
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h1
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc289
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h322
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.i29
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h128
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h1
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.h1
-rw-r--r--gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h1
-rw-r--r--gnuradio-core/src/lib/g72x/.gitignore8
-rw-r--r--gnuradio-core/src/lib/general/Makefile.am41
-rw-r--r--gnuradio-core/src/lib/general/general.i30
-rw-r--r--gnuradio-core/src/lib/general/gr_constellation_decoder_cb.cc114
-rw-r--r--gnuradio-core/src/lib/general/gr_constellation_decoder_cb.h65
-rw-r--r--gnuradio-core/src/lib/general/gr_constellation_decoder_cb.i43
-rw-r--r--gnuradio-core/src/lib/general/gr_costas_loop_cc.cc168
-rw-r--r--gnuradio-core/src/lib/general/gr_cpm.cc214
-rw-r--r--gnuradio-core/src/lib/general/gr_cpm.h80
-rw-r--r--gnuradio-core/src/lib/general/gr_cpm.i40
-rw-r--r--gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc214
-rw-r--r--gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h139
-rw-r--r--gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h2
-rw-r--r--gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i2
-rw-r--r--gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc148
-rw-r--r--gnuradio-core/src/lib/general/gr_lms_dfe_cc.h64
-rw-r--r--gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc122
-rw-r--r--gnuradio-core/src/lib/general/gr_lms_dfe_ff.h62
-rw-r--r--gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.cc374
-rw-r--r--gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.h120
-rw-r--r--gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.i39
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc41
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h23
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i11
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc32
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h24
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i11
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_refout_cc.cc28
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_refout_cc.h24
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_refout_cc.i10
-rw-r--r--gnuradio-core/src/lib/general/gri_control_loop.cc183
-rw-r--r--gnuradio-core/src/lib/general/gri_control_loop.h201
-rw-r--r--gnuradio-core/src/lib/general/gri_control_loop.i57
-rw-r--r--gnuradio-core/src/lib/general/qa_general.cc2
-rw-r--r--gnuradio-core/src/lib/general/qa_gr_cpm.cc140
-rw-r--r--gnuradio-core/src/lib/general/qa_gr_cpm.h (renamed from gnuradio-core/src/lib/general/gr_lms_dfe_cc.i)34
-rw-r--r--gnuradio-core/src/lib/hier/Makefile.am2
-rw-r--r--gnuradio-core/src/lib/hier/hier.i1
-rw-r--r--gnuradio-core/src/lib/swig/Makefile.am2
-rw-r--r--gnuradio-core/src/lib/swig/Makefile.swig.gen12
-rw-r--r--gnuradio-core/src/python/gnuradio/Makefile.am4
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am12
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py363
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py363
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/dbpsk2.py369
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py363
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/dqpsk2.py377
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py2
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py53
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/qam16.py208
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/qam256.py209
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/qam64.py208
-rw-r--r--gnuradio-core/src/python/gnuradio/blks2impl/qam8.py209
-rwxr-xr-xgnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py136
-rw-r--r--gnuradio-core/src/python/gnuradio/gr/Makefile.am3
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py203
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py209
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py206
-rw-r--r--gnuradio-core/src/python/gnuradio/gr_xmlrunner.py12
-rw-r--r--gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am1
-rw-r--r--gnuradio-core/src/python/gnuradio/vocoder/__init__.py1
-rw-r--r--gnuradio-examples/grc/Makefile.am18
-rw-r--r--gnuradio-examples/grc/uhd/.gitignore2
-rw-r--r--gnuradio-examples/grc/uhd/uhd_const_wave.grc1020
-rw-r--r--gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc2238
-rw-r--r--gnuradio-examples/grc/uhd/uhd_fft.grc1025
-rw-r--r--gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc1431
-rw-r--r--gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc2204
-rw-r--r--gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc1234
-rw-r--r--gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc1365
-rw-r--r--gnuradio-examples/grc/usrp/usrp2_const_wave.grc252
-rw-r--r--gnuradio-examples/grc/usrp/usrp2_dpsk_mod.grc693
-rw-r--r--gnuradio-examples/grc/usrp/usrp2_fft.grc264
-rw-r--r--gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc727
-rw-r--r--gnuradio-examples/grc/usrp/usrp_two_tone_loopback.grc749
-rw-r--r--gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc583
-rw-r--r--gnuradio-examples/grc/usrp/usrp_wbfm_receive.grc466
-rw-r--r--gnuradio-examples/python/Makefile.am9
-rw-r--r--gnuradio-examples/python/apps/README26
-rw-r--r--gnuradio-examples/python/apps/hf_explorer/README48
-rw-r--r--gnuradio-examples/python/apps/hf_radio/input.py46
-rw-r--r--gnuradio-examples/python/apps/hf_radio/output.py17
-rw-r--r--gnuradio-examples/python/apps/hf_radio/ssbagc.py48
-rw-r--r--gnuradio-examples/python/digital-bert/README63
-rwxr-xr-xgnuradio-examples/python/digital-bert/benchmark_rx.py170
-rwxr-xr-xgnuradio-examples/python/digital-bert/benchmark_tx.py111
-rw-r--r--gnuradio-examples/python/digital-bert/receive_path.py118
-rw-r--r--gnuradio-examples/python/digital-bert/transmit_path.py61
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_loopback.py173
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_qt_loopback.py470
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_qt_loopback2.py536
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_qt_rx.py443
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_qt_rx2.py475
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_rx2.py114
-rwxr-xr-xgnuradio-examples/python/digital/benchmark_tx2.py135
-rw-r--r--gnuradio-examples/python/digital/pick_bitrate.py153
-rw-r--r--gnuradio-examples/python/digital/pick_bitrate2.py154
-rw-r--r--gnuradio-examples/python/digital/qt_digital_window.py239
-rw-r--r--gnuradio-examples/python/digital/qt_digital_window.ui581
-rw-r--r--gnuradio-examples/python/digital/qt_digital_window2.py248
-rw-r--r--gnuradio-examples/python/digital/qt_digital_window2.ui605
-rw-r--r--gnuradio-examples/python/digital/qt_rx_window.py157
-rw-r--r--gnuradio-examples/python/digital/qt_rx_window.ui407
-rw-r--r--gnuradio-examples/python/digital/qt_rx_window2.py166
-rw-r--r--gnuradio-examples/python/digital/qt_rx_window2.ui354
-rw-r--r--gnuradio-examples/python/digital/usrp_receive_path.py96
-rw-r--r--gnuradio-examples/python/digital/usrp_receive_path2.py96
-rw-r--r--gnuradio-examples/python/digital/usrp_transmit_path.py101
-rw-r--r--gnuradio-examples/python/digital/usrp_transmit_path2.py101
-rw-r--r--gnuradio-examples/python/digital_voice/.gitignore10
-rwxr-xr-xgnuradio-examples/python/digital_voice/cvsd_test.py63
-rwxr-xr-xgnuradio-examples/python/digital_voice/encdec.py58
-rw-r--r--gnuradio-examples/python/multi-antenna/.gitignore11
-rwxr-xr-xgnuradio-examples/python/multi-antenna/multi_fft.py128
-rw-r--r--gnuradio-examples/python/usrp/.gitignore10
-rw-r--r--gnuradio-examples/python/usrp/Makefile.am46
-rwxr-xr-xgnuradio-examples/python/usrp/max_power.py83
-rwxr-xr-xgnuradio-examples/python/usrp/test_dft_analysis.py72
-rwxr-xr-xgnuradio-examples/python/usrp/test_dft_synth.py78
-rwxr-xr-xgnuradio-examples/python/usrp/usrp_benchmark_usb.py106
-rwxr-xr-xgnuradio-examples/python/usrp/usrp_test_loop_lfsr.py62
-rwxr-xr-xgnuradio-examples/python/usrp/usrp_wfm_rcv2_nogui.py183
-rwxr-xr-xgnuradio-examples/python/usrp/usrp_wfm_rcv_nogui.py177
-rw-r--r--gnuradio-examples/python/usrp2/qt_wfm_interface.py99
-rw-r--r--gnuradio-examples/python/usrp2/qt_wfm_interface.ui253
-rwxr-xr-xgnuradio-examples/python/usrp2/usrp2_wfm_qt.py355
-rwxr-xr-xgnuradio-examples/python/usrp2/usrp2_wfm_rcv.py289
-rw-r--r--gr-atsc/src/lib/Makefile.swig.gen2
-rw-r--r--gr-audio/Makefile.am2
-rw-r--r--gr-audio/doc/.gitignore (renamed from gcell/include/gcell/.gitignore)0
-rw-r--r--gr-audio/doc/Makefile.am (renamed from gr-radar-mono/src/fpga/Makefile.am)7
-rw-r--r--gr-audio/doc/README.audio20
-rw-r--r--gr-audio/doc/audio.dox51
-rw-r--r--gr-audio/include/gr_audio_sink.h13
-rw-r--r--gr-audio/include/gr_audio_source.h13
-rw-r--r--gr-audio/lib/alsa/audio_alsa_sink.h1
-rw-r--r--gr-audio/lib/alsa/audio_alsa_source.h1
-rw-r--r--gr-audio/lib/jack/audio_jack_sink.h1
-rw-r--r--gr-audio/lib/jack/audio_jack_source.h1
-rw-r--r--gr-audio/lib/oss/audio_oss_sink.h1
-rw-r--r--gr-audio/lib/oss/audio_oss_source.h1
-rw-r--r--gr-audio/lib/osx/audio_osx_sink.h1
-rw-r--r--gr-audio/lib/osx/audio_osx_source.h1
-rw-r--r--gr-audio/lib/portaudio/audio_portaudio_sink.h3
-rw-r--r--gr-audio/lib/portaudio/audio_portaudio_source.h3
-rw-r--r--gr-audio/lib/windows/audio_windows_sink.h1
-rw-r--r--gr-audio/lib/windows/audio_windows_source.h1
-rw-r--r--gr-audio/swig/Makefile.swig.gen4
-rw-r--r--gr-cvsd-vocoder/src/Makefile.am25
-rw-r--r--gr-cvsd-vocoder/src/lib/Makefile.am58
-rw-r--r--gr-cvsd-vocoder/src/lib/cvsd_vocoder.i91
-rw-r--r--gr-cvsd-vocoder/src/python/run_tests.in10
-rw-r--r--gr-digital/.gitignore (renamed from gr-msdd6000/.gitignore)2
-rw-r--r--gr-digital/Makefile.am (renamed from gr-cvsd-vocoder/Makefile.am)10
-rw-r--r--gr-digital/README4
-rw-r--r--gr-digital/apps/.gitignore2
-rw-r--r--gr-digital/apps/Makefile.am (renamed from gr-radar-mono/src/Makefile.am)12
-rw-r--r--gr-digital/doc/.gitignore (renamed from gnuradio-examples/python/apps/.gitignore)0
-rw-r--r--gr-digital/doc/Makefile.am (renamed from gr-gpio/Makefile.am)7
-rw-r--r--gr-digital/doc/README.digital13
-rw-r--r--gr-digital/doc/digital.dox23
-rw-r--r--gr-digital/examples/.gitignore8
-rw-r--r--gr-digital/examples/Makefile.am (renamed from gnuradio-examples/python/digital/Makefile.am)36
-rw-r--r--gr-digital/examples/README (renamed from gnuradio-examples/python/digital/README)69
-rwxr-xr-xgr-digital/examples/benchmark_add_channel.py101
-rwxr-xr-xgr-digital/examples/benchmark_rx.py (renamed from gnuradio-examples/python/digital/benchmark_rx.py)53
-rwxr-xr-xgr-digital/examples/benchmark_tx.py (renamed from gnuradio-examples/python/digital/benchmark_tx.py)49
-rwxr-xr-xgr-digital/examples/digital_bert_rx.py209
-rwxr-xr-xgr-digital/examples/digital_bert_tx.py135
-rwxr-xr-xgr-digital/examples/example_costas.py116
-rwxr-xr-xgr-digital/examples/example_fll.py126
-rwxr-xr-xgr-digital/examples/example_timing.py211
-rwxr-xr-xgr-digital/examples/gen_whitener.py (renamed from gnuradio-examples/python/digital/gen_whitener.py)0
-rw-r--r--gr-digital/examples/receive_path.py (renamed from gnuradio-examples/python/digital/receive_path.py)43
-rwxr-xr-xgr-digital/examples/run_length.py (renamed from gnuradio-examples/python/digital/run_length.py)0
-rwxr-xr-xgr-digital/examples/rx_voice.py (renamed from gnuradio-examples/python/digital/rx_voice.py)61
-rw-r--r--gr-digital/examples/transmit_path.py (renamed from gnuradio-examples/python/digital/transmit_path.py)43
-rwxr-xr-xgr-digital/examples/tunnel.py (renamed from gnuradio-examples/python/digital/tunnel.py)116
-rwxr-xr-xgr-digital/examples/tx_voice.py (renamed from gnuradio-examples/python/digital/tx_voice.py)60
-rw-r--r--gr-digital/examples/uhd_interface.py219
-rw-r--r--gr-digital/gnuradio-digital.pc.in (renamed from gr-msdd6000/gnuradio-msdd6000.pc.in)6
-rw-r--r--gr-digital/grc/.gitignore2
-rw-r--r--gr-digital/grc/Makefile.am43
-rw-r--r--gr-digital/grc/digital_binary_slicer_fb.xml (renamed from grc/blocks/gr_binary_slicer_fb.xml)6
-rw-r--r--gr-digital/grc/digital_block_tree.xml53
-rw-r--r--gr-digital/grc/digital_clock_recovery_mm_xx.xml (renamed from grc/blocks/gr_clock_recovery_mm_xx.xml)6
-rw-r--r--gr-digital/grc/digital_cma_equalizer_cc.xml42
-rw-r--r--gr-digital/grc/digital_constellation_decoder_cb.xml (renamed from grc/blocks/gr_constellation_decoder_cb.xml)17
-rw-r--r--gr-digital/grc/digital_correlate_access_code_bb.xml (renamed from grc/blocks/gr_correlate_access_code_bb.xml)6
-rw-r--r--gr-digital/grc/digital_costas_loop_cc.xml38
-rw-r--r--gr-digital/grc/digital_dxpsk_demod.xml (renamed from grc/blocks/blks2_dxpsk2_demod.xml)79
-rw-r--r--gr-digital/grc/digital_dxpsk_mod.xml (renamed from grc/blocks/blks2_dxpsk_mod.xml)38
-rw-r--r--gr-digital/grc/digital_fll_band_edge_cc.xml (renamed from grc/blocks/gr_fll_band_edge_cc.xml)20
-rw-r--r--gr-digital/grc/digital_kurtotic_equalizer_cc.xml (renamed from grc/blocks/gr_cma_equalizer_cc.xml)19
-rw-r--r--gr-digital/grc/digital_lms_dd_equalizer_cc.xml41
-rw-r--r--gr-digital/grc/digital_mpsk_receiver_cc.xml (renamed from grc/blocks/gr_mpsk_receiver_cc.xml)18
-rw-r--r--gr-digital/grc/digital_psk_demod.xml158
-rw-r--r--gr-digital/grc/digital_psk_mod.xml125
-rw-r--r--gr-digital/grc/digital_qam_demod.xml158
-rw-r--r--gr-digital/grc/digital_qam_mod.xml125
-rw-r--r--gr-digital/include/.gitignore (renamed from gnuradio-examples/python/digital-bert/.gitignore)0
-rw-r--r--gr-digital/include/Makefile.am44
-rw-r--r--gr-digital/include/digital_binary_slicer_fb.h (renamed from gnuradio-core/src/lib/general/gr_binary_slicer_fb.h)19
-rw-r--r--gr-digital/include/digital_clock_recovery_mm_cc.h (renamed from gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.h)34
-rw-r--r--gr-digital/include/digital_clock_recovery_mm_ff.h (renamed from gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.h)31
-rw-r--r--gr-digital/include/digital_cma_equalizer_cc.h102
-rw-r--r--gr-digital/include/digital_constellation.h448
-rw-r--r--gr-digital/include/digital_constellation_decoder_cb.h65
-rw-r--r--gr-digital/include/digital_constellation_receiver_cb.h121
-rw-r--r--gr-digital/include/digital_correlate_access_code_bb.h (renamed from gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h)27
-rw-r--r--gr-digital/include/digital_costas_loop_cc.h (renamed from gnuradio-core/src/lib/general/gr_costas_loop_cc.h)78
-rw-r--r--gr-digital/include/digital_cpmmod_bc.h96
-rw-r--r--gr-digital/include/digital_crc32.h (renamed from gnuradio-core/src/lib/general/gr_crc32.h)16
-rw-r--r--gr-digital/include/digital_fll_band_edge_cc.h213
-rw-r--r--gr-digital/include/digital_gmskmod_bc.h62
-rw-r--r--gr-digital/include/digital_kurtotic_equalizer_cc.h112
-rw-r--r--gr-digital/include/digital_lms_dd_equalizer_cc.h117
-rw-r--r--gr-digital/include/digital_metric_type.h (renamed from gr-trellis/src/lib/metric_type.h)4
-rw-r--r--gr-digital/include/digital_mpsk_receiver_cc.h (renamed from gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h)214
-rw-r--r--gr-digital/lib/.gitignore (renamed from gcell/lib/.gitignore)8
-rw-r--r--gr-digital/lib/Makefile.am50
-rw-r--r--gr-digital/lib/digital_binary_slicer_fb.cc (renamed from gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc)27
-rw-r--r--gr-digital/lib/digital_clock_recovery_mm_cc.cc (renamed from gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc)50
-rw-r--r--gr-digital/lib/digital_clock_recovery_mm_ff.cc (renamed from gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc)38
-rw-r--r--gr-digital/lib/digital_cma_equalizer_cc.cc46
-rw-r--r--gr-digital/lib/digital_constellation.cc554
-rw-r--r--gr-digital/lib/digital_constellation_decoder_cb.cc77
-rw-r--r--gr-digital/lib/digital_constellation_receiver_cb.cc123
-rw-r--r--gr-digital/lib/digital_correlate_access_code_bb.cc (renamed from gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc)25
-rw-r--r--gr-digital/lib/digital_costas_loop_cc.cc153
-rw-r--r--gr-digital/lib/digital_cpmmod_bc.cc69
-rw-r--r--gr-digital/lib/digital_crc32.cc (renamed from gnuradio-core/src/lib/general/gr_crc32.cc)18
-rw-r--r--gr-digital/lib/digital_fll_band_edge_cc.cc259
-rw-r--r--gr-digital/lib/digital_gmskmod_bc.cc (renamed from gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc)24
-rw-r--r--gr-digital/lib/digital_kurtotic_equalizer_cc.cc51
-rw-r--r--gr-digital/lib/digital_lms_dd_equalizer_cc.cc85
-rw-r--r--gr-digital/lib/digital_mpsk_receiver_cc.cc (renamed from gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc)92
-rw-r--r--gr-digital/python/.gitignore (renamed from gr-cvsd-vocoder/src/python/.gitignore)0
-rw-r--r--gr-digital/python/Makefile.am (renamed from gr-gsm-fr-vocoder/src/python/Makefile.am)43
-rw-r--r--gr-digital/python/__init__.py37
-rw-r--r--gr-digital/python/bpsk.py171
-rw-r--r--gr-digital/python/cpm.py (renamed from gnuradio-core/src/python/gnuradio/blks2impl/cpm.py)0
-rw-r--r--gr-digital/python/crc.py (renamed from gnuradio-core/src/python/gnuradio/gruimpl/crc.py)12
-rw-r--r--gr-digital/python/generic_mod_demod.py387
-rw-r--r--gr-digital/python/gmsk.py (renamed from gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py)120
-rw-r--r--gr-digital/python/modulation_utils2.py (renamed from gnuradio-core/src/python/gnuradio/modulation_utils.py)23
-rw-r--r--gr-digital/python/ofdm.py295
-rw-r--r--gr-digital/python/packet_utils.py (renamed from gnuradio-core/src/python/gnuradio/packet_utils.py)6
-rw-r--r--gr-digital/python/pkt.py (renamed from gnuradio-core/src/python/gnuradio/blks2impl/pkt.py)9
-rw-r--r--gr-digital/python/psk.py94
-rw-r--r--gr-digital/python/psk2.py122
-rwxr-xr-xgr-digital/python/qa_binary_slicer_fb.py (renamed from gnuradio-core/src/python/gnuradio/gr/qa_constellation_decoder_cb.py)20
-rwxr-xr-xgr-digital/python/qa_clock_recovery_mm.py176
-rwxr-xr-xgr-digital/python/qa_cma_equalizer.py (renamed from gnuradio-core/src/python/gnuradio/gr/qa_cma_equalizer.py)5
-rwxr-xr-xgr-digital/python/qa_constellation.py204
-rwxr-xr-xgr-digital/python/qa_constellation_decoder_cb.py76
-rwxr-xr-xgr-digital/python/qa_constellation_receiver.py134
-rwxr-xr-xgr-digital/python/qa_correlate_access_code.py (renamed from gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py)7
-rwxr-xr-xgr-digital/python/qa_costas_loop_cc.py151
-rwxr-xr-xgr-digital/python/qa_cpm.py91
-rwxr-xr-xgr-digital/python/qa_crc32.py60
-rwxr-xr-x[-rw-r--r--]gr-digital/python/qa_digital.py (renamed from gr-gpio/src/fpga/rbf/Makefile.am)21
-rwxr-xr-xgr-digital/python/qa_fll_band_edge.py83
-rwxr-xr-xgr-digital/python/qa_lms_equalizer.py53
-rwxr-xr-xgr-digital/python/qa_mpsk_receiver.py121
-rw-r--r--gr-digital/python/qam.py227
-rw-r--r--gr-digital/python/qpsk.py176
-rw-r--r--gr-digital/python/run_tests.in (renamed from gr-gcell/src/run_tests.in)4
-rw-r--r--gr-digital/python/utils/.gitignore3
-rw-r--r--gr-digital/python/utils/Makefile.am (renamed from gr-sounder/src/Makefile.am)15
-rw-r--r--gr-digital/python/utils/__init__.py (renamed from gr-gpio/src/fpga/Makefile.am)6
-rw-r--r--gr-digital/python/utils/alignment.py139
-rw-r--r--gr-digital/python/utils/gray_code.py66
-rw-r--r--gr-digital/python/utils/mod_codes.py33
-rw-r--r--gr-digital/swig/.gitignore9
-rw-r--r--gr-digital/swig/Makefile.am82
-rw-r--r--gr-digital/swig/Makefile.swig.gen (renamed from gr-gcell/src/Makefile.swig.gen)101
-rw-r--r--gr-digital/swig/_digital_hier.i (renamed from gnuradio-core/src/lib/general/gr_crc32.i)16
-rw-r--r--gr-digital/swig/digital_binary_slicer_fb.i (renamed from gnuradio-core/src/lib/general/gr_binary_slicer_fb.i)10
-rw-r--r--gr-digital/swig/digital_clock_recovery_mm_cc.i (renamed from gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i)19
-rw-r--r--gr-digital/swig/digital_clock_recovery_mm_ff.i (renamed from gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i)19
-rw-r--r--gr-digital/swig/digital_cma_equalizer_cc.i44
-rw-r--r--gr-digital/swig/digital_constellation.i189
-rw-r--r--gr-digital/swig/digital_constellation_decoder_cb.i38
-rw-r--r--gr-digital/swig/digital_constellation_receiver_cb.i (renamed from gnuradio-core/src/lib/general/gr_costas_loop_cc.i)26
-rw-r--r--gr-digital/swig/digital_correlate_access_code_bb.i (renamed from gnuradio-core/src/lib/general/gr_correlate_access_code_bb.i)18
-rw-r--r--gr-digital/swig/digital_costas_loop_cc.i (renamed from gnuradio-core/src/lib/general/gr_lms_dfe_ff.i)15
-rw-r--r--gr-digital/swig/digital_cpmmod_bc.i40
-rw-r--r--gr-digital/swig/digital_crc32.i27
-rw-r--r--gr-digital/swig/digital_fll_band_edge_cc.i60
-rw-r--r--gr-digital/swig/digital_gmskmod_bc.i39
-rw-r--r--gr-digital/swig/digital_kurtotic_equalizer_cc.i (renamed from gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.i)15
-rw-r--r--gr-digital/swig/digital_lms_dd_equalizer_cc.i46
-rw-r--r--gr-digital/swig/digital_mpsk_receiver_cc.i (renamed from gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.i)35
-rw-r--r--gr-digital/swig/digital_swig.i70
-rw-r--r--gr-digital/swig/gnuradio/.gitignore2
-rw-r--r--gr-digital/swig/gnuradio/digital.scm28
-rw-r--r--gr-digital/swig/run_guile_tests.in14
-rw-r--r--gr-gcell/.gitignore32
-rw-r--r--gr-gcell/Makefile.am24
-rw-r--r--gr-gcell/src/.gitignore39
-rw-r--r--gr-gcell/src/Makefile.am89
-rw-r--r--gr-gcell/src/examples/.gitignore32
-rw-r--r--gr-gcell/src/gc_job_manager.i75
-rw-r--r--gr-gcell/src/gcell.i40
-rw-r--r--gr-gcell/src/gcell_fft_vcc.cc160
-rw-r--r--gr-gcell/src/gcell_fft_vcc.h64
-rw-r--r--gr-gcell/src/gcell_fft_vcc.i56
-rwxr-xr-xgr-gcell/src/qa_fft.py162
-rw-r--r--gr-gpio/src/Makefile.am26
-rw-r--r--gr-gpio/src/fpga/include/Makefile.am27
-rw-r--r--gr-gpio/src/fpga/include/common_config_2rxhb_2tx_dig.vh71
-rw-r--r--gr-gpio/src/fpga/include/common_config_2rxint_2tx_dig.vh77
-rw-r--r--gr-gpio/src/fpga/include/common_config_bottom.vh133
-rw-r--r--gr-gpio/src/fpga/lib/Makefile.am33
-rw-r--r--gr-gpio/src/fpga/lib/gpio_input.v80
-rw-r--r--gr-gpio/src/fpga/lib/integ_shifter.v68
-rw-r--r--gr-gpio/src/fpga/lib/integrator.v75
-rw-r--r--gr-gpio/src/fpga/lib/io_pins.v55
-rw-r--r--gr-gpio/src/fpga/lib/rx_chain.v121
-rw-r--r--gr-gpio/src/fpga/lib/rx_chain_dig.v43
-rw-r--r--gr-gpio/src/fpga/lib/tx_chain_dig.v42
-rw-r--r--gr-gpio/src/fpga/rbf/std_2rxhb_2tx_dig.rbfbin181332 -> 0 bytes
-rw-r--r--gr-gpio/src/fpga/rbf/std_2rxint_2tx_dig.rbfbin158233 -> 0 bytes
-rw-r--r--gr-gpio/src/fpga/top/.gitignore11
-rw-r--r--gr-gpio/src/fpga/top/Makefile.am41
-rw-r--r--gr-gpio/src/fpga/top/config.vh60
-rw-r--r--gr-gpio/src/fpga/top/usrp_gpio.csf444
-rw-r--r--gr-gpio/src/fpga/top/usrp_gpio.esf14
-rw-r--r--gr-gpio/src/fpga/top/usrp_gpio.psf312
-rw-r--r--gr-gpio/src/fpga/top/usrp_gpio.qpf29
-rw-r--r--gr-gpio/src/fpga/top/usrp_gpio.qsf412
-rw-r--r--gr-gpio/src/fpga/top/usrp_gpio.v467
-rw-r--r--gr-gpio/src/python/Makefile.am37
-rw-r--r--gr-gpio/src/python/__init__.py34
-rw-r--r--gr-gpio/src/python/gpio.py1
-rwxr-xr-xgr-gpio/src/python/gpio_rx_sfile.py121
-rwxr-xr-xgr-gpio/src/python/gpio_usrp_fft.py333
-rwxr-xr-xgr-gpio/src/python/gpio_usrp_siggen.py208
-rw-r--r--gr-gsm-fr-vocoder/.gitignore23
-rw-r--r--gr-gsm-fr-vocoder/gnuradio-gsm-fr-vocoder.pc.in11
-rw-r--r--gr-gsm-fr-vocoder/src/.gitignore10
-rw-r--r--gr-gsm-fr-vocoder/src/Makefile.am25
-rw-r--r--gr-gsm-fr-vocoder/src/lib/.gitignore14
-rw-r--r--gr-gsm-fr-vocoder/src/lib/Makefile.am61
-rw-r--r--gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen145
-rw-r--r--gr-gsm-fr-vocoder/src/lib/gsm/.gitignore8
-rw-r--r--gr-gsm-fr-vocoder/src/python/run_tests.in10
-rw-r--r--gr-howto-write-a-block/version.sh6
-rw-r--r--gr-msdd6000/Makefile.am27
-rw-r--r--gr-msdd6000/doc/Softronics_Ltd_msdd6000_BlockDiagram.pdfbin43889 -> 0 bytes
-rw-r--r--gr-msdd6000/src/.gitignore11
-rw-r--r--gr-msdd6000/src/Makefile.am79
-rw-r--r--gr-msdd6000/src/Makefile.swig.gen290
-rw-r--r--gr-msdd6000/src/README34
-rw-r--r--gr-msdd6000/src/msdd6000.cc209
-rw-r--r--gr-msdd6000/src/msdd6000.h45
-rw-r--r--gr-msdd6000/src/msdd6000_rs.cc286
-rw-r--r--gr-msdd6000/src/msdd6000_rs.h66
-rw-r--r--gr-msdd6000/src/msdd_buffer_copy_behaviors.h38
-rw-r--r--gr-msdd6000/src/msdd_rs.i103
-rw-r--r--gr-msdd6000/src/msdd_rs_source_simple.cc240
-rw-r--r--gr-msdd6000/src/msdd_rs_source_simple.h87
-rw-r--r--gr-msdd6000/src/msdd_source_simple.cc168
-rw-r--r--gr-msdd6000/src/msdd_source_simple.h68
-rwxr-xr-xgr-msdd6000/src/python-examples/msdd_dynamics.py99
-rwxr-xr-xgr-msdd6000/src/python-examples/msdd_fft.py277
-rwxr-xr-xgr-msdd6000/src/python-examples/msdd_rcv.py287
-rwxr-xr-xgr-msdd6000/src/python-examples/msdd_rs_spec_an.py350
-rwxr-xr-xgr-msdd6000/src/python-examples/msdd_spectrum_sense.py296
-rwxr-xr-xgr-msdd6000/src/python-examples/msdd_spectrum_waterfall.py306
-rwxr-xr-xgr-msdd6000/src/python-examples/new_msdd_fft.py299
-rwxr-xr-xgr-msdd6000/src/python-examples/ofdm/benchmark_ofdm_rx.py184
-rwxr-xr-xgr-msdd6000/src/python-examples/ofdm/gr_plot_ofdm.py268
-rw-r--r--gr-msdd6000/src/python-examples/ofdm/receive_path.py102
-rw-r--r--gr-msdd6000/src/python-examples/playback_samples.m12
-rw-r--r--gr-msdd6000/src/python-examples/read_complex_binary.m48
-rw-r--r--gr-msdd6000/src/python_test/capture_tcp_one_set.py156
-rw-r--r--gr-msdd6000/src/python_test/flood_udp.py60
-rw-r--r--gr-msdd6000/src/python_test/halt.py40
-rw-r--r--gr-msdd6000/src/python_test/newtest.py140
-rw-r--r--gr-msdd6000/src/python_test/spectrogram.py87
-rwxr-xr-xgr-msdd6000/src/python_test/test_tcp.py78
-rw-r--r--gr-msdd6000/src/python_test/test_tcp_fft.py78
-rwxr-xr-xgr-msdd6000/src/python_test/test_udp.py59
-rw-r--r--gr-msdd6000/src/python_test/udp_stream_cap.py110
-rw-r--r--gr-msdd6000/src/python_test/udp_stream_rate_test.py106
-rw-r--r--gr-msdd6000/src/python_test/udp_stream_rate_test_plot.py161
-rw-r--r--gr-msdd6000/src/python_test/udp_stream_rate_test_plot_loop.py150
-rw-r--r--gr-msdd6000/src/python_test/udp_stream_test.py127
-rwxr-xr-xgr-msdd6000/src/qa_msdd_source_simple.py45
-rw-r--r--gr-noaa/swig/Makefile.swig.gen2
-rw-r--r--gr-pager/gnuradio-pager.pc.in2
-rw-r--r--gr-pager/swig/Makefile.swig.gen2
-rw-r--r--gr-qtgui/Makefile.am4
-rw-r--r--gr-qtgui/apps/Makefile.am6
-rwxr-xr-xgr-qtgui/apps/uhd_display.py (renamed from gr-qtgui/apps/usrp2_display.py)81
-rwxr-xr-xgr-qtgui/apps/usrp_display.py299
-rw-r--r--gr-qtgui/doc/.gitignore (renamed from gnuradio-examples/python/usrp2/.gitignore)0
-rw-r--r--gr-qtgui/doc/Makefile.am (renamed from gr-radar-mono/doc/Makefile.am)7
-rw-r--r--gr-qtgui/doc/README.qtgui12
-rw-r--r--gr-qtgui/doc/qtgui.dox77
-rw-r--r--gr-qtgui/examples/.gitignore (renamed from gr-cvsd-vocoder/src/.gitignore)0
-rw-r--r--gr-qtgui/examples/Makefile.am (renamed from gnuradio-examples/python/digital-bert/Makefile.am)19
-rwxr-xr-xgr-qtgui/examples/pyqt_example_c.py (renamed from gr-qtgui/apps/pyqt_example_c.py)0
-rwxr-xr-xgr-qtgui/examples/pyqt_example_f.py (renamed from gr-qtgui/apps/pyqt_example_f.py)0
-rwxr-xr-xgr-qtgui/examples/pyqt_time_c.py (renamed from gr-qtgui/apps/pyqt_time_c.py)0
-rwxr-xr-xgr-qtgui/examples/pyqt_time_f.py (renamed from gr-qtgui/apps/pyqt_time_f.py)0
-rw-r--r--gr-qtgui/grc/qtgui_sink_x.xml20
-rw-r--r--gr-qtgui/include/.gitignore (renamed from gr-gpio/.gitignore)0
-rw-r--r--gr-qtgui/include/Makefile.am (renamed from gnuradio-examples/python/apps/Makefile.am)13
-rw-r--r--gr-qtgui/include/gr_qtgui_api.h (renamed from gr-qtgui/lib/gr_qtgui_api.h)0
-rw-r--r--gr-qtgui/include/qtgui_sink_c.h (renamed from gr-qtgui/lib/qtgui_sink_c.h)11
-rw-r--r--gr-qtgui/include/qtgui_sink_f.h (renamed from gr-qtgui/lib/qtgui_sink_f.h)13
-rw-r--r--gr-qtgui/include/qtgui_time_sink_c.h (renamed from gr-qtgui/lib/qtgui_time_sink_c.h)38
-rw-r--r--gr-qtgui/include/qtgui_time_sink_f.h (renamed from gr-qtgui/lib/qtgui_time_sink_f.h)22
-rw-r--r--gr-qtgui/include/qtgui_util.h (renamed from gr-qtgui/lib/qtgui_util.h)0
-rw-r--r--gr-qtgui/lib/Makefile.am12
-rw-r--r--gr-qtgui/lib/qtgui_time_sink_c.cc30
-rw-r--r--gr-qtgui/lib/qtgui_time_sink_f.cc28
-rw-r--r--gr-qtgui/python/__init__.py5
-rw-r--r--gr-qtgui/swig/Makefile.am1
-rw-r--r--gr-qtgui/swig/Makefile.swig.gen2
-rw-r--r--gr-qtgui/swig/qtgui_sink_f.i2
-rw-r--r--gr-qtgui/swig/qtgui_time_sink_c.i2
-rw-r--r--gr-qtgui/swig/qtgui_time_sink_f.i2
-rw-r--r--gr-radar-mono/README67
-rw-r--r--gr-radar-mono/doc/.gitignore2
-rw-r--r--gr-radar-mono/doc/registers.odsbin14438 -> 0 bytes
-rw-r--r--gr-radar-mono/src/.gitignore2
-rw-r--r--gr-radar-mono/src/fpga/lib/.gitignore2
-rw-r--r--gr-radar-mono/src/fpga/lib/Makefile.am34
-rw-r--r--gr-radar-mono/src/fpga/lib/cordic_nco.v54
-rw-r--r--gr-radar-mono/src/fpga/lib/dac_interface.v60
-rwxr-xr-xgr-radar-mono/src/fpga/lib/fifo32_2k.v161
-rw-r--r--gr-radar-mono/src/fpga/lib/radar.v81
-rw-r--r--gr-radar-mono/src/fpga/lib/radar_config.vh41
-rw-r--r--gr-radar-mono/src/fpga/lib/radar_control.v166
-rw-r--r--gr-radar-mono/src/fpga/lib/radar_rx.v109
-rw-r--r--gr-radar-mono/src/fpga/lib/radar_tx.v59
-rw-r--r--gr-radar-mono/src/fpga/models/.gitignore2
-rw-r--r--gr-radar-mono/src/fpga/models/Makefile.am25
-rw-r--r--gr-radar-mono/src/fpga/models/fifo_1clk.v88
-rw-r--r--gr-radar-mono/src/fpga/tb/.gitignore6
-rw-r--r--gr-radar-mono/src/fpga/tb/Makefile.am30
-rw-r--r--gr-radar-mono/src/fpga/tb/radar_tb.sav42
-rwxr-xr-xgr-radar-mono/src/fpga/tb/radar_tb.sh7
-rw-r--r--gr-radar-mono/src/fpga/tb/radar_tb.v215
-rwxr-xr-xgr-radar-mono/src/fpga/tb/radar_tb_wave.sh2
-rw-r--r--gr-radar-mono/src/fpga/top/.gitignore21
-rw-r--r--gr-radar-mono/src/fpga/top/config.vh24
-rw-r--r--gr-radar-mono/src/fpga/top/dacpll.v291
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.csf444
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.esf14
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.psf312
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.qpf29
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.qsf402
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.rbfbin122609 -> 0 bytes
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.srf65
-rw-r--r--gr-radar-mono/src/fpga/top/usrp_radar_mono.v213
-rw-r--r--gr-radar-mono/src/lib/.gitignore2
-rw-r--r--gr-radar-mono/src/python/.gitignore4
-rw-r--r--gr-radar-mono/src/python/Makefile.am30
-rw-r--r--gr-radar-mono/src/python/qa_nothing.py0
-rw-r--r--gr-radar-mono/src/python/radar_mono.py330
-rw-r--r--gr-radar-mono/src/python/run_tests.in10
-rwxr-xr-xgr-radar-mono/src/python/usrp_radar_mono.py96
-rw-r--r--gr-radar-mono/src/utils/calc_avg.m8
-rw-r--r--gr-radar-mono/src/utils/czpad.m8
-rw-r--r--gr-radar-mono/src/utils/echo_image.m6
-rw-r--r--gr-radar-mono/src/utils/fftcorr.m4
-rw-r--r--gr-radar-mono/src/utils/pulse396
-rw-r--r--gr-radar-mono/src/utils/read_avg.m22
-rw-r--r--gr-radar-mono/src/utils/read_avg_sec.m25
-rw-r--r--gr-radar-mono/src/utils/read_echos.m7
-rw-r--r--gr-radio-astronomy/src/lib/Makefile.swig.gen2
-rw-r--r--gr-sounder/.gitignore2
-rw-r--r--gr-sounder/Makefile.am24
-rw-r--r--gr-sounder/README91
-rw-r--r--gr-sounder/doc/.gitignore2
-rw-r--r--gr-sounder/src/.gitignore2
-rw-r--r--gr-sounder/src/fpga/.gitignore2
-rw-r--r--gr-sounder/src/fpga/Makefile.am24
-rw-r--r--gr-sounder/src/fpga/lib/.gitignore2
-rw-r--r--gr-sounder/src/fpga/lib/Makefile.am30
-rw-r--r--gr-sounder/src/fpga/lib/dac_interface.v60
-rw-r--r--gr-sounder/src/fpga/lib/dacpll.v291
-rw-r--r--gr-sounder/src/fpga/lib/lfsr.v46
-rw-r--r--gr-sounder/src/fpga/lib/lfsr_constants.v63
-rw-r--r--gr-sounder/src/fpga/lib/sounder.v90
-rw-r--r--gr-sounder/src/fpga/lib/sounder_ctrl.v97
-rw-r--r--gr-sounder/src/fpga/lib/sounder_rx.v83
-rw-r--r--gr-sounder/src/fpga/lib/sounder_tx.v44
-rw-r--r--gr-sounder/src/fpga/tb/.gitignore5
-rw-r--r--gr-sounder/src/fpga/tb/Makefile.am30
-rw-r--r--gr-sounder/src/fpga/tb/sounder_tb.sav57
-rwxr-xr-xgr-sounder/src/fpga/tb/sounder_tb.sh6
-rw-r--r--gr-sounder/src/fpga/tb/sounder_tb.v238
-rwxr-xr-xgr-sounder/src/fpga/tb/sounder_tb_wave.sh2
-rw-r--r--gr-sounder/src/fpga/top/.gitignore11
-rw-r--r--gr-sounder/src/fpga/top/config.vh22
-rw-r--r--gr-sounder/src/fpga/top/usrp_sounder.csf444
-rw-r--r--gr-sounder/src/fpga/top/usrp_sounder.esf14
-rw-r--r--gr-sounder/src/fpga/top/usrp_sounder.psf312
-rw-r--r--gr-sounder/src/fpga/top/usrp_sounder.qpf29
-rw-r--r--gr-sounder/src/fpga/top/usrp_sounder.qsf396
-rwxr-xr-xgr-sounder/src/fpga/top/usrp_sounder.rbfbin113716 -> 0 bytes
-rw-r--r--gr-sounder/src/fpga/top/usrp_sounder.v198
-rw-r--r--gr-sounder/src/lib/.gitignore2
-rw-r--r--gr-sounder/src/lib/Makefile.am22
-rw-r--r--gr-sounder/src/python/.gitignore5
-rw-r--r--gr-sounder/src/python/qa_nothing.py0
-rw-r--r--gr-sounder/src/python/sounder.py271
-rwxr-xr-xgr-sounder/src/python/sounder_loopback.sh4
-rwxr-xr-xgr-sounder/src/python/usrp_sounder.py112
-rw-r--r--gr-trellis/src/lib/Makefile.am12
-rw-r--r--gr-trellis/src/lib/Makefile.swig.gen2
-rw-r--r--gr-trellis/src/lib/calc_metric.h2
-rw-r--r--gr-trellis/src/lib/core_algorithms.h2
-rw-r--r--gr-trellis/src/lib/fsm.cc4
-rw-r--r--gr-trellis/src/lib/fsm.h102
-rw-r--r--gr-trellis/src/lib/trellis.i12
-rw-r--r--gr-trellis/src/lib/trellis_constellation_metrics_cf.cc90
-rw-r--r--gr-trellis/src/lib/trellis_constellation_metrics_cf.h61
-rw-r--r--gr-trellis/src/lib/trellis_constellation_metrics_cf.i33
-rwxr-xr-xgr-trellis/src/python/qa_trellis.py122
-rw-r--r--gr-trellis/src/python/run_tests.in2
-rw-r--r--gr-uhd/Makefile.am2
-rw-r--r--gr-uhd/apps/Makefile.am10
-rw-r--r--gr-uhd/apps/hf_explorer/.gitignore (renamed from gnuradio-examples/python/apps/hf_explorer/.gitignore)0
-rw-r--r--gr-uhd/apps/hf_explorer/Makefile.am (renamed from gnuradio-examples/python/apps/hf_explorer/Makefile.am)2
-rw-r--r--gr-uhd/apps/hf_explorer/README42
-rwxr-xr-xgr-uhd/apps/hf_explorer/hfx.py (renamed from gnuradio-examples/python/apps/hf_explorer/hfx2.py)226
-rw-r--r--gr-uhd/apps/hf_explorer/hfx_help (renamed from gnuradio-examples/python/apps/hf_explorer/hfx_help)0
-rw-r--r--gr-uhd/apps/hf_radio/.gitignore (renamed from gnuradio-examples/python/apps/hf_radio/.gitignore)0
-rw-r--r--gr-uhd/apps/hf_radio/Makefile.am (renamed from gnuradio-examples/python/apps/hf_radio/Makefile.am)0
-rw-r--r--gr-uhd/apps/hf_radio/README.TXT (renamed from gnuradio-examples/python/apps/hf_radio/README.TXT)0
-rw-r--r--gr-uhd/apps/hf_radio/hfir.sci (renamed from gnuradio-examples/python/apps/hf_radio/hfir.sci)0
-rw-r--r--gr-uhd/apps/hf_radio/input.py78
-rw-r--r--gr-uhd/apps/hf_radio/output.py (renamed from gr-radar-mono/src/fpga/top/Makefile.am)42
-rwxr-xr-xgr-uhd/apps/hf_radio/radio.py (renamed from gnuradio-examples/python/apps/hf_radio/radio.py)167
-rw-r--r--gr-uhd/apps/hf_radio/radio.xml (renamed from gnuradio-examples/python/apps/hf_radio/radio.xml)0
-rw-r--r--gr-uhd/apps/hf_radio/ssb_taps (renamed from gnuradio-examples/python/apps/hf_radio/ssb_taps)0
-rw-r--r--gr-uhd/apps/hf_radio/ssbagc.py70
-rw-r--r--gr-uhd/apps/hf_radio/ssbdemod.py (renamed from gnuradio-examples/python/apps/hf_radio/ssbdemod.py)61
-rw-r--r--gr-uhd/apps/hf_radio/startup.py (renamed from gnuradio-examples/python/apps/hf_radio/startup.py)0
-rwxr-xr-xgr-uhd/apps/hf_radio/ui.py (renamed from gnuradio-examples/python/apps/hf_radio/ui.py)21
-rwxr-xr-xgr-uhd/apps/uhd_fft.py58
-rwxr-xr-xgr-uhd/apps/uhd_rx_nogui.py (renamed from gr-utils/src/python/usrp_rx_nogui.py)148
-rwxr-xr-xgr-uhd/apps/uhd_siggen.py (renamed from gr-utils/src/python/usrp_siggen.py)111
-rwxr-xr-xgr-uhd/apps/uhd_siggen_gui.py (renamed from gr-utils/src/python/usrp_siggen_gui.py)119
-rw-r--r--gr-uhd/doc/.gitignore (renamed from gr-gpio/src/.gitignore)0
-rw-r--r--gr-uhd/doc/Makefile.am (renamed from gr-radar-mono/Makefile.am)8
-rw-r--r--gr-uhd/doc/README.uhd14
-rw-r--r--gr-uhd/doc/uhd.dox35
-rw-r--r--gr-uhd/examples/.gitignore (renamed from gr-gpio/src/python/.gitignore)5
-rw-r--r--gr-uhd/examples/Makefile.am (renamed from gnuradio-examples/python/usrp2/Makefile.am)28
-rwxr-xr-xgr-uhd/examples/fm_tx4.py (renamed from gnuradio-examples/python/usrp/fm_tx4.py)106
-rwxr-xr-xgr-uhd/examples/fm_tx_2_daughterboards.py (renamed from gnuradio-examples/python/usrp/fm_tx_2_daughterboards.py)114
-rwxr-xr-xgr-uhd/examples/max_power.py142
-rw-r--r--gr-uhd/examples/multi-antenna/.gitignore (renamed from gnuradio-examples/python/digital/.gitignore)0
-rw-r--r--gr-uhd/examples/multi-antenna/Makefile.am (renamed from gnuradio-examples/python/multi-antenna/Makefile.am)0
-rwxr-xr-xgr-uhd/examples/multi-antenna/multi_fft.py152
-rwxr-xr-xgr-uhd/examples/multi-antenna/multi_file.py (renamed from gnuradio-examples/python/multi-antenna/multi_file.py)0
-rwxr-xr-xgr-uhd/examples/multi-antenna/multi_scope.py (renamed from gnuradio-examples/python/multi-antenna/multi_scope.py)0
-rwxr-xr-xgr-uhd/examples/usrp_am_mw_rcv.py (renamed from gnuradio-examples/python/usrp/usrp_am_mw_rcv.py)152
-rwxr-xr-xgr-uhd/examples/usrp_nbfm_ptt.py (renamed from gnuradio-examples/python/usrp/usrp_nbfm_ptt.py)161
-rwxr-xr-xgr-uhd/examples/usrp_nbfm_rcv.py (renamed from gnuradio-examples/python/usrp/usrp_nbfm_rcv.py)143
-rwxr-xr-xgr-uhd/examples/usrp_spectrum_sense.py (renamed from gnuradio-examples/python/usrp/usrp_spectrum_sense.py)110
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv.py (renamed from gnuradio-examples/python/usrp/usrp_tv_rcv.py)202
-rwxr-xr-xgr-uhd/examples/usrp_tv_rcv_nogui.py (renamed from gnuradio-examples/python/usrp/usrp_tv_rcv_nogui.py)125
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv.py (renamed from gnuradio-examples/python/usrp/usrp_wfm_rcv.py)141
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv2_nogui.py151
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_fmdet.py (renamed from gnuradio-examples/python/usrp/usrp_wfm_rcv_fmdet.py)135
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_nogui.py168
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_pll.py (renamed from gnuradio-examples/python/usrp/usrp_wfm_rcv_pll.py)140
-rwxr-xr-xgr-uhd/examples/usrp_wfm_rcv_sca.py (renamed from gnuradio-examples/python/usrp/usrp_wfm_rcv_sca.py)158
-rwxr-xr-xgr-uhd/examples/usrp_wxapt_rcv.py (renamed from gnuradio-examples/python/usrp/usrp_wxapt_rcv.py)120
-rw-r--r--gr-uhd/include/gr_uhd_amsg_source.h4
-rw-r--r--gr-uhd/include/gr_uhd_usrp_sink.h1
-rw-r--r--gr-uhd/include/gr_uhd_usrp_source.h1
-rw-r--r--gr-uhd/swig/Makefile.swig.gen2
-rw-r--r--gr-uhd/swig/__init__.py6
-rw-r--r--gr-usrp/src/Makefile.swig.gen2
-rw-r--r--gr-usrp2/src/Makefile.swig.gen2
-rw-r--r--gr-utils/src/python/Makefile.am8
-rwxr-xr-xgr-utils/src/python/gr_plot_const.py27
-rwxr-xr-xgr-utils/src/python/usrp2_fft.py273
-rwxr-xr-xgr-utils/src/python/usrp_fft.py309
-rwxr-xr-xgr-utils/src/python/usrp_oscope.py349
-rw-r--r--gr-video-sdl/src/Makefile.swig.gen2
-rw-r--r--gr-vocoder/.gitignore (renamed from gr-cvsd-vocoder/.gitignore)0
-rw-r--r--gr-vocoder/Makefile.am (renamed from gr-gcell/src/examples/Makefile.am)11
-rw-r--r--gr-vocoder/apps/.gitignore (renamed from gr-gpio/src/fpga/.gitignore)0
-rw-r--r--gr-vocoder/apps/Makefile.am (renamed from gr-sounder/doc/Makefile.am)3
-rw-r--r--gr-vocoder/doc/.gitignore (renamed from gr-gpio/src/fpga/include/.gitignore)0
-rw-r--r--gr-vocoder/doc/Makefile.am27
-rw-r--r--gr-vocoder/doc/README.vocoder12
-rw-r--r--gr-vocoder/doc/vocoder.dox24
-rw-r--r--gr-vocoder/examples/.gitignore (renamed from gr-radar-mono/src/fpga/.gitignore)1
-rw-r--r--gr-vocoder/examples/Makefile.am34
-rwxr-xr-xgr-vocoder/examples/alaw_audio_loopback.py (renamed from gr-gsm-fr-vocoder/src/python/encdec.py)9
-rwxr-xr-xgr-vocoder/examples/codec2_audio_loopback.py45
-rwxr-xr-xgr-vocoder/examples/cvsd_audio_loopback.py (renamed from gr-cvsd-vocoder/src/python/encdec.py)17
-rwxr-xr-xgr-vocoder/examples/g721_audio_loopback.py45
-rwxr-xr-xgr-vocoder/examples/g723_24_audio_loopback.py45
-rwxr-xr-xgr-vocoder/examples/g723_40_audio_loopback.py45
-rwxr-xr-xgr-vocoder/examples/gsm_audio_loopback.py45
-rwxr-xr-xgr-vocoder/examples/ulaw_audio_loopback.py45
-rw-r--r--gr-vocoder/gnuradio-vocoder.pc.in (renamed from gr-cvsd-vocoder/gnuradio-cvsd-vocoder.pc.in)6
-rw-r--r--gr-vocoder/grc/.gitignore (renamed from gr-cvsd-vocoder/src/lib/.gitignore)2
-rw-r--r--gr-vocoder/grc/Makefile.am (renamed from gr-radar-mono/src/lib/Makefile.am)4
-rw-r--r--gr-vocoder/include/.gitignore (renamed from gr-gpio/src/fpga/lib/.gitignore)0
-rw-r--r--gr-vocoder/include/Makefile.am (renamed from gnuradio-core/src/python/gnuradio/vocoder/Makefile.am)23
-rw-r--r--gr-vocoder/include/vocoder_alaw_decode_bs.h55
-rw-r--r--gr-vocoder/include/vocoder_alaw_encode_sb.h54
-rw-r--r--gr-vocoder/include/vocoder_codec2_decode_ps.h (renamed from gr-msdd6000/src/msdd.i)58
-rw-r--r--gr-vocoder/include/vocoder_codec2_encode_sp.h50
-rw-r--r--gr-vocoder/include/vocoder_cvsd_decode_bs.h (renamed from gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h)59
-rw-r--r--gr-vocoder/include/vocoder_cvsd_encode_sb.h (renamed from gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h)60
-rw-r--r--gr-vocoder/include/vocoder_g721_decode_bs.h44
-rw-r--r--gr-vocoder/include/vocoder_g721_encode_sb.h44
-rw-r--r--gr-vocoder/include/vocoder_g723_24_decode_bs.h44
-rw-r--r--gr-vocoder/include/vocoder_g723_24_encode_sb.h44
-rw-r--r--gr-vocoder/include/vocoder_g723_40_decode_bs.h44
-rw-r--r--gr-vocoder/include/vocoder_g723_40_encode_sb.h44
-rw-r--r--gr-vocoder/include/vocoder_gsm_fr_decode_ps.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.h)23
-rw-r--r--gr-vocoder/include/vocoder_gsm_fr_encode_sp.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.h)23
-rw-r--r--gr-vocoder/include/vocoder_ulaw_decode_bs.h55
-rw-r--r--gr-vocoder/include/vocoder_ulaw_encode_sb.h54
-rw-r--r--gr-vocoder/lib/.gitignore (renamed from gcell/lib/general/spu/.gitignore)9
-rw-r--r--gr-vocoder/lib/Makefile.am55
-rw-r--r--gr-vocoder/lib/codec2/.gitignore (renamed from gr-gpio/src/fpga/rbf/.gitignore)0
-rw-r--r--gr-vocoder/lib/codec2/Makefile.am125
-rw-r--r--gr-vocoder/lib/codec2/_kiss_fft_guts.h164
-rw-r--r--gr-vocoder/lib/codec2/c2dec.c82
-rw-r--r--gr-vocoder/lib/codec2/c2demo.c86
-rw-r--r--gr-vocoder/lib/codec2/c2enc.c83
-rw-r--r--gr-vocoder/lib/codec2/c2sim.c469
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp1.txt17
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp10.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp2.txt17
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp3.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp4.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp5.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp6.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp7.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp8.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/dlsp9.txt9
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp1.txt17
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp10.txt6
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp2.txt17
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp3.txt17
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp4.txt17
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp5.txt19
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp6.txt19
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp7.txt19
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp8.txt11
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp8910.txt65
-rw-r--r--gr-vocoder/lib/codec2/codebook/lsp9.txt11
-rw-r--r--gr-vocoder/lib/codec2/codec2.c342
-rw-r--r--gr-vocoder/lib/codec2/codec2.h41
-rw-r--r--gr-vocoder/lib/codec2/codec2_internal.h63
-rw-r--r--gr-vocoder/lib/codec2/comp.h38
-rw-r--r--gr-vocoder/lib/codec2/defines.h88
-rw-r--r--gr-vocoder/lib/codec2/dump.c469
-rw-r--r--gr-vocoder/lib/codec2/dump.h67
-rw-r--r--gr-vocoder/lib/codec2/fft.c101
-rw-r--r--gr-vocoder/lib/codec2/fft.h16
-rwxr-xr-xgr-vocoder/lib/codec2/fq20.sh8
-rw-r--r--gr-vocoder/lib/codec2/generate_codebook.c179
-rw-r--r--gr-vocoder/lib/codec2/globals.c49
-rw-r--r--gr-vocoder/lib/codec2/globals.h47
-rw-r--r--gr-vocoder/lib/codec2/glottal.c257
-rw-r--r--gr-vocoder/lib/codec2/interp.c472
-rw-r--r--gr-vocoder/lib/codec2/interp.h41
-rw-r--r--gr-vocoder/lib/codec2/kiss_fft.c408
-rw-r--r--gr-vocoder/lib/codec2/kiss_fft.h124
-rwxr-xr-xgr-vocoder/lib/codec2/listensim.sh9
-rw-r--r--gr-vocoder/lib/codec2/lpc.c279
-rw-r--r--gr-vocoder/lib/codec2/lpc.h42
-rw-r--r--gr-vocoder/lib/codec2/lsp.c325
-rw-r--r--gr-vocoder/lib/codec2/lsp.h37
-rw-r--r--gr-vocoder/lib/codec2/nlp.c364
-rw-r--r--gr-vocoder/lib/codec2/nlp.h39
-rw-r--r--gr-vocoder/lib/codec2/pack.c105
-rw-r--r--gr-vocoder/lib/codec2/phase.c262
-rw-r--r--gr-vocoder/lib/codec2/phase.h34
-rw-r--r--gr-vocoder/lib/codec2/postfilter.c133
-rw-r--r--gr-vocoder/lib/codec2/postfilter.h33
-rw-r--r--gr-vocoder/lib/codec2/quantise.c851
-rw-r--r--gr-vocoder/lib/codec2/quantise.h83
-rwxr-xr-xgr-vocoder/lib/codec2/sim.sh22
-rw-r--r--gr-vocoder/lib/codec2/sine.c638
-rw-r--r--gr-vocoder/lib/codec2/sine.h44
-rw-r--r--gr-vocoder/lib/g7xx/.gitignore (renamed from gcell/ibm/.gitignore)0
-rw-r--r--gr-vocoder/lib/g7xx/Makefile.am (renamed from gnuradio-core/src/lib/g72x/Makefile.am)6
-rw-r--r--gr-vocoder/lib/g7xx/README (renamed from gnuradio-core/src/lib/g72x/README)0
-rw-r--r--gr-vocoder/lib/g7xx/decode.c (renamed from gnuradio-core/src/lib/g72x/decode.c)0
-rw-r--r--gr-vocoder/lib/g7xx/encode.c (renamed from gnuradio-core/src/lib/g72x/encode.c)0
-rw-r--r--gr-vocoder/lib/g7xx/g711.c (renamed from gnuradio-core/src/lib/g72x/g711.c)0
-rw-r--r--gr-vocoder/lib/g7xx/g721.c (renamed from gnuradio-core/src/lib/g72x/g721.c)0
-rw-r--r--gr-vocoder/lib/g7xx/g723_24.c (renamed from gnuradio-core/src/lib/g72x/g723_24.c)0
-rw-r--r--gr-vocoder/lib/g7xx/g723_40.c (renamed from gnuradio-core/src/lib/g72x/g723_40.c)0
-rw-r--r--gr-vocoder/lib/g7xx/g72x.c (renamed from gnuradio-core/src/lib/g72x/g72x.c)0
-rw-r--r--gr-vocoder/lib/g7xx/g72x.h (renamed from gnuradio-core/src/lib/g72x/g72x.h)0
-rw-r--r--gr-vocoder/lib/gsm/.gitignore (renamed from gcell/include/.gitignore)0
-rw-r--r--gr-vocoder/lib/gsm/COPYRIGHT (renamed from gr-gsm-fr-vocoder/src/lib/gsm/COPYRIGHT)0
-rw-r--r--gr-vocoder/lib/gsm/Makefile.am (renamed from gr-gsm-fr-vocoder/src/lib/gsm/Makefile.am)0
-rw-r--r--gr-vocoder/lib/gsm/README (renamed from gr-gsm-fr-vocoder/src/lib/gsm/README)0
-rw-r--r--gr-vocoder/lib/gsm/README.gsm (renamed from gr-gsm-fr-vocoder/src/lib/gsm/README.gsm)0
-rw-r--r--gr-vocoder/lib/gsm/add.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/add.c)0
-rw-r--r--gr-vocoder/lib/gsm/code.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/code.c)0
-rw-r--r--gr-vocoder/lib/gsm/config.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm/config.h)0
-rw-r--r--gr-vocoder/lib/gsm/debug.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/debug.c)0
-rw-r--r--gr-vocoder/lib/gsm/decode.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/decode.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm.h)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_create.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_create.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_decode.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_decode.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_destroy.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_destroy.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_encode.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_encode.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_explode.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_explode.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_implode.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_implode.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_option.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_option.c)0
-rw-r--r--gr-vocoder/lib/gsm/gsm_print.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/gsm_print.c)0
-rw-r--r--gr-vocoder/lib/gsm/long_term.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/long_term.c)0
-rw-r--r--gr-vocoder/lib/gsm/lpc.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/lpc.c)0
-rw-r--r--gr-vocoder/lib/gsm/preprocess.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/preprocess.c)0
-rw-r--r--gr-vocoder/lib/gsm/private.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm/private.h)0
-rw-r--r--gr-vocoder/lib/gsm/proto.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm/proto.h)0
-rw-r--r--gr-vocoder/lib/gsm/rpe.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/rpe.c)0
-rw-r--r--gr-vocoder/lib/gsm/short_term.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/short_term.c)0
-rw-r--r--gr-vocoder/lib/gsm/table.c (renamed from gr-gsm-fr-vocoder/src/lib/gsm/table.c)0
-rw-r--r--gr-vocoder/lib/gsm/unproto.h (renamed from gr-gsm-fr-vocoder/src/lib/gsm/unproto.h)0
-rw-r--r--gr-vocoder/lib/vocoder_alaw_decode_bs.cc65
-rw-r--r--gr-vocoder/lib/vocoder_alaw_encode_sb.cc63
-rw-r--r--gr-vocoder/lib/vocoder_codec2_decode_ps.cc75
-rw-r--r--gr-vocoder/lib/vocoder_codec2_encode_sp.cc72
-rw-r--r--gr-vocoder/lib/vocoder_cvsd_decode_bs.cc (renamed from gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc)42
-rw-r--r--gr-vocoder/lib/vocoder_cvsd_encode_sb.cc (renamed from gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc)44
-rw-r--r--gr-vocoder/lib/vocoder_g721_decode_bs.cc81
-rw-r--r--gr-vocoder/lib/vocoder_g721_encode_sb.cc81
-rw-r--r--gr-vocoder/lib/vocoder_g723_24_decode_bs.cc81
-rw-r--r--gr-vocoder/lib/vocoder_g723_24_encode_sb.cc81
-rw-r--r--gr-vocoder/lib/vocoder_g723_40_decode_bs.cc81
-rw-r--r--gr-vocoder/lib/vocoder_g723_40_encode_sb.cc81
-rw-r--r--gr-vocoder/lib/vocoder_gsm_fr_decode_ps.cc (renamed from gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.cc)18
-rw-r--r--gr-vocoder/lib/vocoder_gsm_fr_encode_sp.cc (renamed from gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.cc)18
-rw-r--r--gr-vocoder/lib/vocoder_ulaw_decode_bs.cc65
-rw-r--r--gr-vocoder/lib/vocoder_ulaw_encode_sb.cc63
-rw-r--r--gr-vocoder/python/.gitignore (renamed from gr-gsm-fr-vocoder/src/python/.gitignore)0
-rw-r--r--gr-vocoder/python/Makefile.am (renamed from gr-cvsd-vocoder/src/python/Makefile.am)24
-rw-r--r--gr-vocoder/python/__init__.py (renamed from gnuradio-examples/python/digital_voice/Makefile.am)14
-rw-r--r--gr-vocoder/python/cvsd.py (renamed from gr-cvsd-vocoder/src/python/cvsd.py)13
-rwxr-xr-x[-rw-r--r--]gr-vocoder/python/qa_alaw_vocoder.py (renamed from gr-sounder/src/python/Makefile.am)30
-rwxr-xr-xgr-vocoder/python/qa_codec2_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_cvsd_vocoder.py (renamed from gr-cvsd-vocoder/src/python/qa_cvsd_vocoder.py)16
-rwxr-xr-xgr-vocoder/python/qa_g721_vocoder.py39
-rwxr-xr-x[-rw-r--r--]gr-vocoder/python/qa_g723_24_vocoder.py (renamed from gr-sounder/src/fpga/top/Makefile.am)39
-rwxr-xr-xgr-vocoder/python/qa_g723_40_vocoder.py39
-rwxr-xr-xgr-vocoder/python/qa_gsm_full_rate.py (renamed from gr-gsm-fr-vocoder/src/python/qa_gsm_full_rate.py)6
-rwxr-xr-xgr-vocoder/python/qa_ulaw_vocoder.py39
-rw-r--r--gr-vocoder/python/run_tests.in (renamed from gr-sounder/src/python/run_tests.in)4
-rw-r--r--gr-vocoder/swig/.gitignore (renamed from gr-radar-mono/.gitignore)0
-rw-r--r--gr-vocoder/swig/Makefile.am82
-rw-r--r--gr-vocoder/swig/Makefile.swig.gen (renamed from gr-cvsd-vocoder/src/lib/Makefile.swig.gen)98
-rw-r--r--gr-vocoder/swig/run_guile_tests.in14
-rw-r--r--gr-vocoder/swig/vocoder_alaw_decode_bs.i35
-rw-r--r--gr-vocoder/swig/vocoder_alaw_encode_sb.i35
-rw-r--r--gr-vocoder/swig/vocoder_codec2_decode_ps.i34
-rw-r--r--gr-vocoder/swig/vocoder_codec2_encode_sp.i34
-rw-r--r--gr-vocoder/swig/vocoder_cvsd_decode_bs.i44
-rw-r--r--gr-vocoder/swig/vocoder_cvsd_encode_sb.i44
-rw-r--r--gr-vocoder/swig/vocoder_g721_decode_bs.i33
-rw-r--r--gr-vocoder/swig/vocoder_g721_encode_sb.i33
-rw-r--r--gr-vocoder/swig/vocoder_g723_24_decode_bs.i33
-rw-r--r--gr-vocoder/swig/vocoder_g723_24_encode_sb.i33
-rw-r--r--gr-vocoder/swig/vocoder_g723_40_decode_bs.i33
-rw-r--r--gr-vocoder/swig/vocoder_g723_40_encode_sb.i33
-rw-r--r--gr-vocoder/swig/vocoder_gsm_fr_decode_ps.i35
-rw-r--r--gr-vocoder/swig/vocoder_gsm_fr_encode_sp.i35
-rw-r--r--gr-vocoder/swig/vocoder_swig.i (renamed from gr-gsm-fr-vocoder/src/lib/gsm_full_rate.i)44
-rw-r--r--gr-vocoder/swig/vocoder_ulaw_decode_bs.i35
-rw-r--r--gr-vocoder/swig/vocoder_ulaw_encode_sb.i35
-rw-r--r--gr-wxgui/grc/wxgui_constellationsink2.xml8
-rw-r--r--gr-wxgui/src/python/const_window.py22
-rw-r--r--gr-wxgui/src/python/constants.py1
-rw-r--r--gr-wxgui/src/python/constsink_gl.py25
-rw-r--r--grc/blocks/Makefile.am14
-rw-r--r--grc/blocks/blks2_dxpsk2_mod.xml95
-rw-r--r--grc/blocks/blks2_dxpsk_demod.xml127
-rw-r--r--grc/blocks/block_tree.xml17
-rw-r--r--grc/blocks/gr_costas_loop_cc.xml52
-rw-r--r--grc/blocks/gr_cpmmod_bc.xml69
-rw-r--r--grc/blocks/gr_gmskmod_bc.xml38
-rw-r--r--grc/blocks/gr_pfb_clock_sync.xml7
-rw-r--r--grc/blocks/gr_pll_carriertracking_cc.xml12
-rw-r--r--grc/blocks/gr_pll_freqdet_cf.xml12
-rw-r--r--grc/blocks/gr_pll_refout_cc.xml12
-rw-r--r--gruel/src/swig/Makefile.swig.gen42
-rw-r--r--usrp/host/swig/Makefile.swig.gen2
-rw-r--r--version.sh6
1022 files changed, 37230 insertions, 56055 deletions
diff --git a/Makefile.am b/Makefile.am
index 5891c2c89..417f659c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,7 +26,6 @@ include $(top_srcdir)/Makefile.common
EXTRA_DIST += \
bootstrap \
configure \
- configure-cell-cross \
config.h.in \
run_tests.sh.in \
Makefile.swig \
diff --git a/Makefile.common b/Makefile.common
index 20b8a78cf..8faf64586 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -63,13 +63,6 @@ grpyexecdir = $(pyexecdir)/gnuradio
usrppythondir = $(pythondir)/usrpm
usrppyexecdir = $(pyexecdir)/usrpm
-# gcell includes
-gcellincludedir = $(includedir)/gcell
-gcellspuincludedir = $(includedir)/gcell/spu
-
-# Cell spu libs
-libspudir = $(libdir)spu
-
# This used to be set in configure.ac but is now defined here for all
# Makefiles when this fragment is included.
STD_DEFINES_AND_INCLUDES = $(DEFINES) $(GNURADIO_INCLUDES) \
@@ -99,16 +92,13 @@ VOLK_LA = @volk_LA@
USRP_INCLUDES = @usrp_INCLUDES@
USRP_LA = @usrp_LA@
-# How to link the gcell library from inside the tree (the PPU part)
-GCELL_INCLUDES = @gcell_INCLUDES@
-GCELL_LA = @gcell_LA@
-
-# How to link the gcell library from inside the tree (the SPU part)
-GCELL_SPU_INCLUDES = @gcell_spu_INCLUDES@
-GCELL_SPU_LA = @gcell_spu_LA@
+# GR-DIGITAL includes and libraries
+GR_DIGITAL_INCLUDES = @gr_digital_INCLUDES@
+GR_DIGITAL_LA = @gr_digital_LA@
-# libtool aware wrapper for ppu-embedspu
-GCELL_EMBEDSPU_LIBTOOL = @abs_top_srcdir@/gcell/lib/runtime/gcell-embedspu-libtool
+# GR-QTGUI includes and libraries
+GR_QTGUI_INCLUDES = @gr_qtgui_INCLUDES@
+GR_QTGUI_LA = @gr_qtgui_LA@
# Fix for BSD make not defining $(RM). We define it now in configure.ac
# using AM_PATH_PROG, but now here have to add a -f to be like GNU make
diff --git a/Makefile.swig b/Makefile.swig
index 2ed69c6c7..87e918c35 100644
--- a/Makefile.swig
+++ b/Makefile.swig
@@ -169,6 +169,7 @@ gnuradio/%.scm : %.i
## Rule that (re)generates Makefile.swig.gen using TOP_SWIG_IFILES and
## Makefile.swig.gen.t
##
+
## Create $(srcdir)/Makefile.swig.gen, containing all of the rules
## for running SWIG to generate or re-generate outputs. SWIG file
## names are to be defined in TOP_SWIG_IFILES, and must include the
diff --git a/Makefile.swig.gen.t b/Makefile.swig.gen.t
index 4d37e0e21..0410413ed 100644
--- a/Makefile.swig.gen.t
+++ b/Makefile.swig.gen.t
@@ -105,7 +105,7 @@ _@NAME@_la_CXXFLAGS = \
$(@NAME@_la_swig_cxxflags)
python/@NAME@.cc: @NAME@.py
-@NAME@.py: @NAME@.i
+@NAME@.py: @NAME@.i
# Include the python dependencies for this file
-include python/@NAME@.d
diff --git a/config/Makefile.am b/config/Makefile.am
index ba3026cd9..d2cb02865 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -46,23 +46,18 @@ m4macros = \
cppunit.m4 \
grc_build.m4 \
grc_docs.m4 \
- grc_gcell.m4 \
grc_gnuradio_core.m4 \
grc_gnuradio_examples.m4 \
grc_grc.m4 \
grc_gr_atsc.m4 \
grc_gr_audio.m4 \
grc_gr_comedi.m4 \
- grc_gr_gcell.m4 \
- grc_gr_gpio.m4 \
- grc_gr_gsm_fr_vocoder.m4 \
grc_gr_noaa.m4 \
- grc_gr_radar_mono.m4 \
grc_gr_radio_astronomy.m4 \
- grc_gr_sounder.m4 \
grc_gr_trellis.m4 \
grc_gr_usrp.m4 \
grc_gr_video_sdl.m4 \
+ grc_gr_vocoder.m4 \
grc_gr_wxgui.m4 \
grc_gruel.m4 \
gr_check_createfilemapping.m4 \
@@ -71,10 +66,8 @@ m4macros = \
gr_check_usrp.m4 \
grc_usrp.m4 \
grc_usrp2.m4 \
- grc_gr_msdd6000.m4 \
gr_doxygen.m4 \
gr_fortran.m4 \
- gr_gcell.m4 \
gr_git.m4 \
gr_gprof.m4 \
gr_lib64.m4 \
diff --git a/config/gr_gcell.m4 b/config/gr_gcell.m4
deleted file mode 100644
index 0b8b97802..000000000
--- a/config/gr_gcell.m4
+++ /dev/null
@@ -1,36 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-AC_DEFUN([GR_GCELL],[
- passed=yes
- PKG_CHECK_MODULES(GCELL, gcell >= 3.1, [],
- [passed=no; AC_MSG_RESULT([gcell not found])])
- PKG_CHECK_MODULES(GCELL_SPU, gcell_spu >= 3.1, [],
- [passed=no; AC_MSG_RESULT([gcell_spu not found])])
-
- GCELL_EMBEDSPU_LIBTOOL=
- if test $passed = yes; then
- GCELL_EMBEDSPU_LIBTOOL=`$PKG_CONFIG --variable=gcell_embedspu_libtool gcell 2>/dev/null`
- AC_DEFINE(HAVE_GCELL,[1],[Define if you have gcell installed])
- fi
- AC_SUBST([GCELL_EMBEDSPU_LIBTOOL])
-
- AM_CONDITIONAL([HAVE_GCELL], [test "$passed" = "yes"])
-])
diff --git a/config/grc_gcell.m4 b/config/grc_gcell.m4
deleted file mode 100644
index b94deb4db..000000000
--- a/config/grc_gcell.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2010 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GCELL],[
- GRC_ENABLE(gcell)
- dnl GRC_WITH(gcell)
-
- dnl If execution gets to here, $passed will be:
- dnl with : if the --with code didn't error out
- dnl yes : if the --enable code passed muster and all dependencies are met
- dnl no : otherwise
- if test $passed = yes; then
- dnl Don't build gcell if host_cpu isn't powerpc
- AC_MSG_CHECKING([whether host_cpu is powerpc*])
- case "$host_cpu" in
- powerpc*)
- AC_MSG_RESULT(yes)
- ;;
- *)
- passed=no
- AC_MSG_RESULT(no)
- ;;
- esac
-
- dnl Don't build gcell if we can't find spu-gcc.
- AC_CHECK_PROG([SPU_GCC_PROG],[spu-gcc],[yes],[no])
- if test $SPU_GCC_PROG = no; then
- passed=no
- fi
- fi
-
- if test $passed != with; then
- dnl how and where to find INCLUDES and LA
- gcell_INCLUDES="-I\${abs_top_srcdir}/gcell/include"
- gcell_LA="\${abs_top_builddir}/gcell/lib/libgcell.la"
- gcell_spu_INCLUDES="-I\${abs_top_srcdir}/gcell/include"
- gcell_spu_LA="\${abs_top_builddir}/gcell/lib/spu/libgcell_spu.a"
- AC_SUBST(gcell_spu_INCLUDES)
- AC_SUBST(gcell_spu_LA)
-
- fi
-
- AC_CONFIG_FILES([ \
- gcell/Makefile \
- gcell/gcell.pc \
- gcell/gcell_spu.pc \
- gcell/include/Makefile \
- gcell/include/gcell/Makefile \
- gcell/include/gcell/spu/Makefile \
- gcell/lib/Makefile \
- gcell/lib/spu/Makefile \
- gcell/lib/general/Makefile \
- gcell/lib/wrapper/Makefile \
- gcell/lib/runtime/Makefile \
- gcell/apps/Makefile \
- gcell/apps/spu/Makefile \
- gcell/ibm/Makefile \
- ])
-
- GRC_BUILD_CONDITIONAL(gcell)
-])
diff --git a/config/grc_gnuradio_core.m4 b/config/grc_gnuradio_core.m4
index 15086be0f..a35629e2e 100644
--- a/config/grc_gnuradio_core.m4
+++ b/config/grc_gnuradio_core.m4
@@ -86,7 +86,6 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
gnuradio-core/src/guile/gr-run-waveform-script \
gnuradio-core/src/lib/Makefile \
gnuradio-core/src/lib/filter/Makefile \
- gnuradio-core/src/lib/g72x/Makefile \
gnuradio-core/src/lib/general/Makefile \
gnuradio-core/src/lib/general/gr_constants.cc \
gnuradio-core/src/lib/gengen/Makefile \
@@ -106,7 +105,6 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
gnuradio-core/src/python/gnuradio/gr/run_tests \
gnuradio-core/src/python/gnuradio/gru/Makefile \
gnuradio-core/src/python/gnuradio/gruimpl/Makefile \
- gnuradio-core/src/python/gnuradio/vocoder/Makefile \
gnuradio-core/src/tests/Makefile \
gnuradio-core/src/utils/Makefile \
])
@@ -117,6 +115,8 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
[
chmod +x gnuradio-core/src/python/gnuradio/gr/run_tests
chmod +x gnuradio-core/src/guile/run_guile_tests
- ])
+ ]) \
+ AC_CONFIG_COMMANDS([run_tests_utils],[chmod +x gnuradio-core/src/python/gnuradio/utils/run_tests])
])
+
])
diff --git a/config/grc_gnuradio_examples.m4 b/config/grc_gnuradio_examples.m4
index 349ecd3d7..9a32e5ab9 100644
--- a/config/grc_gnuradio_examples.m4
+++ b/config/grc_gnuradio_examples.m4
@@ -28,21 +28,12 @@ AC_DEFUN([GRC_GNURADIO_EXAMPLES],[
gnuradio-examples/Makefile \
gnuradio-examples/python/Makefile \
gnuradio-examples/grc/Makefile \
- gnuradio-examples/python/apps/hf_explorer/Makefile \
- gnuradio-examples/python/apps/hf_radio/Makefile \
- gnuradio-examples/python/apps/Makefile \
- gnuradio-examples/python/digital/Makefile \
- gnuradio-examples/python/digital_voice/Makefile \
- gnuradio-examples/python/digital-bert/Makefile \
gnuradio-examples/python/mp-sched/Makefile \
- gnuradio-examples/python/multi-antenna/Makefile \
gnuradio-examples/python/multi_usrp/Makefile \
gnuradio-examples/python/network/Makefile \
gnuradio-examples/python/ofdm/Makefile \
gnuradio-examples/python/pfb/Makefile \
gnuradio-examples/python/tags/Makefile \
- gnuradio-examples/python/usrp/Makefile \
- gnuradio-examples/python/usrp2/Makefile \
gnuradio-examples/waveforms/Makefile \
])
diff --git a/config/grc_gr_audio.m4 b/config/grc_gr_audio.m4
index 92a0440d0..0e881671a 100644
--- a/config/grc_gr_audio.m4
+++ b/config/grc_gr_audio.m4
@@ -108,6 +108,7 @@ AC_DEFUN([GRC_GR_AUDIO],[
gr-audio/include/Makefile \
gr-audio/lib/Makefile \
gr-audio/swig/Makefile \
+ gr-audio/doc/Makefile \
gr-audio/gnuradio-audio.pc \
])
diff --git a/config/grc_gr_cvsd_vocoder.m4 b/config/grc_gr_cvsd_vocoder.m4
deleted file mode 100644
index ddf6f9b2f..000000000
--- a/config/grc_gr_cvsd_vocoder.m4
+++ /dev/null
@@ -1,39 +0,0 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_CVSD_VOCODER],[
- GRC_ENABLE(gr-cvsd-vocoder)
-
- dnl Don't do gr-cvsd-vocoder if gnuradio-core skipped
- GRC_CHECK_DEPENDENCY(gr-cvsd-vocoder, gnuradio-core)
-
- AC_CONFIG_FILES([\
- gr-cvsd-vocoder/Makefile \
- gr-cvsd-vocoder/gnuradio-cvsd-vocoder.pc \
- gr-cvsd-vocoder/src/Makefile \
- gr-cvsd-vocoder/src/lib/Makefile \
- gr-cvsd-vocoder/src/python/Makefile \
- gr-cvsd-vocoder/src/python/run_tests \
- ])
-
- GRC_BUILD_CONDITIONAL(gr-cvsd-vocoder,[
- dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_cvsd], [chmod +x gr-cvsd-vocoder/src/python/run_tests])
- ])
-])
diff --git a/config/grc_gr_digital.m4 b/config/grc_gr_digital.m4
new file mode 100644
index 000000000..9beb59d4b
--- /dev/null
+++ b/config/grc_gr_digital.m4
@@ -0,0 +1,63 @@
+dnl Copyright 2011 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GNU Radio
+dnl
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+
+AC_DEFUN([GRC_GR_DIGITAL],[
+ GRC_ENABLE(gr-digital)
+
+ dnl Don't do gr-digital if gnuradio-core skipped
+ GRC_CHECK_DEPENDENCY(gr-digital, gnuradio-core)
+
+ if test $passed != with; then
+ dnl how and where to find INCLUDES and LA and such
+ gr_digital_INCLUDES="\
+-I\${abs_top_srcdir}/gr-digital/include \
+-I\${abs_top_srcdir}/gr-digital/swig"
+ gr_digital_LA="\${abs_top_builddir}/gr-digital/lib/libgnuradio-digital.la"
+ gr_digital_LIBDIRPATH="\${abs_top_builddir}/gr-digital/lib:\${abs_top_builddir}/gr-digital/lib/.libs"
+ gr_digital_SWIGDIRPATH="\${abs_top_builddir}/gr-digtial/lib/swig:\${abs_top_builddir}/gr-digital/swig/.libs:\${abs_top_srcdir}/gr-digital/swig"
+ gr_digital_PYDIRPATH="\${abs_top_srcdir}/gr-digital/python"
+ fi
+
+ AC_SUBST(gr_digital_I)
+ AC_SUBST(gr_digital_SWIGDIRPATH)
+ AC_SUBST(gr_digital_PYDIRPATH)
+
+ AC_CONFIG_FILES([\
+ gr-digital/Makefile \
+ gr-digital/gnuradio-digital.pc \
+ gr-digital/apps/Makefile \
+ gr-digital/grc/Makefile \
+ gr-digital/include/Makefile \
+ gr-digital/lib/Makefile \
+ gr-digital/python/Makefile \
+ gr-digital/python/run_tests \
+ gr-digital/python/utils/Makefile \
+ gr-digital/swig/Makefile \
+ gr-digital/swig/run_guile_tests \
+ gr-digital/examples/Makefile \
+ gr-digital/doc/Makefile \
+ ])
+
+ GRC_BUILD_CONDITIONAL(gr-digital,[
+ dnl run_tests is created from run_tests.in. Make it executable.
+ AC_CONFIG_COMMANDS([run_tests_digital],
+ [chmod +x gr-digital/python/run_tests
+ chmod +x gr-digital/swig/run_guile_tests])
+ ])
+])
diff --git a/config/grc_gr_gcell.m4 b/config/grc_gr_gcell.m4
deleted file mode 100644
index 476de364f..000000000
--- a/config/grc_gr_gcell.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2009 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_GCELL],[
- GRC_ENABLE(gr-gcell)
-
- dnl Don't do gr-gcell if gcell or gnuradio-core skipped
- GRC_CHECK_DEPENDENCY(gr-gcell, gcell)
- GRC_CHECK_DEPENDENCY(gr-gcell, gnuradio-core)
-
- AC_CONFIG_FILES([ \
- gr-gcell/Makefile \
- gr-gcell/src/Makefile \
- gr-gcell/src/examples/Makefile \
- gr-gcell/src/run_tests \
- ])
-
- GRC_BUILD_CONDITIONAL(gr-gcell,[
- dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_gcell], [chmod +x gr-gcell/src/run_tests])
- ])
-])
diff --git a/config/grc_gr_gpio.m4 b/config/grc_gr_gpio.m4
deleted file mode 100644
index 26c04b95c..000000000
--- a/config/grc_gr_gpio.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl Copyright 2007,2008,2009 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_GPIO],[
- GRC_ENABLE(gr-gpio)
-
- dnl Don't do gr-gpio if usrp skipped
- GRC_CHECK_DEPENDENCY(gr-gpio, usrp)
-
- AC_CONFIG_FILES([ \
- gr-gpio/Makefile \
- gr-gpio/src/Makefile \
- gr-gpio/src/fpga/Makefile \
- gr-gpio/src/fpga/include/Makefile \
- gr-gpio/src/fpga/top/Makefile \
- gr-gpio/src/fpga/lib/Makefile \
- gr-gpio/src/fpga/rbf/Makefile \
- gr-gpio/src/python/Makefile
- ])
-
- GRC_BUILD_CONDITIONAL(gr-gpio)
-])
diff --git a/config/grc_gr_gsm_fr_vocoder.m4 b/config/grc_gr_gsm_fr_vocoder.m4
deleted file mode 100644
index a93d4edb7..000000000
--- a/config/grc_gr_gsm_fr_vocoder.m4
+++ /dev/null
@@ -1,40 +0,0 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_GSM_FR_VOCODER],[
- GRC_ENABLE(gr-gsm-fr-vocoder)
-
- dnl Don't do gr-gsm-fr-vocoder if gnuradio-core skipped
- GRC_CHECK_DEPENDENCY(gr-gsm-fr-vocoder, gnuradio-core)
-
- AC_CONFIG_FILES([\
- gr-gsm-fr-vocoder/Makefile \
- gr-gsm-fr-vocoder/gnuradio-gsm-fr-vocoder.pc \
- gr-gsm-fr-vocoder/src/Makefile \
- gr-gsm-fr-vocoder/src/lib/Makefile \
- gr-gsm-fr-vocoder/src/lib/gsm/Makefile \
- gr-gsm-fr-vocoder/src/python/Makefile \
- gr-gsm-fr-vocoder/src/python/run_tests \
- ])
-
- GRC_BUILD_CONDITIONAL(gr-gsm-fr-vocoder,[
- dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_gsm], [chmod +x gr-gsm-fr-vocoder/src/python/run_tests])
- ])
-])
diff --git a/config/grc_gr_msdd6000.m4 b/config/grc_gr_msdd6000.m4
deleted file mode 100644
index 0c6fc320e..000000000
--- a/config/grc_gr_msdd6000.m4
+++ /dev/null
@@ -1,38 +0,0 @@
-dnl Copyright 2001,2002,2003,2004,2005,2006,2008 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_MSDD6000],[
- GRC_ENABLE([gr-msdd6000])
-
- AC_CONFIG_FILES([\
- gr-msdd6000/Makefile \
- gr-msdd6000/gnuradio-msdd6000.pc \
- gr-msdd6000/src/Makefile
- ])
-
- dnl Don't do gr-msdd6000 if gnuradio-core skipped
- GRC_CHECK_DEPENDENCY(gr-msdd6000, gnuradio-core)
-
- AC_CHECK_HEADERS(netinet/in.h arpa/inet.h sys/socket.h netdb.h, [], [passed=no])
-
- GRC_BUILD_CONDITIONAL([gr-msdd6000],[
- dnl run_tests is created from run_tests.in. Make it executable.
- dnl AC_CONFIG_COMMANDS([run_tests_msdd6000], [chmod +x gr-msdd6000/src/run_tests])
- ])
-])
diff --git a/config/grc_gr_qtgui.m4 b/config/grc_gr_qtgui.m4
index ddb7c7ca9..6da61df2b 100644
--- a/config/grc_gr_qtgui.m4
+++ b/config/grc_gr_qtgui.m4
@@ -72,6 +72,14 @@ AC_DEFUN([GRC_GR_QTGUI],[
QT_MOC_EXEC=`pkg-config --variable=moc_location QtCore`
QT_UIC_EXEC=`pkg-config --variable=uic_location QtCore`
+ gr_qtgui_INCLUDES="\
+-I\${abs_top_srcdir}/gr-qtgui/include \
+-I\${abs_top_srcdir}/gr-qtgui/swig"
+ gr_qtgui_LA="\${abs_top_builddir}/gr-qtgui/lib/libgnuradio-qtgui.la"
+ gr_qtgui_LIBDIRPATH="\${abs_top_builddir}/gr-qtgui/lib:\${abs_top_builddir}/gr-qtgui/lib/.libs"
+ gr_qtgui_SWIGDIRPATH="\${abs_top_builddir}/gr-digtial/lib/swig:\${abs_top_builddir}/gr-qtgui/swig/.libs:\${abs_top_srcdir}/gr-qtgui/swig"
+ gr_qtgui_PYDIRPATH="\${abs_top_srcdir}/gr-qtgui/python"
+
AC_SUBST(QMAKE_INCLUDES)
AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_LIBS)
@@ -83,11 +91,14 @@ AC_DEFUN([GRC_GR_QTGUI],[
gr-qtgui/Makefile \
gr-qtgui/gnuradio-qtgui.pc \
gr-qtgui/apps/Makefile \
+ gr-qtgui/examples/Makefile \
gr-qtgui/grc/Makefile \
+ gr-qtgui/include/Makefile \
gr-qtgui/lib/Makefile \
gr-qtgui/python/Makefile \
gr-qtgui/python/run_tests \
gr-qtgui/swig/Makefile \
+ gr-qtgui/doc/Makefile \
])
GRC_BUILD_CONDITIONAL(gr-qtgui,[
diff --git a/config/grc_gr_radar_mono.m4 b/config/grc_gr_radar_mono.m4
deleted file mode 100644
index bf8e2dac4..000000000
--- a/config/grc_gr_radar_mono.m4
+++ /dev/null
@@ -1,45 +0,0 @@
-dnl Copyright 2007,2008 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_RADAR_MONO],[
- GRC_ENABLE(gr-radar-mono)
-
- dnl Don't do gr-radar-mono if usrp or gnuradio-core skipped
- GRC_CHECK_DEPENDENCY(gr-radar-mono, usrp)
- GRC_CHECK_DEPENDENCY(gr-radar-mono, gnuradio-core)
-
- AC_CONFIG_FILES([ \
- gr-radar-mono/Makefile \
- gr-radar-mono/doc/Makefile \
- gr-radar-mono/src/Makefile \
- gr-radar-mono/src/fpga/Makefile \
- gr-radar-mono/src/fpga/top/Makefile \
- gr-radar-mono/src/fpga/lib/Makefile \
- gr-radar-mono/src/fpga/models/Makefile \
- gr-radar-mono/src/fpga/tb/Makefile \
- gr-radar-mono/src/lib/Makefile \
- gr-radar-mono/src/python/Makefile \
- gr-radar-mono/src/python/run_tests
- ])
-
- GRC_BUILD_CONDITIONAL(gr-radar-mono,[
- dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_radar_mono], [chmod +x gr-radar-mono/src/python/run_tests])
- ])
-])
diff --git a/config/grc_gr_sounder.m4 b/config/grc_gr_sounder.m4
deleted file mode 100644
index 672d13ab1..000000000
--- a/config/grc_gr_sounder.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-dnl Copyright 2007,2008 Free Software Foundation, Inc.
-dnl
-dnl This file is part of GNU Radio
-dnl
-dnl GNU Radio is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3, or (at your option)
-dnl any later version.
-dnl
-dnl GNU Radio is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with GNU Radio; see the file COPYING. If not, write to
-dnl the Free Software Foundation, Inc., 51 Franklin Street,
-dnl Boston, MA 02110-1301, USA.
-
-AC_DEFUN([GRC_GR_SOUNDER],[
- GRC_ENABLE(gr-sounder)
-
- dnl Don't do gr-sounder if usrp or gnuradio-core skipped
- GRC_CHECK_DEPENDENCY(gr-sounder, usrp)
- GRC_CHECK_DEPENDENCY(gr-sounder, gnuradio-core)
-
- AC_CONFIG_FILES([ \
- gr-sounder/Makefile \
- gr-sounder/doc/Makefile \
- gr-sounder/src/Makefile \
- gr-sounder/src/fpga/Makefile \
- gr-sounder/src/fpga/top/Makefile \
- gr-sounder/src/fpga/lib/Makefile \
- gr-sounder/src/fpga/tb/Makefile \
- gr-sounder/src/lib/Makefile \
- gr-sounder/src/python/Makefile \
- gr-sounder/src/python/run_tests
- ])
-
- GRC_BUILD_CONDITIONAL(gr-sounder,[
- dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_sounder], [chmod +x gr-sounder/src/python/run_tests])
- ])
-])
diff --git a/config/grc_gr_trellis.m4 b/config/grc_gr_trellis.m4
index 5d11acc22..57c75bf51 100644
--- a/config/grc_gr_trellis.m4
+++ b/config/grc_gr_trellis.m4
@@ -22,6 +22,7 @@ AC_DEFUN([GRC_GR_TRELLIS],[
dnl Don't do gr-trellis if gnuradio-core skipped
GRC_CHECK_DEPENDENCY(gr-trellis, gnuradio-core)
+ GRC_CHECK_DEPENDENCY(gr-trellis, gr-digital)
AC_CONFIG_FILES([\
gr-trellis/Makefile \
diff --git a/config/grc_gr_uhd.m4 b/config/grc_gr_uhd.m4
index 111b0ae43..0da087c48 100644
--- a/config/grc_gr_uhd.m4
+++ b/config/grc_gr_uhd.m4
@@ -49,6 +49,11 @@ AC_DEFUN([GRC_GR_UHD],[
gr-uhd/swig/run_tests \
gr-uhd/swig/run_guile_tests \
gr-uhd/apps/Makefile \
+ gr-uhd/apps/hf_explorer/Makefile \
+ gr-uhd/apps/hf_radio/Makefile \
+ gr-uhd/examples/Makefile \
+ gr-uhd/examples/multi-antenna/Makefile \
+ gr-uhd/doc/Makefile \
])
GRC_BUILD_CONDITIONAL(gr-uhd,[
diff --git a/config/grc_gr_vocoder.m4 b/config/grc_gr_vocoder.m4
new file mode 100644
index 000000000..df75656fe
--- /dev/null
+++ b/config/grc_gr_vocoder.m4
@@ -0,0 +1,49 @@
+dnl Copyright 2011 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GNU Radio
+dnl
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+
+AC_DEFUN([GRC_GR_VOCODER],[
+ GRC_ENABLE(gr-vocoder)
+
+ dnl Don't do gr-vocoder if gnuradio-core skipped
+ GRC_CHECK_DEPENDENCY(gr-fr-vocoder, gnuradio-core)
+
+ AC_CONFIG_FILES([\
+ gr-vocoder/Makefile \
+ gr-vocoder/gnuradio-vocoder.pc \
+ gr-vocoder/apps/Makefile \
+ gr-vocoder/doc/Makefile \
+ gr-vocoder/examples/Makefile \
+ gr-vocoder/grc/Makefile \
+ gr-vocoder/include/Makefile \
+ gr-vocoder/lib/Makefile \
+ gr-vocoder/lib/codec2/Makefile \
+ gr-vocoder/lib/g7xx/Makefile \
+ gr-vocoder/lib/gsm/Makefile \
+ gr-vocoder/python/Makefile \
+ gr-vocoder/python/run_tests \
+ gr-vocoder/swig/Makefile \
+ gr-vocoder/swig/run_guile_tests \
+ ])
+
+ GRC_BUILD_CONDITIONAL(gr-vocoder,[
+ dnl run_tests is created from run_tests.in. Make it executable.
+ AC_CONFIG_COMMANDS([run_tests_vocoder], [chmod +x gr-vocoder/python/run_tests])
+ AC_CONFIG_COMMANDS([run_tests_vocoder_guile], [chmod +x gr-vocoder/swig/run_guile_tests])
+ ])
+])
diff --git a/configure-cell-cross b/configure-cell-cross
deleted file mode 100755
index fd03588fb..000000000
--- a/configure-cell-cross
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-
-#
-# Before trying to use this script, please follow the instructions at
-# http://gnuradio.org/trac/wiki/CrossCompilingForCell
-#
-
-scriptdir=`dirname $0`
-
-prefix=
-for arg in "$@"
-do
- case $arg in
- --prefix=*)
- prefix=${arg#--prefix=}
- ;;
- --help)
- $scriptdir/configure --help
- exit
- ;;
- esac
-done
-
-if test x$prefix = x
-then
- echo "usage: $0 --prefix=PREFIX [configure options...]" 1>&2
- exit 1
-fi
-
-
-arch=ppu
-cell_root=/mnt/cell-root
-python_version=2.5
-compiler_includes="-isystem ${cell_root}/usr/include"
-
-# check for 4.3 versions of cross-compilers and use them if we've got them
-if which ppu32-gcc43 >/dev/null 2>&1; then
- ppu32_gcc=ppu32-gcc43
-else
- ppu32_gcc=ppu32-gcc
-fi
-
-if which ppu32-g++43 >/dev/null 2>&1; then
- ppu32_gxx=ppu32-g++43
-else
- ppu32_gxx=ppu32-g++
-fi
-
-$scriptdir/configure \
- CC=${ppu32_gcc} \
- CXX=${ppu32_gxx} \
- AR=${arch}-ar \
- NM=${arch}-nm \
- RANLIB=${arch}-ranlib \
- STRIP=${arch}-strip \
- F77=false \
- CPPFLAGS="$compiler_includes" \
- LDFLAGS="-L${cell_root}/lib -L${cell_root}/usr/lib" \
- PYTHON_CPPFLAGS=-I${cell_root}/usr/include/python${python_version} \
- PKG_CONFIG_PATH=${cell_root}/usr/lib/pkgconfig:${cell_root}/usr/local/lib/pkgconfig \
- --host=powerpc64-unknown-linux-gnu \
- --with-pythondir=$prefix/lib/python${python_version}/site-packages \
- --disable-gr-video-sdl \
- --disable-gr-audio-portaudio \
- --disable-gr-audio-jack \
- --disable-usrp2-firmware \
- "$@"
-
-
-# Hack the libtool script so that it doesn't code an --rpath flag into anything
-
-#sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-#sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
diff --git a/configure.ac b/configure.ac
index ca95005a6..531f9adb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -350,29 +350,23 @@ AC_ARG_ENABLE(
build_dirs="config"
GRC_GRUEL dnl must come first
GRC_VOLK
-GRC_GCELL
GRC_GNURADIO_CORE
+GRC_GR_DIGITAL
GRC_USRP
GRC_USRP2
GRC_GR_USRP dnl this must come after GRC_USRP
GRC_GR_USRP2
-GRC_GR_GCELL dnl this must come after GRC_GCELL and GRC_GNURADIO_CORE
-GRC_GR_MSDD6000
GRC_GR_AUDIO
+GRC_GR_VOCODER
GRC_GR_ATSC
GRC_GR_COMEDI
-GRC_GR_CVSD_VOCODER
-GRC_GR_GPIO
-GRC_GR_GSM_FR_VOCODER
GRC_GR_NOAA
GRC_GR_PAGER
-GRC_GR_RADAR_MONO
GRC_GR_RADIO_ASTRONOMY
GRC_GR_TRELLIS
GRC_GR_VIDEO_SDL
GRC_GR_WXGUI
GRC_GR_QTGUI
-GRC_GR_SOUNDER dnl this must come after GRC_USRP
GRC_GR_UTILS dnl this must come after GRC_GR_WXGUI
GRC_GNURADIO_EXAMPLES dnl must come after all GRC_GR_*
GRC_GRC
diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in
index 1f544e5bd..356ababfe 100644
--- a/docs/doxygen/Doxyfile.in
+++ b/docs/doxygen/Doxyfile.in
@@ -587,7 +587,6 @@ EXCLUDE = @abs_top_builddir@/docs/doxygen/html \
@abs_top_builddir@/docs/doxygen/xml-swig \
@abs_top_builddir@/docs/doxygen/other/doxypy.py \
@abs_top_builddir@/dtools \
- @abs_top_srcdir@/gcell/ibm \
@abs_top_builddir@/gnuradio-core/src/lib/bug_work_around_6.cc \
@abs_top_builddir@/gnuradio-core/src/lib/filter/assembly.h \
@abs_top_builddir@/gnuradio-core/src/lib/filter/generate_all.py \
@@ -1308,7 +1307,7 @@ SEARCH_INCLUDES = YES
# contain include files that are not input files but should be processed by
# the preprocessor.
-INCLUDE_PATH =
+INCLUDE_PATH = @top_builddir@/gruel/src/lib/pmt/
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
diff --git a/docs/doxygen/other/group_defs.dox b/docs/doxygen/other/group_defs.dox
index 6f2e1ac7f..6288d1f0a 100644
--- a/docs/doxygen/other/group_defs.dox
+++ b/docs/doxygen/other/group_defs.dox
@@ -27,6 +27,11 @@
/*! \defgroup misc_blk Miscellaneous Blocks */
/*! \defgroup slicedice_blk Slicing and Dicing Streams */
/*! \defgroup vocoder_blk Voice Encoders and Decoders */
+/*! \defgroup digital Digital Modulation Blocks */
+/*! \defgroup qtgui_blk QT Graphical Interfaces */
+/*! \defgroup uhd_blk UHD Interface */
+/*! \defgroup audio_blk Audio Interface */
+/*! \defgroup pfb_blk Polyphase Filterbank */
/*!
* \defgroup base_blk Base classes for GR Blocks
@@ -66,12 +71,4 @@
/*! \defgroup usrp USRP */
/*! \defgroup usrp2 USRP2 */
-/*!
- * \defgroup gcell gcell: Cell Broadband Engine SPE Scheduler & RPC Mechanism
- *
- * For additional information please see the
- * <a href="http://gnuradio.org/trac/wiki/Gcell">gcell wiki page</a>
- * and <a href="http://comsec.com/papers/gcell-sdrf-2008.pdf">gcell-sdrf-2008.pdf</a>.
- */
-
/*! \defgroup hardware Misc Hardware Control */
diff --git a/docs/doxygen/other/main_page.dox b/docs/doxygen/other/main_page.dox
index 43fcbf67a..7d78bbbbb 100644
--- a/docs/doxygen/other/main_page.dox
+++ b/docs/doxygen/other/main_page.dox
@@ -9,4 +9,11 @@ provide unified documentation for the C++ parts of the system and the
parts written in Python (mostly hierarchical blocks). Until this gets
worked out, please bear with us, or better yet, solve it for us!
+More details on packages in GNU Radio:
+\li \ref page_audio
+\li \ref page_digital
+\li \ref page_qtgui
+\li \ref page_uhd
+\li \ref page_vocoder
+\li \ref page_pfb
*/
diff --git a/docs/doxygen/other/pfb_intro.dox b/docs/doxygen/other/pfb_intro.dox
new file mode 100644
index 000000000..8b82d96d7
--- /dev/null
+++ b/docs/doxygen/other/pfb_intro.dox
@@ -0,0 +1,82 @@
+/*! \page page_pfb Polyphase Filterbanks
+
+\section Introduction
+
+Polyphase filterbanks (PFB) are a very powerful set of filtering tools
+that can efficiently perform many multi-rate signal processing
+tasks. GNU Radio has a set of polyphase filterbank blocks to be used
+in all sorts of applications. These blocks and their documentation can
+be found in \ref pfb_blk.
+
+\section Usage
+
+See the documentation for the individual blocks for details about what
+they can do and how they should be used. Furthermore, there are
+examples for these blocks in <b>gnuradio-examples/python/pfb</b>.
+
+The main issue when using the PFB blocks is defining the prototype
+filter, which is passed to all of the blocks as a vector of \p
+taps. The taps from the prototype filter which get partitioned among
+the \p N channels of the channelizer.
+
+An example of creating a set of filter taps for a PFB channelizer is
+found on line 49 of <b>gnuradio-examples/python/pfb/channelizer.py</b>
+and reproduced below. Notice that the sample rate is the sample rate
+at the input to the channelizer while the bandwidth and transition
+width are defined for the channel bandwidths. This makes a fairly long
+filter that is then split up between the \p N channels of the PFB.
+
+\code
+ self._fs = 9000 # input sample rate
+ self._M = 9 # Number of channels to channelize
+
+ self._taps = gr.firdes.low_pass_2(1, self._fs, 475.50, 50,
+ attenuation_dB=100,
+ window=gr.firdes.WIN_BLACKMAN_hARRIS)
+\endcode
+
+In this example, the signal into the channelizer is sampled at 9 ksps
+(complex, so 9 kHz of bandwidth). The filter uses 9 channels, so each
+output channel will have a bandwidth and sample rate of 1 kHz. We want
+to pass most of the channel, so we define the channel bandwidth to be
+a low pass filter with a bandwidth of 475.5 Hz and a transition
+bandwidth of 50 Hz, but we have defined this using a sample rate of
+the original 9 kHz. The prototype filter has 819 taps to be divided up
+between the 9 channels, so each channel uses 91 taps. This is probably
+over-kill for a channelizer, and we could reduce the amount of taps
+per channel to a couple of dozen with no ill effects.
+
+The basic rule when defining a set of taps for a PFB block is to think
+about the filter running at the highest rate it will see while the
+bandwidth is defined for the size of the channels. In the channelizer
+case, the highest rate is defined as the rate of the incoming signal,
+but in other PFB blocks, this is not so obvious.
+
+Two very useful blocks to use are the arbitrary resampler and the
+clock synchronizer (for PAM signals). These PFBs are defined with a
+set number of filters based on the fidelity required from them, not
+the rate changes. By default, the \p filter_size is set to 32 for
+these blocks, which is a reasonable default for most tasks. Because
+the PFB uses this number of filters in the filterbank, the maximum
+rate of the bank is defined from this (see the theory of a polyphase
+interpolator for a justification of this). So the prototype filter is
+defined to use a sample rate of \p filter_size times the signal's
+sampling rate.
+
+A helpful wrapper for the arbitrary resampler is found in
+<b>gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py</b>,
+which is exposed in Python as <b>blks2.pfb_arb_resampler_ccf</b> and
+<b>blks2.pfb_arb_resampler_fff</b>. This block is set up so that the
+user only needs to pass it the real number \p rate as the resampling
+rate. With just this information, this hierarchical block
+automatically creates a filter that fully passes the signal bandwidth
+being resampled but does not pass any out-of-band noise. See the code
+for this block for details of how the filter is constructed.
+
+Of course, a user can create his or her own taps and use them in the
+arbitrary resampler for more specific requirements. Some of the UHD
+examples (<b>gr-uhd/examples</b>) use this ability to create a
+received matched filter or channel filter that also resamples the
+signal.
+
+*/
diff --git a/dtools/bin/tweak-cell-for-cross-compiling b/dtools/bin/tweak-cell-for-cross-compiling
deleted file mode 100755
index e63700420..000000000
--- a/dtools/bin/tweak-cell-for-cross-compiling
+++ /dev/null
@@ -1,143 +0,0 @@
-#!/usr/bin/env python
-
-"""
-This should only be run on a native Cell machine. E.g., ps3, qs21, etc.
-
-It makes a few modifications to the file system and some pseudo shared libs
-so that cross compiling from a build machine over NFS works. The changes
-do not harm local compilation.
-
-We create a symlink from /mnt/cell-root that points to /
-This allows the local and build machine to access the root filesystem
-using a common name, /mnt/cell-root. This is required because
-configure hardcodes absolute paths into the generated Makefiles.
-
-There are some .so files that aren't really shared libraries, but rather are
-ascii linker scripts containing instructions to the linker. Most of them
-contain a GROUP directive that includes hard-coded paths relative to /.
-We modify those files such that the hard-coded paths are relative to /mnt/cell-root
-instead of /. This allows them to work locally and while cross compiling over NFS.
-
-E.g., /usr/lib/libc.so originally contains:
-
- /* GNU ld script
- Use the shared library, but some functions are only in
- the static library, so try that secondarily. */
- OUTPUT_FORMAT(elf32-powerpc)
- GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED ( /lib/ld.so.1 ) )
-
-We modify it such that it reads:
-
- /* GNU ld script
- Use the shared library, but some functions are only in
- the static library, so try that secondarily. */
- OUTPUT_FORMAT(elf32-powerpc)
- GROUP ( /mnt/cell-root/lib/libc.so.6 /mnt/cell-root/usr/lib/libc_nonshared.a AS_NEEDED ( /mnt/cell-root/lib/ld.so.1 ) )
-
-We backup <foo>.so to <foo>.so.original
-
-"""
-
-import os
-import os.path
-import sys
-import shutil
-import re
-
-cell_root_path = '/mnt/cell-root'
-
-def ensure_cell():
- s = open('/proc/cpuinfo','r').read()
- if s.find('Cell Broadband Engine') == -1:
- sys.stderr.write('This program should only be run on Cell machines.\n')
- raise SystemExit, 1
-
-def make_symlinks():
- create_symlink_if_reqd(cell_root_path, "..")
- create_symlink_if_reqd("/opt/cell/toolchain", "../../usr")
- create_symlink_if_reqd("/opt/cell/sysroot", "../..")
-
-def symlink_exists_and_is_ok(path, contents):
- return (os.path.islink(path) and os.readlink(path) == contents)
-
-def create_symlink_if_reqd(path, contents):
- if symlink_exists_and_is_ok(path, contents):
- return
-
- if os.path.islink(path):
- # Is a symlink but points wrong place
- os.remove(path)
- os.symlink(contents, path)
- return
-
- if os.path.isdir(path):
- # if it's empty we'll remove it and create the link
- try:
- os.rmdir(path)
- except:
- # directory wasn't empty
- sys.stderr.write("There's already something at %s.\n" % (path,))
- sys.stderr.write("Please remove it or move it out of the way and try again.\n")
- raise SystemExit, 1
- os.symlink(contents, path)
- return
-
- if os.path.exists(path):
- # There's something here, return an error
- sys.stderr.write("There's already something at %s.\n" % (path,))
- sys.stderr.write("Please remove it or move it out of the way and try again.\n")
- raise SystemExit, 1
-
- # nothing there; go ahead and create the symlink
- os.symlink(contents, path)
-
-
-def find_ascii_shared_libs():
- cmd = "find /lib /lib64 /usr/lib /usr/lib64 -name '*.so' -type f -print 2>/dev/null | xargs file | grep -v ELF | cut -d: -f 1"
- pipe = os.popen(cmd, 'r')
- filenames = pipe.read().splitlines()
- return filenames
-
-
-def make_backup_copy(src):
- dst = src + '.original'
- if not os.path.exists(dst):
- shutil.copy2(src, dst)
-
-
-def edit_file(name):
- def replace_group_body(mo):
- pat = ' /(?!' + cell_root_path[1:] + ')' # negative lookahead assertion
- new = re.sub(pat, ' ' + cell_root_path + '/', mo.group(2))
- return mo.group(1) + new + mo.group(3)
-
- f = open(name,'r')
- s = f.read()
- f.close()
-
- pat = re.compile(r'^( *GROUP *\()(.*)(\) *)$', re.M)
- t = pat.sub(replace_group_body, s)
-
- f = open(name,'w')
- f.write(t)
- f.close()
-
-
-def edit_ascii_shared_libs():
- print "Please be patient, this takes awhile..."
- filenames = find_ascii_shared_libs()
- for f in filenames:
- make_backup_copy(f)
- edit_file(f)
-
-
-def main():
- ensure_cell()
- make_symlinks()
- edit_ascii_shared_libs()
-
-
-if __name__ == '__main__':
- main()
-
-
diff --git a/gcell/.gitignore b/gcell/.gitignore
deleted file mode 100644
index a55308950..000000000
--- a/gcell/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/gcell.pc
-/gcell_spu.pc
diff --git a/gcell/Makefile.am b/gcell/Makefile.am
deleted file mode 100644
index fe222e5fb..000000000
--- a/gcell/Makefile.am
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = include lib apps ibm
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = \
- gcell.pc \
- gcell_spu.pc
diff --git a/gcell/apps/.gitignore b/gcell/apps/.gitignore
deleted file mode 100644
index b80e1a92c..000000000
--- a/gcell/apps/.gitignore
+++ /dev/null
@@ -1,12 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/test_all
-/benchmark_nop
-/benchmark_dma
-/benchmark_roundtrip
diff --git a/gcell/apps/Makefile.am b/gcell/apps/Makefile.am
deleted file mode 100644
index c3a2092a3..000000000
--- a/gcell/apps/Makefile.am
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright 2007,2008,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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = spu .
-
-AM_CPPFLAGS = $(DEFINES) $(GCELL_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
-
-GCELL_QA_LA = $(top_builddir)/gcell/lib/libgcell-qa.la
-
-TESTS = test_all
-
-
-bin_PROGRAMS = \
- test_all \
- benchmark_dma \
- benchmark_nop \
- benchmark_roundtrip
-
-
-test_all_SOURCES = test_all.cc
-test_all_LDADD = $(GCELL_QA_LA) $(GCELL_LA)
-
-benchmark_dma_SOURCES = benchmark_dma.cc
-benchmark_dma_LDADD = spu/benchmark_procs $(GCELL_LA)
-
-benchmark_nop_SOURCES = benchmark_nop.cc
-benchmark_nop_LDADD = spu/benchmark_procs $(GCELL_LA)
-
-benchmark_roundtrip_SOURCES = benchmark_roundtrip.cc
-benchmark_roundtrip_LDADD = spu/benchmark_procs $(GCELL_LA)
diff --git a/gcell/apps/benchmark_dma.cc b/gcell/apps/benchmark_dma.cc
deleted file mode 100644
index bc3b3f328..000000000
--- a/gcell/apps/benchmark_dma.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,2010 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.
- */
-
-#if defined(HAVE_CONFIG_H)
-#include <config.h>
-#endif
-#include <gcell/gc_job_manager.h>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <getopt.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <boost/scoped_array.hpp>
-#include <assert.h>
-
-// handle to embedded SPU executable that contains benchmark routines
-// (The name of the variable (benchmark_procs) is the name of the spu executable.)
-extern spe_program_handle_t benchmark_procs;
-
-static gc_proc_id_t gcp_benchmark_udelay = GCP_UNKNOWN_PROC;
-
-#define BENCHMARK_PUT 0x1
-#define BENCHMARK_GET 0x2
-#define BENCHMARK_GET_PUT (BENCHMARK_PUT|BENCHMARK_GET)
-
-
-#if 0
-static bool
-power_of_2_p(unsigned long x)
-{
- int nbits = sizeof(x) * 8;
- for (int i = 0; i < nbits; i++)
- if (x == (1UL << i))
- return true;
-
- return false;
-}
-#endif
-
-static void
-init_jd(gc_job_desc *jd, unsigned int usecs,
- unsigned char *getbuf, unsigned char *putbuf, size_t buflen,
- int getput_mask)
-{
- jd->proc_id = gcp_benchmark_udelay;
- jd->input.nargs = 1;
- jd->input.arg[0].u32 = usecs;
- jd->output.nargs = 0;
-
- switch(getput_mask & BENCHMARK_GET_PUT){
-
- case BENCHMARK_GET:
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].direction = GCJD_DMA_GET;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(getbuf);
- jd->eaa.arg[0].get_size = buflen;
- break;
-
- case BENCHMARK_PUT:
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(putbuf);
- jd->eaa.arg[0].put_size = buflen;
- break;
-
- case BENCHMARK_GET_PUT:
- jd->eaa.nargs = 2;
- jd->eaa.arg[0].direction = GCJD_DMA_GET;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(getbuf);
- jd->eaa.arg[0].get_size = buflen;
- jd->eaa.arg[1].direction = GCJD_DMA_PUT;
- jd->eaa.arg[1].ea_addr = ptr_to_ea(putbuf);
- jd->eaa.arg[1].put_size = buflen;
- break;
- }
-}
-
-static void
-run_test(unsigned int nspes, unsigned int usecs, unsigned int dma_size, int getput_mask)
-{
- using namespace boost::posix_time;
-
- static const int64_t TOTAL_SIZE_DMA = 5LL << 30;
- static const int NJDS = 64;
- unsigned int njobs = (unsigned int)(TOTAL_SIZE_DMA / dma_size);
- //unsigned int njobs = NJDS * 16;
- unsigned int nsubmitted = 0;
- unsigned int ncompleted = 0;
- gc_job_desc *all_jds[NJDS];
- gc_job_desc *jds[2][NJDS];
- unsigned int njds[2];
- unsigned int ci; // current index
- bool done[NJDS];
-
- static const unsigned int BUFSIZE = (32 << 10) * NJDS;
- unsigned char *getbuf = new unsigned char[BUFSIZE];
- boost::scoped_array<unsigned char> _getbuf(getbuf);
- unsigned char *putbuf = new unsigned char[BUFSIZE];
- boost::scoped_array<unsigned char> _putbuf(putbuf);
- int gbi = 0;
-
- // touch all pages to force allocation now
- for (unsigned int i = 0; i < BUFSIZE; i += 4096){
- getbuf[i] = 0;
- putbuf[i] = 0;
- }
-
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&benchmark_procs);
- opts.nspes = nspes;
- //opts.enable_logging = true;
- //opts.log2_nlog_entries = 13;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
- if ((gcp_benchmark_udelay = mgr->lookup_proc("benchmark_udelay")) == GCP_UNKNOWN_PROC){
- fprintf(stderr, "lookup_proc: failed to find \"benchmark_udelay\"\n");
- return;
- }
-
- // allocate and init all job descriptors
- for (int i = 0; i < NJDS; i++){
- if (gbi + dma_size > BUFSIZE)
- gbi = 0;
-
- all_jds[i] = mgr->alloc_job_desc();
- if (all_jds[i] == 0){
- fprintf(stderr, "alloc_job_desc() returned 0\n");
- return;
- }
- init_jd(all_jds[i], usecs, &getbuf[gbi], &putbuf[gbi], dma_size, getput_mask);
- gbi += dma_size;
- }
-
- for (int iter = 0; iter < 1; iter++){
-
- ptime t_start(microsec_clock::universal_time());
-
- nsubmitted = 0;
- ncompleted = 0;
-
- ci = 0;
- njds[0] = 0;
- njds[1] = 0;
-
- // submit the first batch
- for (int i = 0; i < NJDS; i++){
- if (mgr->submit_job(all_jds[i])){
- jds[ci][njds[ci]++] = all_jds[i];
- nsubmitted++;
- }
- else {
- printf("submit_job(jds[%d]) failed, status = %d\n",
- i, all_jds[i]->status);
- }
- }
-
- while (ncompleted < njobs){
- njds[ci^1] = 0;
- int n = mgr->wait_jobs(njds[ci], jds[ci], done, GC_WAIT_ANY);
- // printf("%2d\n", n);
- if (n < 0){
- fprintf(stderr, "mgr->wait_jobs failed\n");
- break;
- }
- for (unsigned int i = 0; i < njds[ci]; i++){
- if (!done[i]){ // remember for next iteration
- jds[ci^1][njds[ci^1]++] = jds[ci][i];
- }
- else {
- ncompleted++;
- if (jds[ci][i]->status != JS_OK){
- printf("js_status = %d, job_id = %d, ncompleted = %d\n",
- jds[ci][i]->status, jds[ci][i]->sys.job_id, ncompleted);
- }
- if (nsubmitted < njobs){ // submit another one
- if (mgr->submit_job(jds[ci][i])){
- jds[ci^1][njds[ci^1]++] = jds[ci][i]; // remember for next iter
- nsubmitted++;
- }
- else {
- printf("submit_job(jds[%d]) failed, status = %d\n",
- i, jds[ci][i]->status);
- }
- }
- }
- }
- ci ^= 1; // toggle current
- }
-
- // stop timing
- ptime t_stop(microsec_clock::universal_time());
-
- double delta = (t_stop - t_start).total_microseconds() * 1e-6;
- printf("nspes: %2d udelay: %4d elapsed_time: %7.3f dma_size: %5d dma_throughput: %7.3e\n",
- mgr->nspes(), usecs, delta, dma_size,
- (double) njobs * dma_size / delta * (getput_mask == BENCHMARK_GET_PUT ? 2.0 : 1.0));
-
- }
-}
-
-static void
-usage()
-{
- fprintf(stderr, "usage: benchmark_dma [-p] [-g] [-n <nspes>] [-u <udelay>] [-s <dma_size>]\n");
- fprintf(stderr, " you must specify one or both of -p (put) and -g (get)\n");
-}
-
-
-int
-main(int argc, char **argv)
-{
- unsigned int nspes = 0;
- unsigned int usecs = 0;
- unsigned int dma_size = 32 << 10;
- int getput_mask = 0;
- int ch;
-
- while ((ch = getopt(argc, argv, "n:u:s:pg")) != EOF){
- switch(ch){
- case 'n':
- nspes = strtol(optarg, 0, 0);
- break;
-
- case 'u':
- usecs = strtol(optarg, 0, 0);
- break;
-
- case 's':
- dma_size = strtol(optarg, 0, 0);
- if (dma_size == 0){
- fprintf(stderr, "-s <dma_size> must be > 0\n");
- return 1;
- }
- break;
-
- case 'p':
- getput_mask |= BENCHMARK_PUT;
- break;
-
- case 'g':
- getput_mask |= BENCHMARK_GET;
- break;
-
- case '?':
- default:
- usage();
- return 1;
- }
- }
-
- if (getput_mask == 0){
- usage();
- return 1;
- }
-
- run_test(nspes, usecs, dma_size, getput_mask);
- return 0;
-}
diff --git a/gcell/apps/benchmark_nop.cc b/gcell/apps/benchmark_nop.cc
deleted file mode 100644
index a27373db4..000000000
--- a/gcell/apps/benchmark_nop.cc
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,2010 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.
- */
-
-#if defined(HAVE_CONFIG_H)
-#include <config.h>
-#endif
-#include <gcell/gc_job_manager.h>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <getopt.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-// handle to embedded SPU executable that contains benchmark routines
-// (The name of the variable (benchmark_procs) is the name of the spu executable.)
-extern spe_program_handle_t benchmark_procs;
-
-static gc_proc_id_t gcp_benchmark_udelay = GCP_UNKNOWN_PROC;
-
-static void
-init_jd(gc_job_desc *jd, unsigned int usecs)
-{
- jd->proc_id = gcp_benchmark_udelay;
- jd->input.nargs = 1;
- jd->input.arg[0].u32 = usecs;
- jd->output.nargs = 0;
- jd->eaa.nargs = 0;
-}
-
-static void
-run_test(unsigned int nspes, unsigned int usecs, int njobs)
-{
- using namespace boost::posix_time;
-
- static const int NJDS = 64;
- int nsubmitted = 0;
- int ncompleted = 0;
- gc_job_desc *all_jds[NJDS];
- gc_job_desc *jds[2][NJDS];
- unsigned int njds[2];
- unsigned int ci; // current index
- bool done[NJDS];
-
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&benchmark_procs);
- opts.nspes = nspes;
- opts.gang_schedule = true;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
- if ((gcp_benchmark_udelay = mgr->lookup_proc("benchmark_udelay")) == GCP_UNKNOWN_PROC){
- fprintf(stderr, "lookup_proc: failed to find \"benchmark_udelay\"\n");
- return;
- }
-
- // allocate and init all job descriptors
- for (int i = 0; i < NJDS; i++){
- all_jds[i] = mgr->alloc_job_desc();
- init_jd(all_jds[i], usecs);
- }
-
- ptime t_start(microsec_clock::universal_time());
-
- ci = 0;
- njds[0] = 0;
- njds[1] = 0;
-
- // submit the first batch
- for (int i = 0; i < NJDS; i++){
- if (mgr->submit_job(all_jds[i])){
- jds[ci][njds[ci]++] = all_jds[i];
- nsubmitted++;
- }
- else {
- printf("submit_job(jds[%d]) failed, status = %d\n",
- i, all_jds[i]->status);
- }
- }
-
- while (ncompleted < njobs){
- njds[ci^1] = 0;
- int n = mgr->wait_jobs(njds[ci], jds[ci], done, GC_WAIT_ANY);
- // printf("%2d\n", n);
- if (n < 0){
- fprintf(stderr, "mgr->wait_jobs failed\n");
- break;
- }
- for (unsigned int i = 0; i < njds[ci]; i++){
- if (!done[i]){ // remember for next iteration
- jds[ci^1][njds[ci^1]++] = jds[ci][i];
- }
- else {
- ncompleted++;
- // printf("ncompleted = %7d\n", ncompleted);
- if (nsubmitted < njobs){ // submit another one
- if (mgr->submit_job(jds[ci][i])){
- jds[ci^1][njds[ci^1]++] = jds[ci][i]; // remember for next iter
- nsubmitted++;
- }
- else {
- printf("submit_job(jds[%d]) failed, status = %d\n",
- i, jds[ci][i]->status);
- }
- }
- }
- }
- ci ^= 1; // toggle current
- }
-
- // stop timing
- ptime t_stop(microsec_clock::universal_time());
- double delta = (t_stop - t_start).total_microseconds() * 1e-6;
- printf("nspes: %2d udelay: %4d elapsed_time: %7.3f njobs: %g speedup: %6.3f\n",
- mgr->nspes(), usecs, delta, (double) njobs,
- njobs * usecs * 1e-6 / delta);
-}
-
-int
-main(int argc, char **argv)
-{
- unsigned int nspes = 0;
- unsigned int usecs = 0;
- int njobs = 500000;
- int ch;
-
- while ((ch = getopt(argc, argv, "n:u:N:")) != EOF){
- switch(ch){
- case 'n':
- nspes = strtol(optarg, 0, 0);
- break;
-
- case 'u':
- usecs = strtol(optarg, 0, 0);
- break;
-
- case 'N':
- njobs = strtol(optarg, 0, 0);
- break;
-
- case '?':
- default:
- fprintf(stderr, "usage: benchmark_nop [-n <nspes>] [-u <udelay>] [-N <njobs>]\n");
- return 1;
- }
- }
-
- run_test(nspes, usecs, njobs);
- return 0;
-}
diff --git a/gcell/apps/benchmark_roundtrip.cc b/gcell/apps/benchmark_roundtrip.cc
deleted file mode 100644
index b994182a8..000000000
--- a/gcell/apps/benchmark_roundtrip.cc
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,2009,2010 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.
- */
-
-#if defined(HAVE_CONFIG_H)
-#include <config.h>
-#endif
-#include <gcell/gc_job_manager.h>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <getopt.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <boost/scoped_array.hpp>
-#include <assert.h>
-
-// handle to embedded SPU executable that contains benchmark routines
-// (The name of the variable (benchmark_procs) is the name of the spu executable.)
-extern spe_program_handle_t benchmark_procs;
-
-static gc_proc_id_t gcp_benchmark_udelay = GCP_UNKNOWN_PROC;
-
-#define BENCHMARK_PUT 0x1
-#define BENCHMARK_GET 0x2
-#define BENCHMARK_GET_PUT (BENCHMARK_PUT|BENCHMARK_GET)
-
-
-#if 0
-static bool
-power_of_2_p(unsigned long x)
-{
- int nbits = sizeof(x) * 8;
- for (int i = 0; i < nbits; i++)
- if (x == (1UL << i))
- return true;
-
- return false;
-}
-#endif
-
-static void
-init_jd(gc_job_desc *jd, unsigned int usecs,
- unsigned char *getbuf, unsigned char *putbuf, size_t buflen,
- int getput_mask)
-{
- jd->proc_id = gcp_benchmark_udelay;
- jd->input.nargs = 1;
- jd->input.arg[0].u32 = usecs;
- jd->output.nargs = 0;
-
- switch(getput_mask & BENCHMARK_GET_PUT){
-
- case BENCHMARK_GET:
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].direction = GCJD_DMA_GET;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(getbuf);
- jd->eaa.arg[0].get_size = buflen;
- break;
-
- case BENCHMARK_PUT:
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(putbuf);
- jd->eaa.arg[0].put_size = buflen;
- break;
-
- case BENCHMARK_GET_PUT:
- jd->eaa.nargs = 2;
- jd->eaa.arg[0].direction = GCJD_DMA_GET;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(getbuf);
- jd->eaa.arg[0].get_size = buflen;
- jd->eaa.arg[1].direction = GCJD_DMA_PUT;
- jd->eaa.arg[1].ea_addr = ptr_to_ea(putbuf);
- jd->eaa.arg[1].put_size = buflen;
- break;
- }
-}
-
-static void
-run_test(unsigned int nspes, unsigned int usecs, unsigned int dma_size,
- int getput_mask, int njobs_at_once)
-{
- using namespace boost::posix_time;
-
- int NJDS = njobs_at_once;
- gc_job_desc *all_jds[NJDS];
- bool done[NJDS];
-
- static const unsigned int BUFSIZE = (32 << 10) * NJDS;
- unsigned char *getbuf = new unsigned char[BUFSIZE];
- boost::scoped_array<unsigned char> _getbuf(getbuf);
- unsigned char *putbuf = new unsigned char[BUFSIZE];
- boost::scoped_array<unsigned char> _putbuf(putbuf);
- int gbi = 0;
-
- // touch all pages to force allocation now
- for (unsigned int i = 0; i < BUFSIZE; i += 4096){
- getbuf[i] = 0;
- putbuf[i] = 0;
- }
-
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&benchmark_procs);
- opts.nspes = nspes;
- //opts.enable_logging = true;
- //opts.log2_nlog_entries = 13;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
- if ((gcp_benchmark_udelay = mgr->lookup_proc("benchmark_udelay")) == GCP_UNKNOWN_PROC){
- fprintf(stderr, "lookup_proc: failed to find \"benchmark_udelay\"\n");
- return;
- }
-
- // allocate and init all job descriptors
- for (int i = 0; i < NJDS; i++){
- if (gbi + dma_size > BUFSIZE)
- gbi = 0;
-
- all_jds[i] = mgr->alloc_job_desc();
- if (all_jds[i] == 0){
- fprintf(stderr, "alloc_job_desc() returned 0\n");
- return;
- }
- init_jd(all_jds[i], usecs, &getbuf[gbi], &putbuf[gbi], dma_size, getput_mask);
- gbi += dma_size;
- }
-
- int niter = 100000;
- ptime t_start(microsec_clock::universal_time());
-
- for (int iter = 0; iter < niter; iter++){
-
- // submit the jobs
- for (int i = 0; i < NJDS; i++){
- if (!mgr->submit_job(all_jds[i])){
- printf("submit_job(jds[%d]) failed, status = %d\n",
- i, all_jds[i]->status);
- }
- }
-
- int n = mgr->wait_jobs(NJDS, all_jds, done, GC_WAIT_ALL);
- if (n < 0){
- fprintf(stderr, "mgr->wait_jobs failed\n");
- break;
- }
- if (n != NJDS){
- fprintf(stderr, "mgr->wait_jobs returned short count. Expected %d, got %d\n",
- NJDS, n);
- }
- }
-
- // stop timing
- ptime t_stop(microsec_clock::universal_time());
- double delta = (t_stop - t_start).total_microseconds() * 1e-6;
- printf("nspes: %2d udelay: %4d elapsed_time: %7.3f dma_size: %5d dma_throughput: %7.3e round_trip: %gus\n",
- mgr->nspes(), usecs, delta, dma_size,
- (double) NJDS * niter * dma_size / delta * (getput_mask == BENCHMARK_GET_PUT ? 2.0 : 1.0),
- delta / niter * 1e6);
-}
-
-static void
-usage()
-{
- fprintf(stderr, "usage: benchmark_dma [-p] [-g] [-n <nspes>] [-u <udelay>] [-s <dma_size>] [-N <njobs_at_a_time>]\n");
- fprintf(stderr, " you must specify one or both of -p (put) and -g (get)\n");
-}
-
-
-int
-main(int argc, char **argv)
-{
- unsigned int nspes = 0;
- unsigned int usecs = 0;
- unsigned int dma_size = 32 << 10;
- int njobs_at_once = -1;
- int getput_mask = 0;
- int ch;
-
- while ((ch = getopt(argc, argv, "n:u:s:pgN:")) != EOF){
- switch(ch){
- case 'n':
- nspes = strtol(optarg, 0, 0);
- break;
-
- case 'u':
- usecs = strtol(optarg, 0, 0);
- break;
-
- case 'N':
- njobs_at_once = strtol(optarg, 0, 0);
- break;
-
- case 's':
- dma_size = strtol(optarg, 0, 0);
- if (dma_size == 0){
- fprintf(stderr, "-s <dma_size> must be > 0\n");
- return 1;
- }
- break;
-
- case 'p':
- getput_mask |= BENCHMARK_PUT;
- break;
-
- case 'g':
- getput_mask |= BENCHMARK_GET;
- break;
-
- case '?':
- default:
- usage();
- return 1;
- }
- }
-
- if (njobs_at_once < 0)
- njobs_at_once = nspes;
-
- if (getput_mask == 0){
- usage();
- return 1;
- }
-
- run_test(nspes, usecs, dma_size, getput_mask, njobs_at_once);
- return 0;
-}
diff --git a/gcell/apps/gen_script.py b/gcell/apps/gen_script.py
deleted file mode 100755
index 2ad0fb78e..000000000
--- a/gcell/apps/gen_script.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import time
-import os
-
-from optparse import OptionParser
-
-
-def get_svn_rev():
- try:
- f = os.popen("svn info", "r")
- lines = f.readlines()
- f.close()
- except:
- return "unk"
-
- svn_rev = "unk"
- for l in lines:
- if l.startswith('Revision:'):
- t = l.rstrip()
- svn_rev = t.split()[-1]
- return svn_rev
-
-def is_ps3():
- try:
- f = open("/proc/cpuinfo")
- s = f.read()
- except:
- return False
-
- return s.find('PS3') != -1
-
-
-def main():
-
- def make_fname(suffix):
- return basename + '.' + suffix
-
- max_spes_default = 16
- if is_ps3():
- max_spes_default = 6
-
- parser = OptionParser()
- parser.add_option("-m", "--max-spes", type="int", default=max_spes_default,
- metavar="NSPES",
- help="maximum number of SPEs to use [default=%default]")
- parser.add_option("", "--min-spes", type="int", default=1,
- metavar="NSPES",
- help="minimum number of SPEs to use [default=%default]")
- parser.add_option("-p", "--oprofile", action="store_true", default=False,
- help="emit oprofile commands")
- parser.add_option("-t", "--tag", default=None,
- help="additional goodie in generated filenames")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- #FIXME to use git now
- svn_rev = get_svn_rev()
-
- os.environ['TZ'] = 'PST8PDT' # always pacific
- time.tzset()
-
- tag = ''
- if options.tag:
- tag = '-' + options.tag
-
- basename = 'R-%s%s-%s' % (svn_rev, tag, time.strftime('%Y%m%d-%H%M'))
-
- base_njobs = int(500e3)
- njobs = {
- 1 : base_njobs,
- 10 : base_njobs,
- 50 : base_njobs,
- 100 : base_njobs,
- 200 : int(base_njobs/2),
- 250 : int(base_njobs/2.5),
- 300 : int(base_njobs/3),
- 400 : int(base_njobs/4),
- 500 : int(base_njobs/5)
- }
-
-
- f_results = make_fname('results')
- f_opreport = make_fname('opreport')
- f_avg = make_fname('avg')
- f_png = make_fname('png')
-
- f = sys.stdout
- f.write("#!/bin/bash\n")
-
- if options.oprofile:
- f.write("opcontrol --stop\n")
- f.write("opcontrol --reset\n")
- f.write("opcontrol --start\n")
-
- f.write("(\n")
-
- for udelay in (10, 50, 100, 200, 300):
- for nspes in range(options.min_spes, options.max_spes+1):
- cmd = "./benchmark_nop -n %d -u %d -N %d\n" % (nspes, udelay, njobs[udelay])
- f.write(cmd)
- f.write(cmd)
-
- f.write(") | tee %s\n" % (f_results,))
-
- if options.oprofile:
- f.write("opcontrol --dump\n")
- f.write("opcontrol --stop\n")
- f.write("opreport -l | head -100 > %s\n" % (f_opreport,))
-
- f.write("./split_and_avg_results.py %s > %s\n" % (f_results, f_avg))
- f.write("./plot_speedup.py %s -o %s\n" % (f_avg, f_png))
-
-
-if __name__ == '__main__':
- main()
diff --git a/gcell/apps/plot_speedup.py b/gcell/apps/plot_speedup.py
deleted file mode 100755
index 37822a73f..000000000
--- a/gcell/apps/plot_speedup.py
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/usr/bin/env python
-
-from optparse import OptionParser
-from pylab import *
-from pprint import pprint
-import os.path
-
-
-def add_entry(d, nspes, speedup, work_incr):
- if d.has_key(work_incr):
- d[work_incr].append((nspes, speedup))
- else:
- d[work_incr] = [(nspes, speedup)]
-
-def parse_file(f):
- d = {}
- for line in f:
- items = [float(x) for x in line.split()]
- # print "items =", items
- nspes = items[0]
- work_incr = int(1e6 * items[1])
- speedup = items[4]
- add_entry(d, nspes, speedup, work_incr)
- return d
-
-
-class plot_data(object):
- def __init__(self, filenames, output_filename):
- self.fig = figure(1, figsize=(8, 6), facecolor='w')
- self.sp = self.fig.add_subplot(1,1,1)
- self.sp.set_xlabel("nspes", fontweight="bold")
- self.sp.set_ylabel("speedup", fontweight="bold")
- self.sp.grid(True)
- # print 'rcParams["legend.fontsize"] =', rcParams["legend.fontsize"]
- rcParams["legend.fontsize"] = 10
-
-
- self.markers = {
- 5 : 'x',
- 10 : 'o',
- 50 : 's',
- 100 : '^',
- 200 : 'D',
- 300 : 'v',
- 400 : '>',
- 500 : 'h'
- }
-
- if len(filenames) == 1:
- f = filenames[0]
- d = parse_file(open(f))
- self.make_single_plot(d, f)
-
- else:
- for f in filenames:
- d = parse_file(open(f))
- self.make_plot(d, f, f == filenames[0])
-
- if output_filename:
- savefig(output_filename)
- else:
- show()
-
-
- def make_single_plot(self, d, filename):
- def style(k):
- return self.markers[k]
-
- tag, ext = os.path.splitext(os.path.basename(filename))
- title(tag)
- keys = d.keys()
- keys.sort()
- keys.reverse()
- for k in keys:
- vlist = d[k] # list of 2-tuples
- xs = [v[0] for v in vlist]
- ys = [v[1] for v in vlist]
- plot(xs, ys, style(k), label="%d us" % (k,))
-
- x = legend(loc=2)
-
- def make_plot(self, d, filename, first):
- def style(k):
- if first:
- return self.markers[k]
- else:
- return 'k' + self.markers[k]
-
- tag, ext = os.path.splitext(os.path.basename(filename))
- keys = d.keys()
- keys.sort()
- keys.reverse()
- for k in keys:
- vlist = d[k] # list of 2-tuples
- xs = [v[0] for v in vlist]
- ys = [v[1] for v in vlist]
- plot(xs, ys, style(k), label="%s %d us" % (tag, k))
-
- x = legend(loc=2)
-
-def main():
- usage="%prog: [options] input_filename..."
- description = "Plot R*.avg files from benchmark_nop.py"
- parser = OptionParser(usage=usage, description=description)
- parser.add_option('-o', '--output', default=None, metavar="FILE",
- help="generate .png file")
- (options, args) = parser.parse_args()
- if len(args) < 1:
- parser.print_help()
- raise SystemExit, 1
-
- filenames = args
- dc = plot_data(filenames, options.output)
-
-
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
-
diff --git a/gcell/apps/results-071223 b/gcell/apps/results-071223
deleted file mode 100644
index 271617121..000000000
--- a/gcell/apps/results-071223
+++ /dev/null
@@ -1,126 +0,0 @@
-nspes: 1 udelay: 1 elapsed_time: 26.117 njobs: 1e+06 us/job: 26.117
-nspes: 1 udelay: 1 elapsed_time: 26.058 njobs: 1e+06 us/job: 26.058
-nspes: 1 udelay: 1 elapsed_time: 26.737 njobs: 1e+06 us/job: 26.737
-nspes: 2 udelay: 1 elapsed_time: 23.585 njobs: 1e+06 us/job: 23.585
-nspes: 2 udelay: 1 elapsed_time: 21.958 njobs: 1e+06 us/job: 21.958
-nspes: 2 udelay: 1 elapsed_time: 21.034 njobs: 1e+06 us/job: 21.034
-nspes: 3 udelay: 1 elapsed_time: 25.819 njobs: 1e+06 us/job: 25.819
-nspes: 3 udelay: 1 elapsed_time: 23.719 njobs: 1e+06 us/job: 23.719
-nspes: 3 udelay: 1 elapsed_time: 21.711 njobs: 1e+06 us/job: 21.711
-nspes: 4 udelay: 1 elapsed_time: 20.210 njobs: 1e+06 us/job: 20.210
-nspes: 4 udelay: 1 elapsed_time: 20.558 njobs: 1e+06 us/job: 20.558
-nspes: 4 udelay: 1 elapsed_time: 20.957 njobs: 1e+06 us/job: 20.957
-nspes: 5 udelay: 1 elapsed_time: 24.571 njobs: 1e+06 us/job: 24.571
-nspes: 5 udelay: 1 elapsed_time: 20.207 njobs: 1e+06 us/job: 20.207
-nspes: 5 udelay: 1 elapsed_time: 21.976 njobs: 1e+06 us/job: 21.976
-nspes: 6 udelay: 1 elapsed_time: 22.601 njobs: 1e+06 us/job: 22.601
-nspes: 6 udelay: 1 elapsed_time: 18.794 njobs: 1e+06 us/job: 18.794
-nspes: 6 udelay: 1 elapsed_time: 19.755 njobs: 1e+06 us/job: 19.755
-nspes: 1 udelay: 5 elapsed_time: 28.047 njobs: 1e+06 us/job: 28.047
-nspes: 1 udelay: 5 elapsed_time: 27.265 njobs: 1e+06 us/job: 27.265
-nspes: 1 udelay: 5 elapsed_time: 27.555 njobs: 1e+06 us/job: 27.555
-nspes: 2 udelay: 5 elapsed_time: 21.130 njobs: 1e+06 us/job: 21.130
-nspes: 2 udelay: 5 elapsed_time: 21.067 njobs: 1e+06 us/job: 21.067
-nspes: 2 udelay: 5 elapsed_time: 21.607 njobs: 1e+06 us/job: 21.607
-nspes: 3 udelay: 5 elapsed_time: 23.712 njobs: 1e+06 us/job: 23.712
-nspes: 3 udelay: 5 elapsed_time: 23.658 njobs: 1e+06 us/job: 23.658
-nspes: 3 udelay: 5 elapsed_time: 25.277 njobs: 1e+06 us/job: 25.277
-nspes: 4 udelay: 5 elapsed_time: 22.264 njobs: 1e+06 us/job: 22.264
-nspes: 4 udelay: 5 elapsed_time: 20.970 njobs: 1e+06 us/job: 20.970
-nspes: 4 udelay: 5 elapsed_time: 21.533 njobs: 1e+06 us/job: 21.533
-nspes: 5 udelay: 5 elapsed_time: 21.504 njobs: 1e+06 us/job: 21.504
-nspes: 5 udelay: 5 elapsed_time: 21.956 njobs: 1e+06 us/job: 21.956
-nspes: 5 udelay: 5 elapsed_time: 21.333 njobs: 1e+06 us/job: 21.333
-nspes: 6 udelay: 5 elapsed_time: 20.639 njobs: 1e+06 us/job: 20.639
-nspes: 6 udelay: 5 elapsed_time: 23.022 njobs: 1e+06 us/job: 23.022
-nspes: 6 udelay: 5 elapsed_time: 22.453 njobs: 1e+06 us/job: 22.453
-nspes: 1 udelay: 10 elapsed_time: 27.780 njobs: 1e+06 us/job: 27.780
-nspes: 1 udelay: 10 elapsed_time: 27.683 njobs: 1e+06 us/job: 27.683
-nspes: 1 udelay: 10 elapsed_time: 26.803 njobs: 1e+06 us/job: 26.803
-nspes: 2 udelay: 10 elapsed_time: 20.878 njobs: 1e+06 us/job: 20.878
-nspes: 2 udelay: 10 elapsed_time: 22.430 njobs: 1e+06 us/job: 22.430
-nspes: 2 udelay: 10 elapsed_time: 20.952 njobs: 1e+06 us/job: 20.952
-nspes: 3 udelay: 10 elapsed_time: 22.752 njobs: 1e+06 us/job: 22.752
-nspes: 3 udelay: 10 elapsed_time: 24.294 njobs: 1e+06 us/job: 24.294
-nspes: 3 udelay: 10 elapsed_time: 23.935 njobs: 1e+06 us/job: 23.935
-nspes: 4 udelay: 10 elapsed_time: 20.437 njobs: 1e+06 us/job: 20.437
-nspes: 4 udelay: 10 elapsed_time: 21.498 njobs: 1e+06 us/job: 21.498
-nspes: 4 udelay: 10 elapsed_time: 20.521 njobs: 1e+06 us/job: 20.521
-nspes: 5 udelay: 10 elapsed_time: 22.704 njobs: 1e+06 us/job: 22.704
-nspes: 5 udelay: 10 elapsed_time: 21.106 njobs: 1e+06 us/job: 21.106
-nspes: 5 udelay: 10 elapsed_time: 22.800 njobs: 1e+06 us/job: 22.800
-nspes: 6 udelay: 10 elapsed_time: 21.098 njobs: 1e+06 us/job: 21.098
-nspes: 6 udelay: 10 elapsed_time: 22.749 njobs: 1e+06 us/job: 22.749
-nspes: 6 udelay: 10 elapsed_time: 19.651 njobs: 1e+06 us/job: 19.651
-nspes: 1 udelay: 50 elapsed_time: 54.621 njobs: 1e+06 us/job: 54.621
-nspes: 1 udelay: 50 elapsed_time: 54.548 njobs: 1e+06 us/job: 54.548
-nspes: 1 udelay: 50 elapsed_time: 54.641 njobs: 1e+06 us/job: 54.641
-nspes: 2 udelay: 50 elapsed_time: 30.837 njobs: 1e+06 us/job: 30.837
-nspes: 2 udelay: 50 elapsed_time: 30.933 njobs: 1e+06 us/job: 30.933
-nspes: 2 udelay: 50 elapsed_time: 30.044 njobs: 1e+06 us/job: 30.044
-nspes: 3 udelay: 50 elapsed_time: 24.170 njobs: 1e+06 us/job: 24.170
-nspes: 3 udelay: 50 elapsed_time: 23.798 njobs: 1e+06 us/job: 23.798
-nspes: 3 udelay: 50 elapsed_time: 23.515 njobs: 1e+06 us/job: 23.515
-nspes: 4 udelay: 50 elapsed_time: 23.011 njobs: 1e+06 us/job: 23.011
-nspes: 4 udelay: 50 elapsed_time: 21.382 njobs: 1e+06 us/job: 21.382
-nspes: 4 udelay: 50 elapsed_time: 20.531 njobs: 1e+06 us/job: 20.531
-nspes: 5 udelay: 50 elapsed_time: 24.157 njobs: 1e+06 us/job: 24.157
-nspes: 5 udelay: 50 elapsed_time: 21.119 njobs: 1e+06 us/job: 21.119
-nspes: 5 udelay: 50 elapsed_time: 22.055 njobs: 1e+06 us/job: 22.055
-nspes: 6 udelay: 50 elapsed_time: 19.136 njobs: 1e+06 us/job: 19.136
-nspes: 6 udelay: 50 elapsed_time: 20.607 njobs: 1e+06 us/job: 20.607
-nspes: 6 udelay: 50 elapsed_time: 20.527 njobs: 1e+06 us/job: 20.527
-nspes: 1 udelay: 100 elapsed_time: 107.531 njobs: 1e+06 us/job: 107.531
-nspes: 1 udelay: 100 elapsed_time: 107.607 njobs: 1e+06 us/job: 107.607
-nspes: 1 udelay: 100 elapsed_time: 107.532 njobs: 1e+06 us/job: 107.532
-nspes: 2 udelay: 100 elapsed_time: 53.950 njobs: 1e+06 us/job: 53.950
-nspes: 2 udelay: 100 elapsed_time: 53.920 njobs: 1e+06 us/job: 53.920
-nspes: 2 udelay: 100 elapsed_time: 54.232 njobs: 1e+06 us/job: 54.232
-nspes: 3 udelay: 100 elapsed_time: 37.987 njobs: 1e+06 us/job: 37.987
-nspes: 3 udelay: 100 elapsed_time: 38.778 njobs: 1e+06 us/job: 38.778
-nspes: 3 udelay: 100 elapsed_time: 39.042 njobs: 1e+06 us/job: 39.042
-nspes: 4 udelay: 100 elapsed_time: 31.192 njobs: 1e+06 us/job: 31.192
-nspes: 4 udelay: 100 elapsed_time: 31.090 njobs: 1e+06 us/job: 31.090
-nspes: 4 udelay: 100 elapsed_time: 31.472 njobs: 1e+06 us/job: 31.472
-nspes: 5 udelay: 100 elapsed_time: 28.490 njobs: 1e+06 us/job: 28.490
-nspes: 5 udelay: 100 elapsed_time: 27.574 njobs: 1e+06 us/job: 27.574
-nspes: 5 udelay: 100 elapsed_time: 27.013 njobs: 1e+06 us/job: 27.013
-nspes: 6 udelay: 100 elapsed_time: 26.635 njobs: 1e+06 us/job: 26.635
-nspes: 6 udelay: 100 elapsed_time: 24.036 njobs: 1e+06 us/job: 24.036
-nspes: 6 udelay: 100 elapsed_time: 26.174 njobs: 1e+06 us/job: 26.174
-nspes: 1 udelay: 300 elapsed_time: 320.618 njobs: 1e+06 us/job: 320.618
-nspes: 1 udelay: 300 elapsed_time: 320.635 njobs: 1e+06 us/job: 320.635
-nspes: 1 udelay: 300 elapsed_time: 320.699 njobs: 1e+06 us/job: 320.699
-nspes: 2 udelay: 300 elapsed_time: 160.314 njobs: 1e+06 us/job: 160.314
-nspes: 2 udelay: 300 elapsed_time: 160.340 njobs: 1e+06 us/job: 160.340
-nspes: 2 udelay: 300 elapsed_time: 160.312 njobs: 1e+06 us/job: 160.312
-nspes: 3 udelay: 300 elapsed_time: 106.878 njobs: 1e+06 us/job: 106.878
-nspes: 3 udelay: 300 elapsed_time: 106.875 njobs: 1e+06 us/job: 106.875
-nspes: 3 udelay: 300 elapsed_time: 106.871 njobs: 1e+06 us/job: 106.871
-nspes: 4 udelay: 300 elapsed_time: 80.158 njobs: 1e+06 us/job: 80.158
-nspes: 4 udelay: 300 elapsed_time: 80.163 njobs: 1e+06 us/job: 80.163
-nspes: 4 udelay: 300 elapsed_time: 80.154 njobs: 1e+06 us/job: 80.154
-nspes: 5 udelay: 300 elapsed_time: 64.156 njobs: 1e+06 us/job: 64.156
-nspes: 5 udelay: 300 elapsed_time: 64.250 njobs: 1e+06 us/job: 64.250
-nspes: 5 udelay: 300 elapsed_time: 64.158 njobs: 1e+06 us/job: 64.158
-nspes: 6 udelay: 300 elapsed_time: 53.633 njobs: 1e+06 us/job: 53.633
-nspes: 6 udelay: 300 elapsed_time: 53.541 njobs: 1e+06 us/job: 53.541
-nspes: 6 udelay: 300 elapsed_time: 53.617 njobs: 1e+06 us/job: 53.617
-nspes: 1 udelay: 500 elapsed_time: 533.638 njobs: 1e+06 us/job: 533.638
-nspes: 1 udelay: 500 elapsed_time: 533.649 njobs: 1e+06 us/job: 533.649
-nspes: 1 udelay: 500 elapsed_time: 533.618 njobs: 1e+06 us/job: 533.618
-nspes: 2 udelay: 500 elapsed_time: 266.810 njobs: 1e+06 us/job: 266.810
-nspes: 2 udelay: 500 elapsed_time: 266.814 njobs: 1e+06 us/job: 266.814
-nspes: 2 udelay: 500 elapsed_time: 266.893 njobs: 1e+06 us/job: 266.893
-nspes: 3 udelay: 500 elapsed_time: 177.875 njobs: 1e+06 us/job: 177.875
-nspes: 3 udelay: 500 elapsed_time: 177.878 njobs: 1e+06 us/job: 177.878
-nspes: 3 udelay: 500 elapsed_time: 177.875 njobs: 1e+06 us/job: 177.875
-nspes: 4 udelay: 500 elapsed_time: 133.417 njobs: 1e+06 us/job: 133.417
-nspes: 4 udelay: 500 elapsed_time: 133.483 njobs: 1e+06 us/job: 133.483
-nspes: 4 udelay: 500 elapsed_time: 133.407 njobs: 1e+06 us/job: 133.407
-nspes: 5 udelay: 500 elapsed_time: 106.723 njobs: 1e+06 us/job: 106.723
-nspes: 5 udelay: 500 elapsed_time: 106.728 njobs: 1e+06 us/job: 106.728
-nspes: 5 udelay: 500 elapsed_time: 106.722 njobs: 1e+06 us/job: 106.722
-nspes: 6 udelay: 500 elapsed_time: 88.943 njobs: 1e+06 us/job: 88.943
-nspes: 6 udelay: 500 elapsed_time: 88.941 njobs: 1e+06 us/job: 88.941
-nspes: 6 udelay: 500 elapsed_time: 88.944 njobs: 1e+06 us/job: 88.944
diff --git a/gcell/apps/split_and_avg_results.py b/gcell/apps/split_and_avg_results.py
deleted file mode 100755
index 8a750fac9..000000000
--- a/gcell/apps/split_and_avg_results.py
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-"""
-input file looks like this:
-
-nspes: 1 udelay: 10 elapsed_time: 6.842 njobs: 500000 speedup: 0.731
-nspes: 2 udelay: 10 elapsed_time: 4.093 njobs: 500000 speedup: 1.221
-"""
-
-import sys
-from optparse import OptionParser
-from pprint import pprint
-
-class data(object):
- def __init__(self, nspes, work_per_job, elapsed_time, njobs):
- self.nspes = nspes
- self.work_per_job = work_per_job # seconds
- self.elapsed_time = elapsed_time # seconds
- self.njobs = njobs
- self.speedup = work_per_job * njobs / elapsed_time
-
- def __repr__(self):
- return "<data nspes=%d work_per_job=%s elapsed_time=%s njobs=%s speedup=%s>" % (
- self.nspes, (self.work_per_job),
- (self.elapsed_time),
- (self.njobs),
- (self.speedup))
-
-def cmp_data(x, y):
- t = x.nspes - y.nspes
- if t == 0:
- t = x.work_per_job - y.work_per_job
- if t < 0:
- return -1
- elif t > 0:
- return +1
- else:
- return 0
- return t
-
-def main():
- usage = "usage: %prog [options] input_filename"
- parser = OptionParser(usage=usage)
- (options, args) = parser.parse_args()
- if len(args) != 1:
- parser.print_help()
- raise SystemExit, 1
- input_filename = args[0]
-
-
- m = {}
- for line in open(input_filename, "r"):
- s = line.split()
- nspes = int(s[1])
- work_per_job = int(s[3]) * 1e-6
- elapsed_time = float(s[5])
- njobs = float(s[7])
- d = data(nspes, work_per_job, elapsed_time, njobs)
-
- # collect lists that have the same values for nspes and work_per_job
- # so we can generate an average elapsed_time from all observations
- key = (nspes, work_per_job)
- v = m.get(key, [])
- v.append(d)
- m[key] = v
-
- r = []
- for k, v in m.iteritems():
- total_elapsed_time = sum([x.elapsed_time for x in v])
- r.append(data(v[0].nspes,
- v[0].work_per_job,
- total_elapsed_time/len(v),
- v[0].njobs))
-
- r.sort(cmp_data)
-
- #pprint(r)
- for t in r:
- print t.nspes, t.work_per_job, t.elapsed_time, t.njobs, t.speedup
-
-if __name__ == '__main__':
- main()
diff --git a/gcell/apps/spu/.gitignore b/gcell/apps/spu/.gitignore
deleted file mode 100644
index c50e521a3..000000000
--- a/gcell/apps/spu/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/*.a
-/*.la
-/*.lo
-/.deps
-/.libs
-/benchmark_procs
diff --git a/gcell/apps/spu/Makefile.am b/gcell/apps/spu/Makefile.am
deleted file mode 100644
index c07a2c398..000000000
--- a/gcell/apps/spu/Makefile.am
+++ /dev/null
@@ -1,34 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-
-include $(top_srcdir)/Makefile.common.spu
-
-AM_CPPFLAGS = $(GCELL_SPU_INCLUDES)
-
-# SPU executables
-
-noinst_PROGRAMS = \
- benchmark_procs
-
-benchmark_procs_SOURCES = benchmark_procs.c
-benchmark_procs_LDADD = $(GCELL_SPU_LA)
-benchmark_procs_DEPENDENCIES = $(GCELL_SPU_LA)
-
diff --git a/gcell/apps/spu/benchmark_procs.c b/gcell/apps/spu/benchmark_procs.c
deleted file mode 100644
index fbc703349..000000000
--- a/gcell/apps/spu/benchmark_procs.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_declare_proc.h>
-#include <gcell/spu/gc_delay.h>
-#include <string.h>
-
-static void
-benchmark_udelay(const gc_job_direct_args_t *input,
- gc_job_direct_args_t *output _UNUSED,
- const gc_job_ea_args_t *eaa _UNUSED)
-{
- gc_udelay(input->arg[0].u32);
-}
-
-GC_DECLARE_PROC(benchmark_udelay, "benchmark_udelay");
-
-
-
-static void
-benchmark_put_zeros(const gc_job_direct_args_t *input _UNUSED,
- gc_job_direct_args_t *output _UNUSED,
- const gc_job_ea_args_t *eaa)
-{
- for (unsigned int i = 0; i < eaa->nargs; i++){
- if (eaa->arg[i].direction == GCJD_DMA_PUT)
- memset(eaa->arg[i].ls_addr, 0, eaa->arg[i].put_size);
- }
-}
-
-GC_DECLARE_PROC(benchmark_put_zeros, "benchmark_put_zeros");
-
-
-static void
-benchmark_copy(const gc_job_direct_args_t *input _UNUSED,
- gc_job_direct_args_t *output,
- const gc_job_ea_args_t *eaa)
-{
- if (eaa->nargs != 2
- || eaa->arg[0].direction != GCJD_DMA_PUT
- || eaa->arg[1].direction != GCJD_DMA_GET){
- output->arg[0].s32 = -1;
- return;
- }
-
- output->arg[0].s32 = 0;
- unsigned n = eaa->arg[0].put_size;
- if (eaa->arg[1].get_size < n)
- n = eaa->arg[1].get_size;
-
- memcpy(eaa->arg[0].ls_addr, eaa->arg[1].ls_addr, n);
-}
-
-GC_DECLARE_PROC(benchmark_copy, "benchmark_copy");
diff --git a/gcell/apps/test_all.cc b/gcell/apps/test_all.cc
deleted file mode 100644
index fc3afd8ca..000000000
--- a/gcell/apps/test_all.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <cppunit/TextTestRunner.h>
-#include <cppunit/XmlOutputter.h>
-
-#include <gr_unittests.h>
-#include "../lib/runtime/qa_gcell_runtime.h"
-#include "../lib/wrapper/qa_gcell_wrapper.h"
-
-int
-main(int argc, char **argv)
-{
- CppUnit::TextTestRunner runner;
- std::ofstream xmlfile(get_unittest_path("gcell_all.xml").c_str());
- CppUnit::XmlOutputter *xmlout = new CppUnit::XmlOutputter(&runner.result(), xmlfile);
-
- runner.addTest(qa_gcell_runtime::suite());
- runner.addTest(qa_gcell_wrapper::suite());
- runner.setOutputter(xmlout);
-
- bool was_successful = runner.run("", false);
-
- return was_successful ? 0 : 1;
-}
diff --git a/gcell/gcell.pc.in b/gcell/gcell.pc.in
deleted file mode 100644
index 1a3cd9c26..000000000
--- a/gcell/gcell.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-gcell_embedspu_libtool=@bindir@/gcell-embedspu-libtool
-
-Name: gcell
-Description: The GNU Radio SPE scheduler and RPC mechanism
-Requires:
-Version: @LIBVER@
-Libs: -L${libdir} -lgcell
-Cflags: -I${includedir} @DEFINES@
diff --git a/gcell/gcell_spu.pc.in b/gcell/gcell_spu.pc.in
deleted file mode 100644
index b59043b9b..000000000
--- a/gcell/gcell_spu.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@spu
-includedir=@includedir@
-
-Name: gcell_spu
-Description: The GNU Radio SPE scheduler and RPC mechanism (SPU components)
-Requires:
-Version: @VERSION@
-Libs: -L${libdir} -lgcell_spu
-Cflags: -I${includedir}
diff --git a/gcell/ibm/Makefile.am b/gcell/ibm/Makefile.am
deleted file mode 100644
index 6438c7331..000000000
--- a/gcell/ibm/Makefile.am
+++ /dev/null
@@ -1,98 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- ./README \
- ./sync/ppu_source/atomic_add.h \
- ./sync/ppu_source/atomic_add_return.h \
- ./sync/ppu_source/atomic_dec_and_test.h \
- ./sync/ppu_source/atomic_dec.h \
- ./sync/ppu_source/atomic_dec_if_positive.h \
- ./sync/ppu_source/atomic_dec_return.h \
- ./sync/ppu_source/atomic.h \
- ./sync/ppu_source/atomic_inc.h \
- ./sync/ppu_source/atomic_inc_return.h \
- ./sync/ppu_source/atomic_read.h \
- ./sync/ppu_source/atomic_set.h \
- ./sync/ppu_source/atomic_sub_and_test.h \
- ./sync/ppu_source/atomic_sub.h \
- ./sync/ppu_source/atomic_sub_return.h \
- ./sync/ppu_source/complete_all.h \
- ./sync/ppu_source/complete.h \
- ./sync/ppu_source/completion.h \
- ./sync/ppu_source/cond_broadcast.h \
- ./sync/ppu_source/cond.h \
- ./sync/ppu_source/cond_init.h \
- ./sync/ppu_source/cond_signal.h \
- ./sync/ppu_source/cond_wait.h \
- ./sync/ppu_source/init_completion.h \
- ./sync/ppu_source/libsync.h \
- ./sync/ppu_source/mutex.h \
- ./sync/ppu_source/mutex_init.h \
- ./sync/ppu_source/mutex_lock.h \
- ./sync/ppu_source/mutex_trylock.h \
- ./sync/ppu_source/mutex_unlock.h \
- ./sync/ppu_source/pdt_libsync_config.xml \
- ./sync/ppu_source/pdt_libsync.xml \
- ./sync/ppu_source/sync_utils.h \
- ./sync/ppu_source/trace_libsync.h \
- ./sync/ppu_source/wait_for_completion.h \
- ./sync/spu_source/atomic_add.h \
- ./sync/spu_source/atomic_add_return.h \
- ./sync/spu_source/atomic_dec_and_test.h \
- ./sync/spu_source/atomic_dec.h \
- ./sync/spu_source/atomic_dec_if_positive.h \
- ./sync/spu_source/atomic_dec_return.h \
- ./sync/spu_source/atomic.h \
- ./sync/spu_source/atomic_inc.h \
- ./sync/spu_source/atomic_inc_return.h \
- ./sync/spu_source/atomic_read.h \
- ./sync/spu_source/atomic_set.h \
- ./sync/spu_source/atomic_sub_and_test.h \
- ./sync/spu_source/atomic_sub.h \
- ./sync/spu_source/atomic_sub_return.h \
- ./sync/spu_source/complete_all.h \
- ./sync/spu_source/complete.h \
- ./sync/spu_source/completion.h \
- ./sync/spu_source/cond_broadcast.h \
- ./sync/spu_source/cond.h \
- ./sync/spu_source/cond_init.h \
- ./sync/spu_source/cond_signal.h \
- ./sync/spu_source/cond_wait.h \
- ./sync/spu_source/init_completion.h \
- ./sync/spu_source/libsync.h \
- ./sync/spu_source/mutex.h \
- ./sync/spu_source/mutex_init.h \
- ./sync/spu_source/mutex_lock.h \
- ./sync/spu_source/mutex_trylock.h \
- ./sync/spu_source/mutex_unlock.h \
- ./sync/spu_source/read_lock.h \
- ./sync/spu_source/read_trylock.h \
- ./sync/spu_source/read_unlock.h \
- ./sync/spu_source/rwlock_init.h \
- ./sync/spu_source/sync_irq.h \
- ./sync/spu_source/sync_utils.h \
- ./sync/spu_source/trace_libsync.h \
- ./sync/spu_source/wait_for_completion.h \
- ./sync/spu_source/write_lock.h \
- ./sync/spu_source/write_trylock.h \
- ./sync/spu_source/write_unlock.h
diff --git a/gcell/ibm/README b/gcell/ibm/README
deleted file mode 100644
index 9420fcc46..000000000
--- a/gcell/ibm/README
+++ /dev/null
@@ -1,10 +0,0 @@
-This directory and below contains code from IBM licensed under the
-"Modified BSD license." It was extracted unmodified from the IBM Cell
-SDK 3.0 library source tarball, lib_source.tar, typically found in
-/opt/cell/sdk/src/lib_source.tar.
-
-We've done this because this code doesn't come unpacked in the native
-(cell) installation of the SDK 3.0, and thus we can't just add a
--I/path/to/this/stuff in our Makefiles. If this changes, we'll delete
-this code from here, and fix our Makefiles. In the meanwhile, this
-reduces the probability of build problems.
diff --git a/gcell/ibm/sync/ppu_source/atomic.h b/gcell/ibm/sync/ppu_source/atomic.h
deleted file mode 100644
index 105f7bf37..000000000
--- a/gcell/ibm/sync/ppu_source/atomic.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-/*
- * atomic.h - PPE atomic SHM counter operations.
- *
- * Interfaces patterned after, and hopefully compatible
- * with PowerPC64-Linux atomic counter operations. Uses
- * 32b values for various counters.
- */
-#ifndef _PPU_ATOMIC_H_
-#define _PPU_ATOMIC_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-
-typedef unsigned int atomic_t __attribute__ ((aligned (128)));
-
-
-/* atomic_ea_t is a 64bit effective address that points to
- * an atomic_t variable
- */
-typedef unsigned long long atomic_ea_t;
-
-/**
- * ASSUMPTIONS:
- * On the PPE, the size of a reservation granule is 128 bytes
- * (a cache-line), so when a programmer puts a reservation on an
- * address, that whole cacheline is reserved. Therefore both
- * the PPE and SPE can participate in an atomic operation as long as
- * lwarx and getllar operate on the same cacheline.
- */
-
-
-/*
- * atomically loads and replaces the value v with val.
- * Returns the old value at v
- */
-static __inline int _atomic_replace(atomic_ea_t v, int val)
-{
- int old;
- void *p;
-
- SYNC_ULL_TO_PTR(v, p);
-
- do {
- old = (int)__lwarx(p);
- } while (__stwcx(p, (unsigned int)val) == 0);
-
- return old;
-}
-
-
-/*
- * atomically loads the value at v, adds val, replaces the
- * value at v with the sum. Returns the old value at v
- */
-static __inline int _atomic_modify(atomic_ea_t v, int val)
-{
- int oldval, newval;
- void *p;
-
- SYNC_ULL_TO_PTR(v, p);
-
- do {
- oldval = (int)__lwarx(p);
- newval = oldval + val;
- } while (__stwcx(p, (unsigned int)newval) == 0);
-
- return oldval;
-}
-
-
-#endif /* _PPU_ATOMIC_H_ */
-
diff --git a/gcell/ibm/sync/ppu_source/atomic_add.h b/gcell/ibm/sync/ppu_source/atomic_add.h
deleted file mode 100644
index dd7a5b25a..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_add.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_ADD_H_
-#define _PPU_ATOMIC_ADD_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_add - atomically add to a counter.
- * @v: handle to effective address of counter.
- * @a: value to be added.
- *
- * Atomically add a value to a counter in system memory.
- * The only restriction is that @v must be word aligned.
- */
-static __inline void _atomic_add(int a, atomic_ea_t v)
-{
- _atomic_modify (v, a);
-}
-
-
-
-#endif /* _PPU_ATOMIC_ADD_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_add_return.h b/gcell/ibm/sync/ppu_source/atomic_add_return.h
deleted file mode 100644
index 0fe127565..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_add_return.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_ADD_RETURN_H_
-#define _PPU_ATOMIC_ADD_RETURN_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_add_return - atomically add to a counter and return previous value.
- * @v: handle to effective address of counter.
- * @a: value to be added.
- *
- * Atomically add a value to a counter in system memory.
- * The only restriction is that @v must be word aligned.
- *
- * This routine implements the "fetch and add" primitive
- * that is described in "Book I PowerPC User Instruction
- * Set Architecture"
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_add_return(int a, atomic_ea_t v)
-{
- return _atomic_modify (v, a);
-}
-
-
-#endif /* _PPU_ATOMIC_ADD_RETURN_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_dec.h b/gcell/ibm/sync/ppu_source/atomic_dec.h
deleted file mode 100644
index 4f82f04e0..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_dec.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_DEC_H_
-#define _PPU_ATOMIC_DEC_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_dec - atomically decrement a counter.
- * @v: handle to effective address of location to be modified.
- *
- * Atomically decrement a counter in system memory. The only
- * restriction is that @v must be word aligned.
- */
-static __inline void _atomic_dec(atomic_ea_t v)
-{
- _atomic_modify (v, -1);
-}
-
-
-#endif /* _PPU_ATOMIC_DEC_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_dec_and_test.h b/gcell/ibm/sync/ppu_source/atomic_dec_and_test.h
deleted file mode 100644
index 5093d4059..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_dec_and_test.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_DEC_AND_TEST_H_
-#define _PPU_ATOMIC_DEC_AND_TEST_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_dec_and_test - atomically decrement and test if previous==0.
- * @v: handle to effective address of counter.
- *
- * Atomically decrement a counter in system memory and test
- * if previous==0. The only restriction is that @v must be
- * word aligned.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_dec_and_test(atomic_ea_t v)
-{
- return (_atomic_modify(v, -1) == 0) ? 1 : 0;
-}
-
-
-#endif /* _PPU_ATOMIC_DEC_AND_TEST_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_dec_if_positive.h b/gcell/ibm/sync/ppu_source/atomic_dec_if_positive.h
deleted file mode 100644
index c4d113bfd..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_dec_if_positive.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_DEC_IF_POSITIVE_H_
-#define _PPU_ATOMIC_DEC_IF_POSITIVE_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "atomic.h"
-
-/*
- * atomic_dec_if_positive - atomically decrement if counter is positive.
- *
- * v: handle to effective address of counter.
- *
- * Atomically decrement a counter if its value is positive.
- * The only restriction is that v must be word aligned.
- *
- *
- * Returns the old value of the counter, minus 1.
- */
-static __inline int _atomic_dec_if_positive(atomic_ea_t v)
-{
- int ret;
- int tmp;
- void *p;
-
- SYNC_ULL_TO_PTR(v, p);
-
- do {
- tmp = (int)__lwarx(p);
- ret = tmp - 1;
- tmp = (tmp > 0) ? ret : tmp;
- } while (__stwcx(p, (unsigned)tmp) == 0);
-
- return ret;
-}
-
-#endif /* _PPU_ATOMIC_DEC_IF_POSITIVE_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_dec_return.h b/gcell/ibm/sync/ppu_source/atomic_dec_return.h
deleted file mode 100644
index cd87893fa..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_dec_return.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_DEC_RETURN_H_
-#define _PPU_ATOMIC_DEC_RETURN_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_dec_return - atomically decrement a counter and return previous value.
- * @v: handle to effective address of counter.
- *
- * Atomically decrement a counter in system memory and return its
- * previous value. The only restriction is that @v must be word
- * aligned.
- *
- * This routine implements the "fetch and decrement"
- * primitive that is described in "Book I PowerPC User
- * Instruction Set Architecture".
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_dec_return(atomic_ea_t v)
-{
- return _atomic_modify (v, -1);
-}
-
-
-
-#endif /* _PPU_ATOMIC_DEC_RETURN_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_inc.h b/gcell/ibm/sync/ppu_source/atomic_inc.h
deleted file mode 100644
index 714aecbc0..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_inc.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_INC_H_
-#define _PPU_ATOMIC_INC_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_inc - atomically increment a counter in system memory.
- * @v: handle to effective address of counter.
- *
- * Atomically increment a counter in system memory.
- * The only restriction is that @v must be word aligned.
- */
-static __inline void _atomic_inc(atomic_ea_t v)
-{
- _atomic_modify (v, 1);
-}
-
-#endif /* _PPU_ATOMIC_INC_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_inc_return.h b/gcell/ibm/sync/ppu_source/atomic_inc_return.h
deleted file mode 100644
index 95178f50d..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_inc_return.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_INC_RETURN_H_
-#define _PPU_ATOMIC_INC_RETURN_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-
-/**
- * atomic_inc_return - atomically increment a counter and return previous.
- * @v: handle to effective address of counter.
- *
- * Atomically increment a counter in system memory.
- * The only restriction is that @v must be word aligned.
- *
- * This routine implements the "fetch and increment"
- * primitive that is described in "Book I PowerPC User
- * Instruction Set Architecture"
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_inc_return(atomic_ea_t v)
-{
- return _atomic_modify (v, 1);
-}
-
-#endif /* _PPU_ATOMIC_INC_RETURN_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_read.h b/gcell/ibm/sync/ppu_source/atomic_read.h
deleted file mode 100644
index 258fd516c..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_read.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_READ_H_
-#define _PPU_ATOMIC_READ_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/*
- * On PowerPC architecture, if v is a word_aligned address, then
- * a load of that address is guaranteed to be atomic. An atomic
- * read operation is simply a load.
- */
-static __inline int _atomic_read(atomic_ea_t v)
-{
- volatile int *p;
-
- SYNC_ULL_TO_PTR(v, p);
-
- return (*p);
-}
-
-
-#endif /* _PPU_ATOMIC_READ_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_set.h b/gcell/ibm/sync/ppu_source/atomic_set.h
deleted file mode 100644
index e624af40d..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_set.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_SET_H_
-#define _PPU_ATOMIC_SET_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_set - atomically set a counter in system memory.
- * @v: this is a 64bit address that points to an atomic_t
- *
- * Atomically set a counter to a given value. The only
- * restriction is that @v must be word aligned.
- *
- * This routine implements the "fetch and store"
- * primitive that is described in "Book I PowerPC User
- * Instruction Set Architecture"
- *
- * Returns the previous value from system memory.
- */
-static __inline void _atomic_set(atomic_ea_t v, int val)
-{
- _atomic_replace (v, val);
-}
-
-
-#endif /* _PPU_ATOMIC_SET_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_sub.h b/gcell/ibm/sync/ppu_source/atomic_sub.h
deleted file mode 100644
index b8d35975a..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_sub.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_SUB_H_
-#define _PPU_ATOMIC_SUB_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_sub - atomically subtract from a counter.
- * @v: handle to effective address of counter.
- * @a: value to be subtracted.
- *
- * Atomically subtract a value from a counter in system memory.
- * The only restriction is that @v must be word aligned.
- */
-static __inline void _atomic_sub(int a, atomic_ea_t v)
-{
- _atomic_modify (v, -a);
-}
-
-
-#endif /* _PPU_ATOMIC_SUB_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_sub_and_test.h b/gcell/ibm/sync/ppu_source/atomic_sub_and_test.h
deleted file mode 100644
index 37ba58896..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_sub_and_test.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_SUB_AND_TEST_H_
-#define _PPU_ATOMIC_SUB_AND_TEST_H_
-
-#include "sync_utils.h"
-#include "atomic.h"
-
-/**
- * atomic_sub_and_test - atomically subtract and test if previous==0.
- * @v: handle to effective address of counter.
- * @a: value to be subtracted.
- *
- * Atomically subtract a value from a counter in system memory
- * and test if previous==0. The only restriction is that @v
- * must be word aligned.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_sub_and_test(int a, atomic_ea_t v)
-{
- return (_atomic_modify(v, -a) == 0) ? 1 : 0;
-}
-
-#endif /* _PPU_ATOMIC_SUB_AND_TEST_H_ */
diff --git a/gcell/ibm/sync/ppu_source/atomic_sub_return.h b/gcell/ibm/sync/ppu_source/atomic_sub_return.h
deleted file mode 100644
index 084bfa6b1..000000000
--- a/gcell/ibm/sync/ppu_source/atomic_sub_return.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_ATOMIC_SUB_RETURN_H_
-#define _PPU_ATOMIC_SUB_RETURN_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-
-/**
- * atomic_sub_return - atomically subtract from a counter & return previous.
- * @v: handle to effective address of counter.
- * @a: value to be subtracted.
- *
- * Atomically subtract a value from a counter in system memory.
- * The only restriction is that @v must be word aligned.
- *
- * Returns the previous value from system memory.
- */
-
-
-static __inline int _atomic_sub_return(int a, atomic_ea_t v)
-{
- return _atomic_modify (v, -a);
-}
-
-#endif /* _PPU_ATOMIC_SUB_RETURN_H_ */
diff --git a/gcell/ibm/sync/ppu_source/complete.h b/gcell/ibm/sync/ppu_source/complete.h
deleted file mode 100644
index 8633463f7..000000000
--- a/gcell/ibm/sync/ppu_source/complete.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COMPLETE_H_
-#define _PPU_COMPLETE_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "completion.h"
-
-
-static __inline void _complete (completion_ea_t comp)
-{
- unsigned int old;
- void *p;
-
- SYNC_ULL_TO_PTR(comp, p);
-
- do {
- old = __lwarx(p);
- } while (__stwcx(p, (unsigned int)1) == 0);
-}
-
-#endif /* _PPU_COMPLETE_H_ */
diff --git a/gcell/ibm/sync/ppu_source/complete_all.h b/gcell/ibm/sync/ppu_source/complete_all.h
deleted file mode 100644
index c12eb7f03..000000000
--- a/gcell/ibm/sync/ppu_source/complete_all.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COMPLETE_ALL_H_
-#define _PPU_COMPLETE_ALL_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "completion.h"
-
-/**
- * complete_all - indicate that a completion is true.
- * @completion: handle to effective address of completion variable.
- *
- * Indicate that all are completed is true by storing
- * MAX_THREADS_WAITING to the completionition variable.
- */
-
-static __inline void _complete_all(completion_ea_t comp)
-{
- unsigned int old;
- unsigned int val = MAX_THREADS_WAITING;
-
- void *p;
-
- SYNC_ULL_TO_PTR(comp, p);
-
- do {
- old = __lwarx(p);
- } while (__stwcx(p, val) == 0);
-}
-
-#endif /* _PPU_COMPLETE_ALL_H_ */
diff --git a/gcell/ibm/sync/ppu_source/completion.h b/gcell/ibm/sync/ppu_source/completion.h
deleted file mode 100644
index b74bdaae7..000000000
--- a/gcell/ibm/sync/ppu_source/completion.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-
-#ifndef _PPU_COMPLETION_H_
-#define _PPU_COMPLETION_H_
-
-
-#define MAX_THREADS_WAITING 32000
-
-typedef unsigned long long completion_ea_t;
-
-#endif /* _PPU_COMPLETION_H_ */
diff --git a/gcell/ibm/sync/ppu_source/cond.h b/gcell/ibm/sync/ppu_source/cond.h
deleted file mode 100644
index 9a38f71a4..000000000
--- a/gcell/ibm/sync/ppu_source/cond.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COND_VAR_H_
-#define _PPU_COND_VAR_H_
-
-#include <mutex.h>
-#include <sync_utils.h>
-
-
-typedef struct
-{
- short num_threads_signal; /* the number of threads that are going to be waken up.
- There are 3 values possible for this parameter, 0, 1,
- or num_threads_waiting*/
- short num_threads_waiting; /* the number of threads that are waiting to be awaken */
-} condition_variable_t __attribute__ ((aligned (16)));
-
-typedef unsigned long long cond_ea_t; /* a system memory 64 bit address that points to
- * a valid condition_variable_t */
-
-typedef union {
- unsigned long long ull;
- unsigned int ui[2];
-} val64;
-
-
-#endif /* _PPU_COND_VAR_H_ */
diff --git a/gcell/ibm/sync/ppu_source/cond_broadcast.h b/gcell/ibm/sync/ppu_source/cond_broadcast.h
deleted file mode 100644
index b93bf7b37..000000000
--- a/gcell/ibm/sync/ppu_source/cond_broadcast.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COND_BROADCAST_H_
-#define _PPU_COND_BROADCAST_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "cond.h"
-
-/**
- * cond_broadcast - indicate that a condition is true.
- * @cond: handle to effective address of condition variable.
- */
-static __inline void _cond_broadcast (cond_ea_t cond)
-{
- unsigned int val;
- void *p;
-
- SYNC_ULL_TO_PTR(cond, p);
-
- do {
- val = __lwarx(p);
-
- /* Copy the waiting count (low halfword) to
- * the signaled count (high halfword)
- */
- val = (val & 0xFFFF) | ((val+1) << 16);
-
- } while (__stwcx(p, val) == 0);
-}
-
-#endif /* _PPU_COND_BROADCAST_H_ */
diff --git a/gcell/ibm/sync/ppu_source/cond_init.h b/gcell/ibm/sync/ppu_source/cond_init.h
deleted file mode 100644
index 0dfbd6349..000000000
--- a/gcell/ibm/sync/ppu_source/cond_init.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COND_INIT_H_
-#define _PPU_COND_INIT_H_
-
-#include "sync_utils.h"
-#include "cond.h"
-
-/**
- * cond_init - initialize condition variable.
- * @cond: handle to effective address of condition variable.
- *
- * Only one thread initializes a condition variable. Usually, the
- * PPE thread initializes a condidtion variable
- *
- * Description: Initialize a cond variable to false.
- */
-static __inline void _cond_init (cond_ea_t cond)
-{
- volatile unsigned int *p;
-
- SYNC_ULL_TO_PTR(cond, p);
-
- *p = 0;
-}
-
-
-#endif /* _PPU_COND_INIT_H_ */
diff --git a/gcell/ibm/sync/ppu_source/cond_signal.h b/gcell/ibm/sync/ppu_source/cond_signal.h
deleted file mode 100644
index dd4874827..000000000
--- a/gcell/ibm/sync/ppu_source/cond_signal.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COND_SIGNAL_H_
-#define _PPU_COND_SIGNAL_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "cond.h"
-
-/*
- * _cond_signal: signaling any of the waiting threads to wake up.
- */
-static __inline void _cond_signal (cond_ea_t cond)
-{
- unsigned int val, waiting, signaled;
- void *p;
-
- SYNC_ULL_TO_PTR(cond, p);
-
- do {
- val = __lwarx(p);
-
- waiting = val & 0xFFFF;
- signaled = val >> 16;
-
- /* If no other party is waiting. Don't send a signal.
- * Otherwise, increment the signaled halfword.
- */
- if (waiting == signaled) break;
- val = ((val+1) << 16) | waiting;
-
- } while (__stwcx(p, val) == 0);
-}
-
-
-#endif /* _PPU_COND_SIGNAL_H_ */
diff --git a/gcell/ibm/sync/ppu_source/cond_wait.h b/gcell/ibm/sync/ppu_source/cond_wait.h
deleted file mode 100644
index ed5fbecb1..000000000
--- a/gcell/ibm/sync/ppu_source/cond_wait.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_COND_WAIT_H_
-#define _PPU_COND_WAIT_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "mutex_lock.h"
-#include "mutex_unlock.h"
-#include "cond.h"
-
-static __inline void _cond_wait (cond_ea_t cond, mutex_ea_t mutex)
-{
- int delta, cur_delta;
- unsigned int val, cond_val, signaled_cnt;
- void *p;
-
-
- SYNC_ULL_TO_PTR(cond, p);
-
- /* Atomically signal we have entered the condition wait by incrementing
- * the waiting count.
- */
- do {
- val = __lwarx(p);
- val = (val & ~0xFFFF) | ((val+1) & 0xFFFF);
- } while (__stwcx(p, val) == 0);
-
-
- /* Release the lock
- */
- _mutex_unlock (mutex);
-
- /* Determine the signal count needed for this
- * participant to be signaled.
- */
-
- signaled_cnt = val >> 16;
- delta = (int)(val & 0xFFFF) - (int)signaled_cnt;
- if (delta < 0) delta = -delta;
-
- /* Wait until the signaled count reaches the count
- * previously determined.
- */
- do {
- cond_val = __lwarx(p);
-
- cur_delta = (int)(cond_val >> 16) - signaled_cnt;
- if (cur_delta < 0) cur_delta = -cur_delta;
-
- } while (cur_delta < delta);
-
- /* Relock the mutex
- */
- _mutex_lock (mutex);
-}
-
-#endif /* _PPU_COND_WAIT_H_ */
diff --git a/gcell/ibm/sync/ppu_source/init_completion.h b/gcell/ibm/sync/ppu_source/init_completion.h
deleted file mode 100644
index 8e7081111..000000000
--- a/gcell/ibm/sync/ppu_source/init_completion.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_INIT_COMPLETION_H_
-#define _PPU_INIT_COMPLETION_H_
-
-#include "sync_utils.h"
-#include "completion.h"
-
-/**
- * completion_init - initialize completion variable.
- * @completion: handle to effective address of completion variable.
- *
- * Description: Initialize a completion variable to 0.
- */
-static __inline void _init_completion(completion_ea_t comp)
-{
- volatile unsigned int *p;
-
- SYNC_ULL_TO_PTR(comp, p);
-
- *p = 0;
-}
-
-
-#endif /* _PPU_INIT_COMPLETION_H_ */
diff --git a/gcell/ibm/sync/ppu_source/libsync.h b/gcell/ibm/sync/ppu_source/libsync.h
deleted file mode 100644
index bd2e04347..000000000
--- a/gcell/ibm/sync/ppu_source/libsync.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_LIBSYNC_H_
-#define _PPU_LIBSYNC_H_
-
-#include "sync_utils.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned long long atomic_ea_t;
-
-extern void atomic_set(atomic_ea_t v, int val);
-extern void atomic_add(int a, atomic_ea_t v);
-extern void atomic_sub(int a, atomic_ea_t v);
-extern void atomic_inc(atomic_ea_t v);
-extern void atomic_dec(atomic_ea_t v);
-
-extern int atomic_read(atomic_ea_t v);
-extern int atomic_add_return(int a, atomic_ea_t v);
-extern int atomic_sub_return(int a, atomic_ea_t v);
-extern int atomic_inc_return(atomic_ea_t v);
-extern int atomic_dec_return(atomic_ea_t v);
-extern int atomic_sub_and_test(int a, atomic_ea_t v);
-extern int atomic_dec_and_test(atomic_ea_t v);
-extern int atomic_dec_if_positive(atomic_ea_t v);
-
-typedef unsigned long long mutex_ea_t;
-void mutex_init(mutex_ea_t lock);
-
-void mutex_lock(mutex_ea_t lock);
-int mutex_trylock(mutex_ea_t ea);
-void mutex_unlock(mutex_ea_t lock);
-
-typedef struct
-{
- int num_threads_signal; /* the number of threads that are going to be waken up.
- There are 3 values possible for this parameter, 0, 1,
- or num_threads_waiting*/
- int num_threads_waiting; /* the number of threads that are waiting to be awaken */
-} condition_variable_t __attribute__ ((aligned (16)));
-
-typedef unsigned long long cond_ea_t; /* a system memory 64 bit address that points to
- * a valid condition_variable_t */
-
-typedef union {
- unsigned long long ull;
- unsigned int ui[2];
-} val64;
-
-
-void cond_init (cond_ea_t cond);
-void cond_signal (cond_ea_t cond);
-void cond_broadcast (cond_ea_t cond);
-void cond_wait (cond_ea_t cond, mutex_ea_t mutex);
-
-
-#define MAX_THREADS_WAITING 32000
-
-typedef unsigned long long completion_ea_t;
-
-extern void init_completion(completion_ea_t comp);
-extern void wait_for_completion(completion_ea_t comp);
-/*
-extern void wait_for_completion_irq(completion_ea_t comp);
-extern void wait_for_completion_irqsave(completion_ea_t comp);
-*/
-extern void complete_all(completion_ea_t comp);
-extern void complete (completion_ea_t comp);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _PPU_LIBSYNC_H_ */
diff --git a/gcell/ibm/sync/ppu_source/mutex.h b/gcell/ibm/sync/ppu_source/mutex.h
deleted file mode 100644
index 364bb2249..000000000
--- a/gcell/ibm/sync/ppu_source/mutex.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_MUTEX_H_
-#define _PPU_MUTEX_H_ 1
-
-typedef unsigned long long mutex_ea_t;
-
-#endif /* _PPU_MUTEX_H_ */
diff --git a/gcell/ibm/sync/ppu_source/mutex_init.h b/gcell/ibm/sync/ppu_source/mutex_init.h
deleted file mode 100644
index 105dc2c57..000000000
--- a/gcell/ibm/sync/ppu_source/mutex_init.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_MUTEX_INIT_H_
-#define _PPU_MUTEX_INIT_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include "trace_libsync.h"
-
-/***************************************************************************/
-/**
- * mutex_init - initialize the mutex by setting the value
- * to 0.
- * @lock: handle to effective address of lock variable.
- *
- * Description: Initialize a mutex.
- */
-static __inline void _mutex_init(mutex_ea_t lock)
-{
- volatile unsigned int *p;
-
- SYNC_ULL_TO_PTR(lock, p);
-
- *p = 0;
-
- TRACE_MUTEX_INIT(lock);
-}
-
-#endif /* _PPU_MUTEX_INIT_H_ */
diff --git a/gcell/ibm/sync/ppu_source/mutex_lock.h b/gcell/ibm/sync/ppu_source/mutex_lock.h
deleted file mode 100644
index 75240a141..000000000
--- a/gcell/ibm/sync/ppu_source/mutex_lock.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_MUTEX_LOCK_H_
-#define _PPU_MUTEX_LOCK_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "mutex.h"
-#include "trace_libsync.h"
-
-/* function: _mutex_lock
- *
- * Aquire a lock at a location in system memory by waiting for the
- * value to become zero, then atomically storing 1.
- */
-static __inline void _mutex_lock (mutex_ea_t lock)
-{
- unsigned int done = 0;
- void *p;
-#ifdef LIBSYNC_TRACE
- unsigned int miss = 0;
-#endif /* LIBSYNC_TRACE */
-
- TRACE_MUTEX_LOCK_ENTRY(interval);
-
- SYNC_ULL_TO_PTR(lock, p);
-
- do {
- if (__lwarx(p) == 0) done = __stwcx(p, (unsigned int) 1);
-#ifdef LIBSYNC_TRACE
- /* if we missed the lock, note it.. */
- if (done == 0) miss = 1;
-#endif
- } while (done == 0);
- __isync();
-
- TRACE_MUTEX_LOCK_EXIT(interval, lock, miss);
-}
-
-#endif /* _PPU_MUTEX_LOCK_H_ */
diff --git a/gcell/ibm/sync/ppu_source/mutex_trylock.h b/gcell/ibm/sync/ppu_source/mutex_trylock.h
deleted file mode 100644
index 445196c74..000000000
--- a/gcell/ibm/sync/ppu_source/mutex_trylock.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_MUTEX_TRYLOCK_H_
-#define _PPU_MUTEX_TRYLOCK_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "mutex.h"
-#include "trace_libsync.h"
-
-/**
- * mutex_trylock - acquire a lock, or return immediately.
- * @lock: handle to effective address of lock variable.
- *
- * Description: Acquire a lock, or return immediately
- * without polling for availability.
- *
- * Context: The application should not call this interface
- * from a tight loop!! Use spin_lock() instead.
- *
- * Attempt to immediately aquire a lock at a location in system memory,
- * and return 1 if the lock was aquired or 0 otherwise.
- */
-static __inline int _mutex_trylock (mutex_ea_t lock)
-{
- int val;
- int ret = 0;
- void *p;
-
- SYNC_ULL_TO_PTR(lock, p);
-
- do {
- val = (int)__lwarx(p);
- if (val) break;
- } while ((ret = __stwcx(p, (unsigned int)1)) == 0);
- __isync();
-
- TRACE_MUTEX_TRYLOCK(lock,ret);
-
- return (ret);
-}
-
-#endif /* _PPU_MUTEX_TRYLOCK_H_ */
diff --git a/gcell/ibm/sync/ppu_source/mutex_unlock.h b/gcell/ibm/sync/ppu_source/mutex_unlock.h
deleted file mode 100644
index e5255be02..000000000
--- a/gcell/ibm/sync/ppu_source/mutex_unlock.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_MUTEX_UNLOCK_H_
-#define _PPU_MUTEX_UNLOCK_H_
-
-#include "mutex.h"
-#include "atomic.h"
-#include "trace_libsync.h"
-
-/* function: _mutex_unlock
- *
- * Release a lock held at address 'lock' in system memory.
- * For the PU, this routine is the same _unlock, and is
- * provided here as a simple convenience for programmers
- * (to match the interfaces that are supported on the SPU).
- * All I need to do is a store since store is an atomic operation by itself
- */
-static __inline void _mutex_unlock (mutex_ea_t lock)
-{
- _atomic_replace ((atomic_ea_t)lock, 0);
-
- TRACE_MUTEX_UNLOCK(lock);
-}
-
-
-#endif /* _PPU_MUTEX_UNLOCK_H_ */
diff --git a/gcell/ibm/sync/ppu_source/pdt_libsync.xml b/gcell/ibm/sync/ppu_source/pdt_libsync.xml
deleted file mode 100644
index d9ea2ce9f..000000000
--- a/gcell/ibm/sync/ppu_source/pdt_libsync.xml
+++ /dev/null
@@ -1,184 +0,0 @@
-<pdtGroup name="LIBSYNC" id="0x03" version="3.0">
- <!-- PPE events -->
- <subGroup name="PPE_MUTEX" id="0xFE03">
- <recordType name="PPE_MUTEX_INIT" description="PPE: mutex lock init" id="0x0003" type="event">
- <include href="/usr/share/pdt/config/pdt_ppe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="empty3" description="empty slot 3" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- <recordType name="PPE_MUTEX_LOCK" description="PPE: acquire a mutex lock" id="0x0103" type="interval">
- <include href="/usr/share/pdt/config/pdt_ppe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="miss" description="Missed" type="int" toString="0x%x" visible="true"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- <recordType name="PPE_MUTEX_TRYLOCK" description="PPE: try to acquire a lock" id="0x0203" type="event">
- <include href="/usr/share/pdt/config/pdt_ppe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="ret" description="Try lock return code" type="int" toString="0x%x" visible="true"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- <recordType name="PPE_MUTEX_UNLOCK" description="PPE: unlock a mutex lock" id="0x0303" type="event">
- <include href="/usr/share/pdt/config/pdt_ppe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="empty3" description="empty slot 3" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- </subGroup>
- <!-- SPE events -->
- <subGroup name="SPE_MUTEX" id="0xFD03">
- <recordType name="SPE_MUTEX_INIT" description="SPE: mutex lock init" id="0x0403" type="event">
- <include href="/usr/share/pdt/config/pdt_spe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="empty3" description="empty slot 3" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- <recordType name="SPE_MUTEX_LOCK" description="SPE: acquire a mutex lock" id="0x0503" type="interval">
- <include href="/usr/share/pdt/config/pdt_spe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="miss" description="Missed" type="int" toString="0x%x" visible="true"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- <recordType name="SPE_MUTEX_TRYLOCK" description="SPE: try to acquire a mutex lock" id="0x0603" type="event">
- <include href="/usr/share/pdt/config/pdt_spe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="ret_val" description="Try lock return code" type="int" toString="0x%x" visible="true"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- <recordType name="SPE_MUTEX_UNLOCK" description="SPE: unlock a mutex lock" id="0x0703" type="event">
- <include href="/usr/share/pdt/config/pdt_spe_event_header.xml"/>
- <physicalField name="lock" description="Lock address" type="long" toString="0x%x" visible="true"/>
- <physicalField name="empty3" description="empty slot 3" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty4" description="empty slot 4" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty5" description="empty slot 5" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty6" description="empty slot 6" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty7" description="empty slot 7" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty8" description="empty slot 8" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty9" description="empty slot 9" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty10" description="empty slot 10" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty11" description="empty slot 11" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty12" description="empty slot 12" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty13" description="empty slot 13" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty14" description="empty slot 14" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty15" description="empty slot 15" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty16" description="empty slot 16" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty17" description="empty slot 17" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty18" description="empty slot 18" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty19" description="empty slot 19" type="int" toString="0x%x" visible="false"/>
- <physicalField name="empty20" description="empty slot 20" type="int" toString="0x%x" visible="false"/>
- </recordType>
- </subGroup>
-</pdtGroup>
diff --git a/gcell/ibm/sync/ppu_source/pdt_libsync_config.xml b/gcell/ibm/sync/ppu_source/pdt_libsync_config.xml
deleted file mode 100644
index a0b848d84..000000000
--- a/gcell/ibm/sync/ppu_source/pdt_libsync_config.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<pdt_configuration application_name="libsync" output_dir="." version="3.0">
- <groups>
- <group name="GENERAL" description="General event types" id="0x00">
- <view yStart="0.0" yEnd="0.2" color="0x0000FF"/>
- <include href="/usr/share/pdt/config/pdt_general.xml"/>
- </group>
- <group name="LIBSPE2" description="CBE libspe 2.0 event types" id="0x01">
- <view yStart="0.2" yEnd="0.4" color="0x00FFFF"/>
- <include href="/usr/share/pdt/config/pdt_libspe2.xml"/>
- </group>
- <group name="MFCIO" description="SPE MFCIO event types" id="0x02">
- <view yStart="0.4" yEnd="0.6" color="0x00FF80"/>
- <include href="/usr/share/pdt/config/pdt_mfcio.xml"/>
- </group>
- <group name="LIBSYNC" description="General event types" id="0x03">
- <view yStart="0.6" yEnd="0.8" color="0xFFFF00"/>
- <include href="/usr/share/pdt/config/pdt_libsync.xml"/>
- </group>
- </groups>
-<configuration name="CBE">
-<host name="none"/>
-<groupsControl>
- <group name="GENERAL" active="true">
- <profile active="false"/>
- <!-- The GENERAL group of events are always active-->
- </group>
- <group name="LIBSPE2" active="true">
- </group>
- <group name="LIBSYNC" active="true">
- <sub_group name="PPE_MUTEX" active="true">
- <event name="PPE_MUTEX_INIT" active="true"/>
- <event name="PPE_MUTEX_LOCK" active="true"/>
- <event name="PPE_MUTEX_TRYLOCK" active="true"/>
- <event name="PPE_MUTEX_UNLOCK" active="true"/>
- </sub_group>
- </group>
-</groupsControl>
-</configuration>
-<!-- -->
-<!-- SPEs configuration - this section is read with the CBE configuration -->
-<!-- -->
-<configuration name="SPE">
-<host name="CBE"/>
-<groupsControl>
- <group name="GENERAL" active="true">
- <profile active="false"/>
- <!-- The GENERAL group of events are always active-->
- </group>
- <group name="MFCIO" active="true">
- </group>
- <group name="LIBSYNC" active="true">
- <sub_group name="SPE_MUTEX" active="true">
- <event name="SPE_MUTEX_INIT" active="true"/>
- <event name="SPE_MUTEX_LOCK" active="true"/>
- <event name="SPE_MUTEX_TRYLOCK" active="true"/>
- <event name="SPE_MUTEX_UNLOCK" active="true"/>
- </sub_group>
- </group>
-</groupsControl>
-</configuration>
-</pdt_configuration>
diff --git a/gcell/ibm/sync/ppu_source/sync_utils.h b/gcell/ibm/sync/ppu_source/sync_utils.h
deleted file mode 100644
index c7120a3cc..000000000
--- a/gcell/ibm/sync/ppu_source/sync_utils.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _PPU_SYNC_UTILS_H_
-#define _PPU_SYNC_UTILS_H_ 1
-
-/* SYNC_ULL_TO_PTR - convert a 64-bit unsigned long long to a void
- * pointer.
- */
-#ifdef __powerpc64__
-
-#define SYNC_ULL_TO_PTR(_ull, _ptr) { \
- union { \
- void *ptr; \
- unsigned long long ull; \
- } _x; \
- \
- _x.ull = _ull; \
- _ptr = _x.ptr; \
-}
-
-#else
-
-#define SYNC_ULL_TO_PTR(_ull, _ptr) { \
- union { \
- void *ptr[2]; \
- unsigned long long ull; \
- } _x; \
- \
- _x.ull = _ull; \
- _ptr = _x.ptr[1]; \
-}
-
-#endif
-
-#endif /* _PPU_SYNC_UTILS_H_ */
diff --git a/gcell/ibm/sync/ppu_source/trace_libsync.h b/gcell/ibm/sync/ppu_source/trace_libsync.h
deleted file mode 100644
index 6d6f036e5..000000000
--- a/gcell/ibm/sync/ppu_source/trace_libsync.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2007 */
-/* International Business Machines Corporation */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef __LIBSYNC_PPU_TRACEHOOKS_H__
-#define __LIBSYNC_PPU_TRACEHOOKS_H__
-
-#ifdef LIBSYNC_TRACE
-
-#include <trace_events.h>
-
-/*
- * last parameter in the trace_even and trace_interval_entry call is
- * the stack level to report the PC in the trace record. so 0 means
- * the PC of the current frame, 1 means the PC of the caller, etc.
- * there's a dilemma here - these macros are included in the inline
- * _mutex calls which get called from the (created during build)
- * mutex functions in the mutex .c files. in that case, the level
- * should be 1 - we don't want the PC of where in the mutex function
- * the trace call is happening, we want the PC of whomever is calling
- * the mutex function.
- *
- * but.. an app can call the inline functions - it can #include the
- * appropriate libsync mutex .h files, and call the inlined _mutex
- * function in their code. in that case, the appropriate level for the
- * trace calls would be 0 - the user would want to know where in their
- * code the call to the _mutex function is.
- *
- * so, we'll assume _LEVEL of 0 which is what the inline funtions need.
- * when we build the files for libsync, we'll do a -D_LEVEL=1
- */
-#ifndef _LEVEL
-#define _LEVEL 0
-#endif
-
-
-#define TRACE_EVENT_MUTEX_INIT 0x0003
-
-#define TRACE_MUTEX_INIT(lock) { \
- trace_payload_t payload; \
- payload.dword[0]=(uint64_t)lock; \
- trace_event(TRACE_EVENT_MUTEX_INIT, 1, &payload, "Event=%d, lock=0x%x",_LEVEL); \
-}
-
-#define TRACE_EVENT_MUTEX_LOCK 0x0103
-
-#define TRACE_MUTEX_LOCK_ENTRY(_INTERVAL) \
-trace_interval_p _INTERVAL = trace_interval_entry(TRACE_EVENT_MUTEX_LOCK, _LEVEL)
-
-#define TRACE_MUTEX_LOCK_EXIT(_INTERVAL,lock,miss) { \
- trace_payload_t payload; \
- payload.dword[0]=(uint64_t)lock; \
- payload.word[2]=(uint32_t)miss; \
- trace_interval_exit(_INTERVAL, 2, &payload, "Event=%d, lock=0x%x, miss=0x%x"); \
-}
-
-#define TRACE_EVENT_MUTEX_TRYLOCK 0x0203
-
-#define TRACE_MUTEX_TRYLOCK(lock,ret) { \
- trace_payload_t payload; \
- payload.dword[0]=(uint64_t)lock; \
- payload.word[2]=(uint32_t)ret; \
- trace_event(TRACE_EVENT_MUTEX_TRYLOCK, 2, &payload, "Event=%d, lock=0x%x, ret=0x%x", _LEVEL); \
-}
-
-#define TRACE_EVENT_MUTEX_UNLOCK 0x0303
-
-#define TRACE_MUTEX_UNLOCK(lock) { \
- trace_payload_t payload; \
- payload.dword[0]=(uint64_t)lock; \
- trace_event(TRACE_EVENT_MUTEX_UNLOCK, 1, &payload, "Event=%d, lock=0x%x", _LEVEL); \
-}
-
-#else /* LIBSYNC_TRACE */
-
-#define TRACE_MUTEX_INIT(lock)
-#define TRACE_MUTEX_LOCK_ENTRY(_INTERVAL)
-#define TRACE_MUTEX_LOCK_EXIT(_INTERVAL,lock,miss)
-#define TRACE_MUTEX_TRYLOCK(lock,ret_val)
-#define TRACE_MUTEX_UNLOCK(lock)
-
-#endif /* LIBSYNC_TRACE */
-
-#endif /* __LIBSYNC_PPU_TRACEHOOKS_H__ */
diff --git a/gcell/ibm/sync/ppu_source/wait_for_completion.h b/gcell/ibm/sync/ppu_source/wait_for_completion.h
deleted file mode 100644
index f2b04275a..000000000
--- a/gcell/ibm/sync/ppu_source/wait_for_completion.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-
-#ifndef _PPU_WAIT_FOR_COMPLETION_H_
-#define _PPU_WAIT_FOR_COMPLETION_H_
-
-#include <ppu_intrinsics.h>
-#include "sync_utils.h"
-#include "completion.h"
-
-
-/**
- * completion_wait - wait until a completion is broadcast.
- * @comp: handle to effective address of completion variable.
- *
- * Description: Wait until another processor or device signals
- * that a completionition is 'true'. The only restriction here is
- * that @comp must be a word aligned address.
- *
- * Beware: This function hot polls waiting for completion.
- */
-static __inline void _wait_for_completion(completion_ea_t comp)
-{
- int val;
- void *p;
-
- SYNC_ULL_TO_PTR(comp, p);
-
- do {
- val = (int)__lwarx(p);
- if (val != 1) val = (int)__stwcx(p, (unsigned int)0);
- } while (val == 0);
- __isync();
-}
-
-
-#endif /* _PPU_WAIT_FOR_COMPLETION_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic.h b/gcell/ibm/sync/spu_source/atomic.h
deleted file mode 100644
index 951c26e3f..000000000
--- a/gcell/ibm/sync/spu_source/atomic.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-/*
- * atomic.h - SPU atomic SHM counter operations.
- *
- * Interfaces patterned after, and hopefully compatible
- * with PowerPC64-Linux atomic counter operations. Uses
- * 32b values for various counters.
- */
-#ifndef _SPU_ATOMIC_H_
-#define _SPU_ATOMIC_H_
-
-#include <sync_utils.h>
-#include <spu_mfcio.h>
-
-
-/* atomic_eaddr_t is a 64bit effective address
- * that points to an atomic_t variable */
-typedef unsigned long long atomic_ea_t;
-
-#define DECL_ATOMIC_VARS() \
- char _tmp[256]; \
- char *tmp = (char *) ALIGN(_tmp, 128); \
- volatile s32 *buf = (volatile s32 *) &tmp[0]; \
- u32 size = 128, tagid = 0; \
- s32 ret_val; \
- u32 offset; \
- addr64 ea64
-
-/* __atomic_op
-* Internal routine to acquire lock line reservation
-* then conditionally modify the counter variable
-* pointed to by 'v'. The 'replace' flag indicates
-* whether or not this is to be an arithmetic R-M-W
-* or a simple replace operation.
-*/
-#define ATOMIC_OP(__v, __val, __replace, __final_val) \
-{ \
- char __tmp[256]; \
- char *_tmp = (char *) ALIGN(__tmp, 128); \
- volatile s32 *_buf = (volatile s32 *) &_tmp[0]; \
- u32 _size = 128, _tagid = 0; \
- s32 _status, _ret_val; \
- u32 _offset; \
- addr64 _ea64; \
- \
- _ea64.ull = ALIGN128_EA(__v); \
- _offset = OFFSET128_EA_U32(__v); \
- do { \
- MFC_DMA(_buf, _ea64, _size, _tagid, MFC_GETLLAR_CMD); \
- spu_readch (MFC_RdAtomicStat); \
- \
- _ret_val = _buf[_offset]; \
- _buf[_offset] = (__replace) ? __val : _ret_val + __val; \
- MFC_DMA(_buf, _ea64, _size, _tagid, MFC_PUTLLC_CMD); \
- _status = spu_readch(MFC_RdAtomicStat); \
- } while (_status != 0); \
- \
- __final_val = _ret_val; \
-}
-
-#endif /* _SPU_ATOMIC_H_ */
-
diff --git a/gcell/ibm/sync/spu_source/atomic_add.h b/gcell/ibm/sync/spu_source/atomic_add.h
deleted file mode 100644
index 7606ae05b..000000000
--- a/gcell/ibm/sync/spu_source/atomic_add.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_ADD_H_
-#define _SPU_ATOMIC_ADD_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_add - atomically add to a counter.
- * @v: handle to effective address of counter.
- * @a: value to be added.
- *
- * Atomically add a value to a counter in system memory.
- * The only restriction is that @v must be word aligned.
- */
-static __inline void _atomic_add(int a, atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP (v, a, 0, ret_val);
-}
-
-
-#endif /* _SPU_ATOMIC_ADD_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_add_return.h b/gcell/ibm/sync/spu_source/atomic_add_return.h
deleted file mode 100644
index 35f07adf6..000000000
--- a/gcell/ibm/sync/spu_source/atomic_add_return.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_ADD_RETURN_H_
-#define _SPU_ATOMIC_ADD_RETURN_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-/**
- * atomic_add_return - atomically add to a counter and return previous value.
- * @v: handle to effective address of counter.
- * @a: value to be added.
- *
- * Atomically add a value to a counter in system memory.
- * The only restriction is that @v must be word aligned.
- *
- * This routine implements the "fetch and add" primitive
- * that is described in "Book I PowerPC User Instruction
- * Set Architecture", but uses MFC lock line reservation
- * operations instead of lwarx/stwcx.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_add_return(int a, atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP(v, a, 0, ret_val);
- return ret_val;
-}
-
-
-#endif /* _SPU_ATOMIC_ADD_RETURN_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_dec.h b/gcell/ibm/sync/spu_source/atomic_dec.h
deleted file mode 100644
index 30ca7c514..000000000
--- a/gcell/ibm/sync/spu_source/atomic_dec.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_DEC_H_
-#define _SPU_ATOMIC_DEC_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_dec - atomically decrement a counter.
- * @v: handle to effective address of location to be modified.
- *
- * Atomically decrement a counter in system memory. The only
- * restriction is that @v must be word aligned.
- */
-static __inline void _atomic_dec(atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP (v, -1, 0, ret_val);
-}
-
-
-#endif /* _SPU_ATOMIC_DEC_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_dec_and_test.h b/gcell/ibm/sync/spu_source/atomic_dec_and_test.h
deleted file mode 100644
index b3c829820..000000000
--- a/gcell/ibm/sync/spu_source/atomic_dec_and_test.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_DEC_AND_TEST_H_
-#define _SPU_ATOMIC_DEC_AND_TEST_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_dec_and_test - atomically decrement and test if previous==0.
- * @v: handle to effective address of counter.
- *
- * Atomically decrement a counter in system memory and test
- * if previous==0. The only restriction is that @v must be
- * word aligned.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_dec_and_test(atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP(v, -1, 0, ret_val);
- return (ret_val == 0) ? 1 : 0;
-}
-
-#endif /* _SPU_ATOMIC_DEC_AND_TEST_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_dec_if_positive.h b/gcell/ibm/sync/spu_source/atomic_dec_if_positive.h
deleted file mode 100644
index 2a01ec307..000000000
--- a/gcell/ibm/sync/spu_source/atomic_dec_if_positive.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_DEC_IF_POSITIVE_H_
-#define _SPU_ATOMIC_DEC_IF_POSITIVE_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_dec_if_positive - atomically decrement if counter is positive.
- * @v: handle to effective address of counter.
- *
- * Atomically decrement a counter if its value is positive.
- * The only restriction is that @v must be word aligned.
- *
-*
- * Returns the old value of the counter, minus 1.
- */
-static __inline int _atomic_dec_if_positive(atomic_ea_t v)
-{
- DECL_ATOMIC_VARS();
- s32 status;
-
- ea64.ull = ALIGN128_EA(v);
- offset = OFFSET128_EA_U32(v);
- do {
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
-
- ret_val = buf[offset] - 1;
- if (likely(ret_val >= 0)) {
- buf[offset] = ret_val;
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);
- status = spu_readch(MFC_RdAtomicStat);
- } else {
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);
- spu_readch(MFC_RdAtomicStat);
- status = 0;
- break;
- }
- } while (status != 0);
-
- return ret_val;
-}
-
-
-
-#endif /* _SPU_ATOMIC_DEC_IF_POSITIVE_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_dec_return.h b/gcell/ibm/sync/spu_source/atomic_dec_return.h
deleted file mode 100644
index 45effb689..000000000
--- a/gcell/ibm/sync/spu_source/atomic_dec_return.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_DEC_RETURN_H_
-#define _SPU_ATOMIC_DEC_RETURN_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_dec_return - atomically decrement a counter and return previous value.
- * @v: handle to effective address of counter.
- *
- * Atomically decrement a counter in system memory and return its
- * previous value. The only restriction is that @v must be word
- * aligned.
- *
- * This routine implements the "fetch and decrement"
- * primitive that is described in "Book I PowerPC User
- * Instruction Set Architecture", but uses MFC lock line
- * reservation operations instead of lwarx/stwcx.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_dec_return(atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP(v, -1, 0, ret_val);
- return ret_val;
-}
-
-
-#endif /* _SPU_ATOMIC_DEC_RETURN_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_inc.h b/gcell/ibm/sync/spu_source/atomic_inc.h
deleted file mode 100644
index 6800efea3..000000000
--- a/gcell/ibm/sync/spu_source/atomic_inc.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_INC_H_
-#define _SPU_ATOMIC_INC_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_inc - atomically increment a counter in system memory.
- * @v: handle to effective address of counter.
- *
- * Atomically increment a counter in system memory.
- * The only restriction is that @v must be word aligned.
- */
-static __inline void _atomic_inc(atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP (v, 1, 0, ret_val);
-}
-
-
-#endif /* _SPU_ATOMIC_INC_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_inc_return.h b/gcell/ibm/sync/spu_source/atomic_inc_return.h
deleted file mode 100644
index 89361a0a1..000000000
--- a/gcell/ibm/sync/spu_source/atomic_inc_return.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_INC_RETURN_H_
-#define _SPU_ATOMIC_INC_RETURN_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-
-/**
- * atomic_inc_return - atomically increment a counter and return previous.
- * @v: handle to effective address of counter.
- *
- * Atomically increment a counter in system memory.
- * The only restriction is that @v must be word aligned.
- *
- * This routine implements the "fetch and increment"
- * primitive that is described in "Book I PowerPC User
- * Instruction Set Architecture", but uses MFC lock line
- * reservation operations instead of lwarx/stwcx.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_inc_return(atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP(v, 1, 0, ret_val);
- return ret_val;
-}
-
-
-#endif /* _SPU_ATOMIC_INC_RETURN_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_read.h b/gcell/ibm/sync/spu_source/atomic_read.h
deleted file mode 100644
index 711a0ad26..000000000
--- a/gcell/ibm/sync/spu_source/atomic_read.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_READ_H_
-#define _SPU_ATOMIC_READ_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_read - read an atomic counter.
- * @v: handle to effective address of counter.
- *
- * Read the current value of an atomic counter.
- */
-static __inline int _atomic_read(atomic_ea_t v)
-{
- DECL_ATOMIC_VARS();
-
- /* reserve a tag for use */
- tagid = mfc_tag_reserve();
-
- u32 oldtmask, tagmask = 1 << (tagid & 31);
-
- ea64.ull = ALIGN128_EA(v);
- offset = OFFSET128_EA_U32(v);
-
- MFC_DMA(buf, ea64, size, tagid & 31, MFC_GET_CMD);
- oldtmask = spu_readch(MFC_RdTagMask);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
- spu_writech(MFC_WrTagMask, oldtmask);
-
- mfc_tag_release (tagid);
- ret_val = buf[offset];
- return ret_val;
-}
-
-
-#endif /* _SPU_ATOMIC_READ_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_set.h b/gcell/ibm/sync/spu_source/atomic_set.h
deleted file mode 100644
index 261d28a3d..000000000
--- a/gcell/ibm/sync/spu_source/atomic_set.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_SET_H_
-#define _SPU_ATOMIC_SET_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_set - atomically set a counter in system memory.
- * @v: handle to effective address of counter.
- *
- * Atomically set a counter to a given value. The only
- * restriction is that @v must be word aligned.
- *
- * This routine implements the "fetch and store"
- * primitive that is described in "Book I PowerPC User
- * Instruction Set Architecture", but uses MFC lock line
- * reservation operations instead of lwarx/stwcx.
- *
- * Returns the previous value from system memory.
- */
-static __inline void _atomic_set(atomic_ea_t v, int val)
-{
- int ret_val;
- ATOMIC_OP(v, val, 1, ret_val);
-}
-
-
-#endif /* _SPU_ATOMIC_SET_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_sub.h b/gcell/ibm/sync/spu_source/atomic_sub.h
deleted file mode 100644
index f366e1dee..000000000
--- a/gcell/ibm/sync/spu_source/atomic_sub.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_SUB_H_
-#define _SPU_ATOMIC_SUB_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_sub - atomically subtract from a counter.
- * @v: handle to effective address of counter.
- * @a: value to be subtracted.
- *
- * Atomically subtract a value from a counter in system memory.
- * The only restriction is that @v must be word aligned.
- */
-static __inline void _atomic_sub(int a, atomic_ea_t v)
-{
- int ret_val;
-
- ATOMIC_OP (v, -a, 0, ret_val);
-}
-
-
-
-#endif /* _SPU_ATOMIC_SUB_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_sub_and_test.h b/gcell/ibm/sync/spu_source/atomic_sub_and_test.h
deleted file mode 100644
index fe5824a43..000000000
--- a/gcell/ibm/sync/spu_source/atomic_sub_and_test.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_SUB_AND_TEST_H_
-#define _SPU_ATOMIC_SUB_AND_TEST_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-/**
- * atomic_sub_and_test - atomically subtract and test if previous==0.
- * @v: handle to effective address of counter.
- * @a: value to be subtracted.
- *
- * Atomically subtract a value from a counter in system memory
- * and test if previous==0. The only restriction is that @v
- * must be word aligned.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_sub_and_test(int a, atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP(v, -a, 0, ret_val);
- return (ret_val == 0) ? 1 : 0;
-}
-
-
-#endif /* _SPU_ATOMIC_SUB_AND_TEST_H_ */
diff --git a/gcell/ibm/sync/spu_source/atomic_sub_return.h b/gcell/ibm/sync/spu_source/atomic_sub_return.h
deleted file mode 100644
index 5dbed5b85..000000000
--- a/gcell/ibm/sync/spu_source/atomic_sub_return.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_ATOMIC_SUB_RETURN_H_
-#define _SPU_ATOMIC_SUB_RETURN_H_
-
-#include <sync_utils.h>
-#include <atomic.h>
-
-
-/**
- * atomic_sub_return - atomically subtract from a counter & return previous.
- * @v: handle to effective address of counter.
- * @a: value to be subtracted.
- *
- * Atomically subtract a value from a counter in system memory.
- * The only restriction is that @v must be word aligned.
- *
- * Returns the previous value from system memory.
- */
-static __inline int _atomic_sub_return(int a, atomic_ea_t v)
-{
- int ret_val;
- ATOMIC_OP(v, -a, 0, ret_val);
- return ret_val;
- //return __atomic_op(v, -a, 0);
-}
-
-
-
-
-#endif /* _SPU_ATOMIC_SUB_RETURN_H_ */
diff --git a/gcell/ibm/sync/spu_source/complete.h b/gcell/ibm/sync/spu_source/complete.h
deleted file mode 100644
index 6a7808650..000000000
--- a/gcell/ibm/sync/spu_source/complete.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COMPLETE_H_
-#define _SPU_COMPLETE_H_
-
-#include "sync_utils.h"
-#include <spu_mfcio.h>
-#include "completion.h"
-
-static __inline void _complete(completion_ea_t completion)
-{
- DECL_COMPLETION_VARS();
-
- ea64.ull = ALIGN128_EA(completion);
- offset = OFFSET128_EA_U32(completion);
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
-
- /* set the completionition variable to exactly one so
- * only one thread can be awaken */
- buf[offset] = 1;
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLUC_CMD);
- spu_readch(MFC_RdAtomicStat);
-}
-
-
-
-
-#endif /* _SPU_COMPLETE_H_ */
diff --git a/gcell/ibm/sync/spu_source/complete_all.h b/gcell/ibm/sync/spu_source/complete_all.h
deleted file mode 100644
index 5f9c3dcfa..000000000
--- a/gcell/ibm/sync/spu_source/complete_all.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COMPLETE_ALL_H_
-#define _SPU_COMPLETE_ALL_H_
-
-#include "sync_utils.h"
-#include <spu_mfcio.h>
-#include "completion.h"
-
-/**
- * completion_broadcast - indicate that a completion is true.
- * @completion: handle to effective address of completion variable.
- *
- * Indicate that a completionition is true by storing '1' to the
- * completionition variable.
- */
-static __inline void _complete_all(completion_ea_t completion)
-{
- DECL_COMPLETION_VARS();
-
- ea64.ull = ALIGN128_EA(completion);
- offset = OFFSET128_EA_U32(completion);
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
-
- /* set the completionition variable to the count. So that
- * all the threads */
- buf[offset] = MAX_THREADS_WAITING;
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLUC_CMD);
- spu_readch(MFC_RdAtomicStat);
-}
-
-
-
-
-#endif /* _SPU_COMPLETE_ALL_H_ */
diff --git a/gcell/ibm/sync/spu_source/completion.h b/gcell/ibm/sync/spu_source/completion.h
deleted file mode 100644
index 4a302d25c..000000000
--- a/gcell/ibm/sync/spu_source/completion.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-/*
- * cond.h - simple condition wait & broadcast operations.
- *
- * Interrupt aware versions of the routines are supported.
- * Applications should call either '_irq' or '_irqsave'
- * forms of the functions when interrupts are enabled.
- */
-
-#ifndef __SPU_COMPLETION_H__
-#define __SPU_COMPLETION_H__
-
-#include "sync_utils.h"
-
-#define MAX_THREADS_WAITING 32000
-typedef unsigned long long completion_ea_t;
-
-
-#define DECL_COMPLETION_VARS() \
- char _tmp[256]; \
- char *tmp = (char *) ALIGN(_tmp, 128); \
- volatile s32 *buf = (volatile s32 *) &tmp[0]; \
- u32 size = 128, tagid = 0; \
- u32 offset; \
- addr64 ea64
-
-
-
-#endif /* __SPU_COMPLETION_H__ */
diff --git a/gcell/ibm/sync/spu_source/cond.h b/gcell/ibm/sync/spu_source/cond.h
deleted file mode 100644
index ceb3285d9..000000000
--- a/gcell/ibm/sync/spu_source/cond.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COND_VAR_H_
-#define _SPU_COND_VAR_H_
-
-#include "sync_utils.h"
-typedef struct
-{
- int num_threads_signal; /* the number of threads that are going to be waken up.
- There are 3 values possible for this parameter, 0, 1,
- or num_threads_waiting*/
- int num_threads_waiting; /* the number of threads that are waiting to be awaken */
-} condition_variable_t __attribute__ ((aligned (128)));
-
-typedef eaddr_t cond_ea_t; /* a system memory 64 bit address that points to
- * a valid condition_variable_t */
-
-
-
-
-#define DECL_COND_VARS() \
- char _tmp[256]; \
- char *tmp = (char *) ALIGN(_tmp, 128); \
- volatile s32 *buf = (volatile s32 *) &tmp[0]; \
- u32 size = 128, tagid = 0; \
- s32 status, ret_val; \
- u32 offset; \
- addr64 ea64; \
- condition_variable_t cond_var
-
-#endif /* _SPU_COND_VAR_H_ */
diff --git a/gcell/ibm/sync/spu_source/cond_broadcast.h b/gcell/ibm/sync/spu_source/cond_broadcast.h
deleted file mode 100644
index 15a1da330..000000000
--- a/gcell/ibm/sync/spu_source/cond_broadcast.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COND_BROADCAST_H_
-#define _SPU_COND_BROADCAST_H_
-
-#include "sync_utils.h"
-#include "cond.h"
-#include <spu_mfcio.h>
-
-/**
- * cond_broadcast - indicate that a condition is true.
- * @cond: handle to effective address of condition variable.
- */
-static __inline void _cond_broadcast(cond_ea_t cond)
-{
- char _tmp[256];
- char *tmp = (char *) ALIGN(_tmp, 128);
- volatile unsigned short *buf = (volatile unsigned short *) &tmp[0];
- unsigned int size = 128, tagid = 0;
- u32 offset;
- addr64 ea64;
-
- ea64.ull = ALIGN128_EA(cond);
- offset = OFFSET128_EA_U16(cond);
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
-
- /* set the condition variable to the count. So that
- * all the threads */
- buf[offset] = buf[offset + 1];
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLUC_CMD);
- spu_readch(MFC_RdAtomicStat);
-}
-
-#endif /* _SPU_COND_BROADCAST_H_ */
diff --git a/gcell/ibm/sync/spu_source/cond_init.h b/gcell/ibm/sync/spu_source/cond_init.h
deleted file mode 100644
index 7202e5352..000000000
--- a/gcell/ibm/sync/spu_source/cond_init.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COND_INIT_H_
-#define _SPU_COND_INIT_H_
-
-#include "sync_utils.h"
-#include "cond.h"
-#include <spu_mfcio.h>
-
-
-/**
- * cond_init - initialize condition variable.
- * @cond: handle to effective address of condition variable.
- *
- *
- * Conditional Variable - is a synchronization device that allows
- * SPE and PPE threads to suspend execution and relinquish the
- * processors until some predicate on shared data is satisfied.
- * The basic operations on conditions are: signal the condition
- * (when the predicate becomes true), and wait for the condition,
- * suspending the thread execution until anoter thread signals the
- * condition
- *
- * A condition variable must always be associated with a mutex, to
- * avoid the race condition where a thread prepares to wait on a
- * condition variable and another thread signals the condition just
- * before the first thread actually waits on it.
- *
- * cond_init initializes the condition variable cond.
- *
- * cond_signal restarts one of the threads that are waiting on the
- * condition variable cond. If no threads are waiting on cond, nothing
- * happens. If several threads are waiting on cond, exactly one
- * is restarted, but it is not specified which
- *
- * cond_broadcast restarts all the threads that are waiting on the
- * condition variable cond. Nothing happens if no threads are waiting
- * on cond
- *
- * cond_wait atomically unlocks the mutex and waits for the condition
- * variable cond to be signaled. The mutex must be lock locked by
- * the calling thread on the entrance to cond_wait. Before returning
- * to the calling thread, cond_wait re-acquires mutex.
- *
- * Only one thread initializes a condition variable. Usually, the
- * PPE thread initializes a condidtion variable, however, a cond_init
- * function is provided here for completeness
- *
- * Description: Initialize a cond variable to false.
- */
-static __inline void _cond_init(cond_ea_t cond )
-{
- char _tmp[256];
- char *tmp = (char *) ALIGN(_tmp, 128);
- volatile unsigned short *buf = (volatile unsigned short *) &tmp[0];
- unsigned int size = 128, tagid;
- unsigned int offset;
- addr64 ea64;
- unsigned int oldtmask;
- unsigned int tagmask;
-
- tagid = mfc_tag_reserve();
-
- tagmask = 1 << (tagid & 31);
-
- ea64.ull = ALIGN128_EA(cond);
- offset = OFFSET128_EA_U16(cond);
-
- MFC_DMA(buf, ea64, size, tagid & 31, MFC_GET_CMD);
- oldtmask = spu_readch(MFC_RdTagMask);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
-
- /* this is still just one word. since buf is of type
- * short, we fit both counts into one word. */
- buf[offset] = 0;
- buf[offset+1] = 0;
- MFC_DMA(buf, ea64, size, (tagid & 31), MFC_PUT_CMD);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
- spu_writech(MFC_WrTagMask, oldtmask);
- mfc_tag_release (tagid);
-}
-
-
-
-#endif /* _SPU_COND_INIT_H_ */
diff --git a/gcell/ibm/sync/spu_source/cond_signal.h b/gcell/ibm/sync/spu_source/cond_signal.h
deleted file mode 100644
index a035d2875..000000000
--- a/gcell/ibm/sync/spu_source/cond_signal.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COND_SIGNAL_H_
-#define _SPU_COND_SIGNAL_H_
-#include <stdio.h>
-#include "sync_utils.h"
-#include "cond.h"
-#include "atomic.h"
-#include <spu_mfcio.h>
-
-/*
- * _cond_signal: signalling any of the waiting threads to wake up.
- */
-static __inline void _cond_signal(cond_ea_t cond)
-{
- char _tmp[256];
- char *tmp = (char *) ALIGN(_tmp, 128);
- volatile unsigned short *buf = (volatile unsigned short *) &tmp[0];
- unsigned int size = 128, tagid = 0;
- u32 offset;
- addr64 ea64;
- int status;
-
- ea64.ull = ALIGN128_EA(cond);
- offset = OFFSET128_EA_U16(cond);
-
- do {
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- (void)spu_readch(MFC_RdAtomicStat);
-
- /* Check for waiting threads.
- */
- if (buf[offset] != buf[offset+1]) {
- /* Increment the signaled count to release the next waiting
- * thread.
- */
- buf[offset]++;
-
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);
- status = spu_readch(MFC_RdAtomicStat);
- } else {
- /* Nobody is waiting, do nothing.
- */
- status = 0;
- }
- } while (status);
-}
-
-
-#endif /* _SPU_COND_SIGNAL_H_ */
diff --git a/gcell/ibm/sync/spu_source/cond_wait.h b/gcell/ibm/sync/spu_source/cond_wait.h
deleted file mode 100644
index cf4b880f5..000000000
--- a/gcell/ibm/sync/spu_source/cond_wait.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_COND_WAIT_H_
-#define _SPU_COND_WAIT_H_
-#include <stdio.h>
-#include "sync_irq.h"
-#include "sync_utils.h"
-#include "mutex_lock.h"
-#include "mutex_unlock.h"
-#include "cond.h"
-#include <spu_mfcio.h>
-
-static __inline void _cond_wait (cond_ea_t cond, mutex_ea_t mutex)
-{
- char _tmp[256];
- char *tmp = (char *) ALIGN(_tmp, 128);
- volatile signed short *buf = (volatile signed short *) &tmp[0];
- unsigned int size = 128, tagid = 0;
- int status;
- unsigned int offset;
- addr64 ea64;
- signed short delta, cur_delta, signaled_cnt;
-
- ea64.ull = ALIGN128_EA(cond);
- offset = OFFSET128_EA_U16(cond);
-
- /* increment the waiting halfword of the condition variable.
- */
- do {
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- (void)spu_readch(MFC_RdAtomicStat);
-
- buf[offset+1]++;
-
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);
- status = spu_readch(MFC_RdAtomicStat);
- } while (status);
-
- _mutex_unlock(mutex);
-
- /* keep track of the change in count needed to be signaled. This
- * is delta.
- */
- signaled_cnt = buf[offset];
- delta = buf[offset+1] - signaled_cnt;
- if (delta < 0) delta = -delta;
-
- while (1) {
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- (void)spu_readch(MFC_RdAtomicStat);
-
- cur_delta = buf[offset] - signaled_cnt;
- if (cur_delta < 0) cur_delta = -cur_delta;
-
-
- if (cur_delta >= delta) {
- /* the counts indicate that this thread has been signaled.
- */
- break;
- }
- }
- _mutex_lock (mutex);
-}
-
-#endif /* _SPU_COND_WAIT_H_ */
diff --git a/gcell/ibm/sync/spu_source/init_completion.h b/gcell/ibm/sync/spu_source/init_completion.h
deleted file mode 100644
index bf93e72af..000000000
--- a/gcell/ibm/sync/spu_source/init_completion.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_INIT_COMPLETION_H_
-#define _SPU_INIT_COMPLETION_H_
-
-#include "sync_utils.h"
-#include <spu_mfcio.h>
-#include "completion.h"
-
-/**
- * completion_init - initialize completion variable.
- * @completion: handle to effective address of completion variable.
- *
- * Description: Initialize a completion variable to false.
- */
-static __inline void _init_completion(completion_ea_t completion)
-{
- DECL_COMPLETION_VARS();
- u32 oldtmask, tagmask;
-
- tagid = mfc_tag_reserve();
- tagmask = 1 << (tagid & 31);
-
- ea64.ull = ALIGN128_EA(completion);
- offset = OFFSET128_EA_U32(completion);
-
- MFC_DMA(buf, ea64, size, tagid & 31, MFC_GET_CMD);
- oldtmask = spu_readch(MFC_RdTagMask);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
-
- buf[offset] = 0;
- MFC_DMA(buf, ea64, size, tagid & 31, MFC_PUT_CMD);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
- spu_writech(MFC_WrTagMask, oldtmask);
- mfc_tag_release(tagid);
-}
-
-
-
-#endif /* _SPU_INIT_COMPLETION_H_ */
diff --git a/gcell/ibm/sync/spu_source/libsync.h b/gcell/ibm/sync/spu_source/libsync.h
deleted file mode 100644
index 48cc722bd..000000000
--- a/gcell/ibm/sync/spu_source/libsync.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_LIB_SYNC_H_
-#define _SPU_LIB_SYNC_H_
-#include "sync_utils.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned long long atomic_ea_t;
-
-extern void atomic_set(atomic_ea_t v, int val);
-extern void atomic_add(int a, atomic_ea_t v);
-extern void atomic_sub(int a, atomic_ea_t v);
-extern void atomic_inc(atomic_ea_t v);
-extern void atomic_dec(atomic_ea_t v);
-
-extern int atomic_read(atomic_ea_t v);
-extern int atomic_add_return(int a, atomic_ea_t v);
-extern int atomic_sub_return(int a, atomic_ea_t v);
-extern int atomic_inc_return(atomic_ea_t v);
-extern int atomic_dec_return(atomic_ea_t v);
-extern int atomic_sub_and_test(int a, atomic_ea_t v);
-extern int atomic_dec_and_test(atomic_ea_t v);
-extern int atomic_dec_if_positive(atomic_ea_t v);
-
-typedef unsigned long long mutex_ea_t;
-
-extern void mutex_init(mutex_ea_t lock);
-extern void mutex_lock(mutex_ea_t lock);
-extern int mutex_trylock(mutex_ea_t ea);
-extern void mutex_unlock(mutex_ea_t lock);
-
-
-typedef struct
-{
- int num_threads_signal; /* the number of threads that are going to be waken up.
- * There are 3 values possible for this parameter, 0, 1,
- * or num_threads_waiting
- */
- int num_threads_waiting; /* the number of threads that are waiting to be awaken
- */
-} condition_variable_t __attribute__ ((aligned (128)));
-
-typedef eaddr_t cond_ea_t; /* a system memory 64 bit address that points to
- * a valid condition_variable_t
- */
-
-
-extern void cond_init (cond_ea_t cond);
-extern void cond_signal (cond_ea_t cond);
-extern void cond_broadcast (cond_ea_t cond);
-extern void cond_wait (cond_ea_t cond, mutex_ea_t mutex);
-
-typedef unsigned long long completion_ea_t;
-
-extern void init_completion(completion_ea_t completion);
-extern void wait_for_completion(completion_ea_t completion);
-extern void complete(completion_ea_t completion);
-extern void complete_all(completion_ea_t completion);
-
-#ifdef __SPU__
- /* Function only implemented for the SPU
- */
- extern void read_lock(eaddr_t ea);
- extern void read_unlock(eaddr_t ea);
- extern int read_trylock(eaddr_t ea);
- extern void write_lock(eaddr_t ea);
- extern void write_unlock(eaddr_t ea);
- extern int write_trylock(eaddr_t ea);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SPU_LIB_SYNC_H_ */
diff --git a/gcell/ibm/sync/spu_source/mutex.h b/gcell/ibm/sync/spu_source/mutex.h
deleted file mode 100644
index 37f2b4d62..000000000
--- a/gcell/ibm/sync/spu_source/mutex.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_MUTEX_H_
-#define _SPU_MUTEX_H_ 1
-
-#include "sync_utils.h"
-#include "sync_irq.h"
-#include <spu_mfcio.h>
-
-typedef eaddr_t mutex_ea_t;
-
-#define DECL_MUTEX_VARS() \
- char _tmp[256]; \
- char *tmp = (char *) ALIGN(_tmp, 128); \
- volatile s32 *buf = (volatile s32 *) &tmp[0]; \
- u32 size = 128, tagid = 0; \
- u32 offset; \
- addr64 ea64
-
-/* RAW_TEST_AND_SET
- * Macro implementing the test and set primitive.
- *
- * RAW_TEST_AND_SET(==, 1) used by spin_try_lock()
- * RAW_TEST_AND_SET(>=, 1) used by read_try_lock()
- * RAW_TEST_AND_SET(==, -1) used by write_try_lock()
- */
-#define RAW_TEST_AND_SET(_RELOP_, _val) \
- ea64.ull = ALIGN128_EA(ea); \
- offset = OFFSET128_EA_U32(ea); \
- do { \
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD); \
- spu_readch(MFC_RdAtomicStat); \
- SET_HIT; \
- if (likely(buf[offset] _RELOP_ 0)) { \
- buf[offset] += _val; \
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD); \
- status = spu_readch(MFC_RdAtomicStat); \
- ret_val = 1; \
- } else { \
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD); \
- spu_readch(MFC_RdAtomicStat); \
- status = ret_val = 0; \
- break; \
- } \
- } while (status != 0)
-
-/* RAW_SPINLOCK
- * Macro implementing the spinlock primitive.
- *
- * RAW_SPINLOCK(==, 1) used by spin_lock()
- * RAW_SPINLOCK(>=, 1) used by read_lock()
- * RAW_SPINLOCK(==, -1) used by write_lock()
- */
-
-
-#define RAW_SPINLOCK(_RELOP_, _val) \
- ea64.ull = ALIGN128_EA(ea); \
- offset = OFFSET128_EA_U32(ea); \
- do { \
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD); \
- spu_readch(MFC_RdAtomicStat); \
- SET_HIT; \
- status = 1; \
- if (likely(buf[offset] _RELOP_ 0)) { \
- buf[offset] += _val; \
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD); \
- status = spu_readch(MFC_RdAtomicStat); \
- } \
- } while (status != 0);
-
-
-static inline void _lock_init(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- u32 oldtmask, tagmask;
-
- tagid = mfc_tag_reserve();
-
- tagmask = 1 << (tagid & 31);
-
- /* __lock_init
- * Internal routine to initialize a spinlock or
- * reader/writer lock.
- */
- ea64.ull = ALIGN128_EA(ea);
- offset = OFFSET128_EA_U32(ea);
- MFC_DMA(buf, ea64, size, tagid & 31, MFC_GET_CMD);
- oldtmask = spu_readch(MFC_RdTagMask);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
-
- buf[offset] = 0;
- MFC_DMA(buf, ea64, size, tagid & 31, MFC_PUT_CMD);
- spu_writech(MFC_WrTagMask, tagmask);
- spu_writech(MFC_WrTagUpdate, MFC_TAG_UPDATE_ANY);
- spu_readch(MFC_RdTagStat);
- spu_writech(MFC_WrTagMask, oldtmask);
- mfc_tag_release(tagid);
-}
-
-static inline void _spin_lock(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status;
-
- /* _spin_lock
- * Internal routine to acquire spinlock.
- */
-/* non trace - no hit/miss indicator */
-#define SET_HIT
- RAW_SPINLOCK(==, 1);
-}
-
-#ifdef LIBSYNC_TRACE
-static inline s32 _spin_lock_trace(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status = 0;
-/* trace - need hit/miss indicator */
-#undef SET_HIT
-#define SET_HIT if (status == 0) hit = buf[offset]
- s32 hit;
-
- hit = 0;
- /* _spin_lock_trace for trace
- * Internal routine to acquire spinlock.
- */
- RAW_SPINLOCK(==, 1);
-
- return hit;
-
-#undef SET_HIT
-#define SET_HIT
-}
-
-#endif /* LIBSYNC_TRACE */
-
-
-#endif /* SPU_MUTEX_H */
diff --git a/gcell/ibm/sync/spu_source/mutex_init.h b/gcell/ibm/sync/spu_source/mutex_init.h
deleted file mode 100644
index 9bddb1456..000000000
--- a/gcell/ibm/sync/spu_source/mutex_init.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_MUTEX_INIT_H_
-#define _SPU_MUTEX_INIT_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include "trace_libsync.h"
-
-/***************************************************************************/
-/**
- * mutex_init - initialize the mutex by setting the value
- * to 0.
- * @lock: handle to effective address of lock variable.
- *
- * Description: Initialize a mutex.
- */
-static __inline void _mutex_init(mutex_ea_t lock)
-{
- _lock_init(lock);
-
- TRACE_MUTEX_INIT(lock);
-}
-
-
-#endif /* _SPU_MUTEX_INIT_H_ */
diff --git a/gcell/ibm/sync/spu_source/mutex_lock.h b/gcell/ibm/sync/spu_source/mutex_lock.h
deleted file mode 100644
index 63bdbc36a..000000000
--- a/gcell/ibm/sync/spu_source/mutex_lock.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_MUTEX_LOCK_H_
-#define _SPU_MUTEX_LOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include "trace_libsync.h"
-
-static __inline void _mutex_lock(mutex_ea_t ea)
-{
-
-#ifdef LIBSYNC_TRACE
- s32 miss = 0;
-
- TRACE_MUTEX_LOCK_ENTRY(interval);
- miss = _spin_lock_trace(ea);
- TRACE_MUTEX_LOCK_EXIT(interval, ea, miss);
-
-#else /* LIBSYNC_TRACE */
-
- _spin_lock(ea);
-
-#endif /* LIBSYNC_TRACE */
-
-}
-
-#endif /* _SPU_MUTEX_LOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/mutex_trylock.h b/gcell/ibm/sync/spu_source/mutex_trylock.h
deleted file mode 100644
index 3c8df4662..000000000
--- a/gcell/ibm/sync/spu_source/mutex_trylock.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_MUTEX_TRYLOCK_H_
-#define _SPU_MUTEX_TRYLOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include "trace_libsync.h"
-
-/**
- * mutex_trylock - acquire a lock, or return immediately.
- * @ea: handle to effective address of lock variable.
- *
- * Description: Acquire a lock, or return immediately
- * without polling for availability.
- *
- * Context: The application should not call this interface
- * from a tight loop!! Use spin_lock() instead.
- */
-static __inline int _mutex_trylock(mutex_ea_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status, ret_val;
-
- RAW_TEST_AND_SET(==, 1);
-
- TRACE_MUTEX_TRYLOCK(ea, ret_val);
-
- return ret_val;
-}
-
-#endif /* _SPU_MUTEX_TRYLOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/mutex_unlock.h b/gcell/ibm/sync/spu_source/mutex_unlock.h
deleted file mode 100644
index 87d6bbaef..000000000
--- a/gcell/ibm/sync/spu_source/mutex_unlock.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_MUTEX_UNLOCK_H_
-#define _SPU_MUTEX_UNLOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include "atomic.h"
-#include "trace_libsync.h"
-
-static __inline void _mutex_unlock(mutex_ea_t ea)
-{
- int ret_val;
-
- ATOMIC_OP((atomic_ea_t)ea, 0, 1, ret_val);
-
- TRACE_MUTEX_UNLOCK(ea);
-}
-
-
-#endif /* _SPU_MUTEX_UNLOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/read_lock.h b/gcell/ibm/sync/spu_source/read_lock.h
deleted file mode 100644
index 0e1d97182..000000000
--- a/gcell/ibm/sync/spu_source/read_lock.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_READ_LOCK_H_
-#define _SPU_READ_LOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-
-/**
- * read_lock - acquire reader lock, or spin until available.
- * @ea: handle to effective address of lock variable.
- *
- * Description: Acquire a non-exclusive reader lock, or spin
- * until available. The only restriction here is that @ea
- * must be word aligned.
- *
- * Context: This routine should not be called if SPU
- * asynchronous interrupts are enabled.
- */
-static __inline void _read_lock(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status;
-
- RAW_SPINLOCK(>=, 1);
-}
-
-#endif /* _SPU_READ_LOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/read_trylock.h b/gcell/ibm/sync/spu_source/read_trylock.h
deleted file mode 100644
index d03278351..000000000
--- a/gcell/ibm/sync/spu_source/read_trylock.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_READ_TRYLOCK_H_
-#define _SPU_READ_TRYLOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-
-/**
- * read_trylock - acquire a reader lock, or return immediately.
- * @ea: handle to effective address of lock variable.
- *
- * Acquire a non-exclusive reader lock, or return
- * immediately. The only restriction here is that
- * @ea must be word aligned.
- *
- * Returns 1 on success, or 0 on failure.
- *
- * Context: The application should not call this interface
- * from a tight loop!! Use read_lock() instead.
- */
-static __inline int _read_trylock(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status, ret_val;
-
- RAW_TEST_AND_SET(>=, 1);
-
- return ret_val;
-}
-
-
-#endif /* _SPU_READ_TRYLOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/read_unlock.h b/gcell/ibm/sync/spu_source/read_unlock.h
deleted file mode 100644
index f011550e5..000000000
--- a/gcell/ibm/sync/spu_source/read_unlock.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_READ_UNLOCK_H_
-#define _SPU_READ_UNLOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include <spu_mfcio.h>
-
-
-/**
- * read_unlock - release reader lock.
- * @ea: handle to effective address of lock variable.
- *
- * Description: Release a reader lock. The only restriction
- * here is that @ea must be word aligned.
- *
- * Context: This routine should be used when interrupts
- * do not need to be re-enabled --either because interrupts
- * are not being used, or because the application will take
- * steps to re-enable them later.
- */
-static __inline void _read_unlock(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status;
-
- /* _read_unlock
- *
- * Reader locks must use PUTLLC when releasing, instead of
- * the more traditional PUTLLUC because of the non-exclusive
- * nature of the lock. The reason for this is that other
- * readers may have incremented the counter, and we don't
- * want to corrupt it by blindly issuing PUTLLUC!!
- */
- ea64.ull = ALIGN128_EA(ea);
- offset = OFFSET128_EA_U32(ea);
- do {
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
-
- buf[offset] -= 1;
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);
- status = spu_readch(MFC_RdAtomicStat);
- } while (status != 0);
-
-}
-
-
-#endif /* _SPU_READ_UNLOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/rwlock_init.h b/gcell/ibm/sync/spu_source/rwlock_init.h
deleted file mode 100644
index 6b05533bb..000000000
--- a/gcell/ibm/sync/spu_source/rwlock_init.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_RWLOCK_INIT_H_
-#define _SPU_RWLOCK_INIT_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-
-/**
- * rwlock_init - initialize a reader/writer lock.
- * @ea: handle to effective address of lock variable.
- *
- * Description: Initialize a reader/writer lock.
- */
-static __inline void _rwlock_init(eaddr_t rwlock)
-{
- _lock_init(rwlock);
-}
-
-
-
-#endif /* _SPU_RWLOCK_INIT_H_ */
diff --git a/gcell/ibm/sync/spu_source/sync_irq.h b/gcell/ibm/sync/spu_source/sync_irq.h
deleted file mode 100644
index feae65e50..000000000
--- a/gcell/ibm/sync/spu_source/sync_irq.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-/*
- * irq.h - SPU interrupt management facilities.
- *
- * These utilities help an "interrupt aware" library to manage
- * state of SPU interrupts.
- */
-
-#ifndef __SPU_IRQ_H__
-#define __SPU_IRQ_H__
-
-#include <spu_intrinsics.h>
-#include "sync_utils.h"
-
-static inline u32 irq_mask(u32 newmask)
-{
- u32 old, tmp = 0;
-
- /* irq_mask
- * Set the interrupt mask to the newmask value,
- * and return its previous setting. Will
- * detect and discard potential phantom
- * events.
- */
-
- old = spu_readch(SPU_RdEventMask);
- spu_writech(SPU_WrEventMask, tmp);
- if (spu_readchcnt(SPU_RdEventStat)) {
- tmp = spu_readch(SPU_RdEventStat);
- spu_writech(SPU_WrEventAck, tmp);
- }
- spu_writech(SPU_WrEventMask, newmask);
-
- return old;
-}
-
-#endif /* __SPU_IRQ_H__ */
diff --git a/gcell/ibm/sync/spu_source/sync_utils.h b/gcell/ibm/sync/spu_source/sync_utils.h
deleted file mode 100644
index 516b41f74..000000000
--- a/gcell/ibm/sync/spu_source/sync_utils.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-/*
- * sync_utils.h - SPU sync-library internal utilities.
- *
- * These utilities are used internally by the SPU sync library.
- */
-#ifndef __SPU_SYNC_UTILS_H__
-#define __SPU_SYNC_UTILS_H__
-
-#include <spu_intrinsics.h>
-
-typedef unsigned int u32;
-typedef signed int s32;
-typedef unsigned long long u64;
-typedef unsigned long long eaddr_t;
-
-
-typedef union {
- u64 ull;
- u32 ui[2];
-} addr64;
-
-#ifndef likely
-#define likely(_c) \
- __builtin_expect((_c), 1)
-#define unlikely(_c) \
- __builtin_expect((_c), 0)
-#endif
-
-#define ALLOCA(_nbytes, _size) \
- alloca((_nbytes) + (_size)-1)
-
-#define ALIGN(_ptr, _size) \
- ((((u32) _ptr) + (_size)-1) & ~((_size)-1))
-
-#define ALIGN128_EA(_ull) \
- ((_ull) & ~(127ULL))
-/*
-#define OFFSET128_EA(_ull, _type) \
- (((_ull) & 127ULL) / sizeof(_type))
- */
-
-#define OFFSET128_EA_U32(_ull) \
- (((_ull) & 127ULL) >> 2)
-
-#define OFFSET128_EA_U16(_ull) \
- (((_ull) & 127ULL) >> 1)
-
-#define MFC_DMA(_ls, _ea, _sz, _tg, _cmd) \
- spu_mfcdma64(_ls, _ea.ui[0], _ea.ui[1], _sz, _tg, _cmd)
-
-#define MFC_SYNC() { \
- u32 _tagid = 0; \
- spu_writech(mfc_tag_id, _tagid); \
- spu_writech(mfc_cmd_queue, MFC_SYNC_CMD); \
-}
-
-#define MFC_EIEIO() { \
- u32 _tagid = 0; \
- spu_writech(mfc_tag_id, _tagid); \
- spu_writech(mfc_cmd_queue, MFC_EIEIO_CMD); \
-}
-
-#endif /* __SPU_SYNC_UTILS_H__ */
diff --git a/gcell/ibm/sync/spu_source/trace_libsync.h b/gcell/ibm/sync/spu_source/trace_libsync.h
deleted file mode 100644
index 47887c9dc..000000000
--- a/gcell/ibm/sync/spu_source/trace_libsync.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2007 */
-/* International Business Machines Corporation */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef __LIBSYNC_SPU_TRACEHOOKS_H__
-#define __LIBSYNC_SPU_TRACEHOOKS_H__
-
-#ifdef LIBSYNC_TRACE
-
-#include <trace_events.h>
-
-/*
- * last parameter in the trace_even and trace_interval_entry call is
- * the stack level to report the PC in the trace record. so 0 means
- * the PC of the current frame, 1 means the PC of the caller, etc.
- * there's a dilemma here - these macros are included in the inline
- * _mutex calls which get called from the (created during build)
- * mutex functions in the mutex .c files. in that case, the level
- * should be 1 - we don't want the PC of where in the mutex function
- * the trace call is happening, we want the PC of whomever is calling
- * the mutex function.
- *
- * but.. an app can call the inline functions - it can #include the
- * appropriate libsync mutex .h files, and call the inlined _mutex
- * function in their code. in that case, the appropriate level for the
- * trace calls would be 0 - the user would want to know where in their
- * code the call to the _mutex function is.
- *
- * so, we'll assume _LEVEL of 0 which is what the inline funtions need.
- * when we build the files for libsync, we'll do a -D_LEVEL=1
- */
-#ifndef _LEVEL
-#define _LEVEL 0
-#endif
-
-
-#define TRACE_EVENT_MUTEX_INIT 0x0403
-
-#define TRACE_MUTEX_INIT(lock) { \
- trace_payload_t payload; \
- payload.dword[0]=(unsigned long)lock; \
- trace_event(TRACE_EVENT_MUTEX_INIT, 1, &payload, "Event=%d, lock=0x%x", _LEVEL); \
-}
-
-#define TRACE_EVENT_MUTEX_LOCK 0x0503
-
-#define TRACE_MUTEX_LOCK_ENTRY(_INTERVAL) \
-trace_interval_p _INTERVAL = trace_interval_entry(TRACE_EVENT_MUTEX_LOCK, _LEVEL)
-
-#define TRACE_MUTEX_LOCK_EXIT(_INTERVAL,lock,miss) { \
- trace_payload_t payload; \
- payload.dword[0]=(unsigned long)lock; \
- payload.word[2]=(unsigned int)miss; \
- trace_interval_exit(_INTERVAL, 2, &payload, "Event=%d, lock=0x%x, miss=0x%x"); \
-}
-
-#define TRACE_EVENT_MUTEX_TRYLOCK 0x0603
-
-#define TRACE_MUTEX_TRYLOCK(lock,ret_val) { \
- trace_payload_t payload; \
- payload.dword[0]=(unsigned long)lock; \
- payload.word[2]=(unsigned int)ret_val; \
- trace_event(TRACE_EVENT_MUTEX_TRYLOCK, 2, &payload, "Event=%d, lock=0x%x, ret_val=0x%x", _LEVEL); \
-}
-
-#define TRACE_EVENT_MUTEX_UNLOCK 0x0703
-
-#define TRACE_MUTEX_UNLOCK(lock) { \
- trace_payload_t payload; \
- payload.dword[0]=(unsigned long)lock; \
- trace_event(TRACE_EVENT_MUTEX_UNLOCK, 1, &payload, "Event=%d, lock=0x%x", _LEVEL); \
-}
-
-#else /* LIBSYNC_TRACE */
-
-#define TRACE_MUTEX_INIT(lock)
-#define TRACE_MUTEX_LOCK_ENTRY(_INTERVAL)
-#define TRACE_MUTEX_LOCK_EXIT(_INTERVAL,lock,miss)
-#define TRACE_MUTEX_TRYLOCK(lock,ret_val)
-#define TRACE_MUTEX_UNLOCK(lock)
-
-#endif /* LIBSYNC_TRACE */
-
-#endif /* __LIBSYNC_SPU_TRACEHOOKS_H__ */
diff --git a/gcell/ibm/sync/spu_source/wait_for_completion.h b/gcell/ibm/sync/spu_source/wait_for_completion.h
deleted file mode 100644
index ea7bdbe6d..000000000
--- a/gcell/ibm/sync/spu_source/wait_for_completion.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_WAIT_FOR_COMPLETION_H_
-#define _SPU_WAIT_FOR_COMPLETION_H_
-
-#include "sync_utils.h"
-#include <spu_mfcio.h>
-#include "sync_irq.h"
-#include "completion.h"
-
-/* _wait_for_completion
- * Internal routine to wait for completion to
- * become true (!0). When completion is false,
- * uses lock line reservation lost event to
- * sleep until the variable has been changed.
- */
-static __inline void _wait_for_completion(completion_ea_t completion)
-{
- DECL_COMPLETION_VARS();
- s32 status;
-
- status = 1;
-
- ea64.ull = ALIGN128_EA(completion);
- offset = OFFSET128_EA_U32(completion);
- do {
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
- /* if the completion variable has been set elsewhere
- * (a signal or broadcast function has been called
- * then we get out of the loop, and reset the variable */
- if (likely(buf[offset] != 0)) {
- /* decrement the variable */
- buf[offset]--;
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLC_CMD);
- spu_readch(MFC_RdAtomicStat);
- status = 0;
- }
- } while (status != 0);
-}
-
-
-
-#endif /* _SPU_WAIT_FOR_COMPLETION_H_ */
diff --git a/gcell/ibm/sync/spu_source/write_lock.h b/gcell/ibm/sync/spu_source/write_lock.h
deleted file mode 100644
index 7af5175f0..000000000
--- a/gcell/ibm/sync/spu_source/write_lock.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_WRITE_LOCK_H_
-#define _SPU_WRITE_LOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-
-/**
- * write_lock - acquire writer lock, or spin until available.
- * @ea: handle to effective address of lock variable.
- *
- * Description: Acquire an exclusive writer lock,
- * or spin until available. The only restriction
- * here is that @ea must be word aligned.
- *
- * Context: This routine should not be called if SPU
- * asynchronous interrupts are enabled.
- */
-static __inline void _write_lock(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status;
-
- RAW_SPINLOCK(==, -1);
-}
-
-
-#endif /* _SPU_WRITE_LOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/write_trylock.h b/gcell/ibm/sync/spu_source/write_trylock.h
deleted file mode 100644
index b3799b37e..000000000
--- a/gcell/ibm/sync/spu_source/write_trylock.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_WRITE_TRYLOCK_H_
-#define _SPU_WRITE_TRYLOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-
-/**
- * write_trylock - acquire a writer lock, or return immediately.
- * @ea: handle to effective address of lock variable.
- *
- * Try to acquire an exclusive writer lock, or return
- * immediately. The only restriction here is that @ea
- * must be word aligned.
- *
- * Returns 1 on success, or 0 on failure.
- *
- * Caution:
- * The application should not call this interface from a tight
- * loop!! Use write_lock() instead.
- */
-static __inline int _write_trylock(eaddr_t ea)
-{
- DECL_MUTEX_VARS();
- s32 status, ret_val;
-
- RAW_TEST_AND_SET(==, -1);
-
- return ret_val;
-}
-
-
-#endif /* _SPU_WRITE_TRYLOCK_H_ */
diff --git a/gcell/ibm/sync/spu_source/write_unlock.h b/gcell/ibm/sync/spu_source/write_unlock.h
deleted file mode 100644
index 25b24e181..000000000
--- a/gcell/ibm/sync/spu_source/write_unlock.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _SPU_WRITE_UNLOCK_H_
-#define _SPU_WRITE_UNLOCK_H_
-
-#include "sync_utils.h"
-#include "mutex.h"
-#include <spu_mfcio.h>
-
-/**
- * write_unlock - release writer lock.
- * @rwlock: handle to effective address of lock variable.
- *
- * Release a single writer lock.
- */
-static __inline void _write_unlock(eaddr_t rwlock)
-{
- DECL_MUTEX_VARS();
-
- ea64.ull = ALIGN128_EA(rwlock);
- offset = OFFSET128_EA_U32(rwlock);
- MFC_DMA(buf, ea64, size, tagid, MFC_GETLLAR_CMD);
- spu_readch(MFC_RdAtomicStat);
-
- buf[offset] = 0;
- MFC_DMA(buf, ea64, size, tagid, MFC_PUTLLUC_CMD);
- spu_readch(MFC_RdAtomicStat);
-}
-
-
-#endif /* _SPU_WRITE_UNLOCK_H_ */
diff --git a/gcell/include/Makefile.am b/gcell/include/Makefile.am
deleted file mode 100644
index c96c6f0a3..000000000
--- a/gcell/include/Makefile.am
+++ /dev/null
@@ -1,24 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = gcell
-
diff --git a/gcell/include/gcell/Makefile.am b/gcell/include/gcell/Makefile.am
deleted file mode 100644
index 03255e516..000000000
--- a/gcell/include/gcell/Makefile.am
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = spu
-
-gcellinclude_HEADERS = \
- compiler.h \
- gc_aligned_alloc.h \
- gc_atomic.h \
- gc_cdefs.h \
- gc_declare_proc.h \
- gc_job_manager.h \
- gc_jd_queue_data.h \
- gc_jd_queue.h \
- gc_jd_stack.h \
- gc_job_desc.h \
- gc_job_desc_private.h \
- gc_logging.h \
- gc_mbox.h \
- gc_spu_args.h \
- gc_types.h \
- gcp_fft_1d_r2.h \
- memory_barrier.h
diff --git a/gcell/include/gcell/compiler.h b/gcell/include/gcell/compiler.h
deleted file mode 100644
index d1adcd129..000000000
--- a/gcell/include/gcell/compiler.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_COMPILER_H
-#define INCLUDED_GCELL_COMPILER_H
-
-/*!
- * \brief Compiler specific hackery. These are for GCC.
- */
-
-#define _AL8 __attribute__((aligned (8)))
-#define _AL16 __attribute__((aligned (16)))
-#define _AL128 __attribute__((aligned (128)))
-
-#define _UNUSED __attribute__((unused))
-
-#ifndef likely
-#define likely(x) __builtin_expect(!!(x), 1)
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#endif
-
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
-#endif
-
-
-#endif /* INCLUDED_GCELL_COMPILER_H */
diff --git a/gcell/include/gcell/gc_aligned_alloc.h b/gcell/include/gcell/gc_aligned_alloc.h
deleted file mode 100644
index bdc21c278..000000000
--- a/gcell/include/gcell/gc_aligned_alloc.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GC_ALIGNED_ALLOC_H
-#define INCLUDED_GC_ALIGNED_ALLOC_H
-
-#include <boost/shared_ptr.hpp>
-
-/*!
- * \brief Return pointer to chunk of storage of size size bytes.
- * The allocation will be aligned to an \p alignment boundary.
- *
- * \param size is the number of bytes to allocate
- * \param alignment is the minimum storage alignment in bytes; must be a power of 2.
- *
- * Throws if can't allocate memory. The storage should be freed
- * with "free" when done. The memory is initialized to zero.
- */
-void *
-gc_aligned_alloc(size_t size, size_t alignment = 128);
-
-/*!
- * \brief Return boost::shared_ptr to chunk of storage of size size bytes.
- * The allocation will be aligned to an \p alignment boundary.
- *
- * \param size is the number of bytes to allocate
- * \param alignment is the minimum storage alignment in bytes; must be a power of 2.
- *
- * Throws if can't allocate memory. The storage should be freed
- * with "free" when done. The memory is initialized to zero.
- */
-boost::shared_ptr<void>
-gc_aligned_alloc_sptr(size_t size, size_t alignment = 128);
-
-#endif /* INCLUDED_GC_ALIGNED_ALLOC_H */
diff --git a/gcell/include/gcell/gc_atomic.h b/gcell/include/gcell/gc_atomic.h
deleted file mode 100644
index 51d38af48..000000000
--- a/gcell/include/gcell/gc_atomic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_GC_ATOMIC_H
-#define INCLUDED_GCELL_GC_ATOMIC_H
-
-#include <stdint.h>
-
-typedef uint32_t gc_atomic_t;
-
-
-#endif /* INCLUDED_GCELL_GC_ATOMIC_H */
diff --git a/gcell/include/gcell/gc_cdefs.h b/gcell/include/gcell/gc_cdefs.h
deleted file mode 100644
index 0c5fc4ad8..000000000
--- a/gcell/include/gcell/gc_cdefs.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_CDEFS_H
-#define INCLUDED_GCELL_GC_CDEFS_H
-
-/* C++ needs to know that types and declarations are C, not C++. */
-#ifdef __cplusplus
-# define __GC_BEGIN_DECLS extern "C" {
-# define __GC_END_DECLS }
-#else
-# define __GC_BEGIN_DECLS
-# define __GC_END_DECLS
-#endif
-
-#endif /* INCLUDED_GCELL_GC_CDEFS_H */
diff --git a/gcell/include/gcell/gc_declare_proc.h b/gcell/include/gcell/gc_declare_proc.h
deleted file mode 100644
index ba77e0fb0..000000000
--- a/gcell/include/gcell/gc_declare_proc.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_GC_DECLARE_PROC_H
-#define INCLUDED_GCELL_GC_DECLARE_PROC_H
-
-#include <stdint.h>
-#include <gcell/gc_job_desc.h>
-
-/*
- * This is C, not C++ code...
- *
- * ...and is used by both PPE and SPE code
- */
-__GC_BEGIN_DECLS
-
-#define GC_PROC_DEF_SECTION ".gcell.proc_def"
-
-typedef struct gc_proc_def {
-#if defined(__SPU__)
- gc_spu_proc_t proc;
-#else
- uint32_t proc;
-#endif
- char name[28];
-} _AL16 gc_proc_def_t;
-
-
-#if defined(__SPU__)
-/*!
- * \brief Tell gcell about a SPU procedure
- *
- * \param _proc_ pointer to function (gc_spu_proc_t)
- * \param _name_ the name of the procedure ("quoted string")
- *
- * This macro registers the given procedure with the gcell runtime.
- * From the PPE, use gc_job_manager::lookup_proc to map \p _name_ to a gc_proc_id_t
- */
-#define GC_DECLARE_PROC(_proc_, _name_) \
-static struct gc_proc_def \
- _GCPD_ ## _proc_ __attribute__((section(GC_PROC_DEF_SECTION), used)) = \
- { _proc_, _name_ }
-#endif
-
-__GC_END_DECLS
-
-#endif /* INCLUDED_GCELL_GC_DECLARE_PROC_H */
diff --git a/gcell/include/gcell/gc_jd_queue.h b/gcell/include/gcell/gc_jd_queue.h
deleted file mode 100644
index 50777a394..000000000
--- a/gcell/include/gcell/gc_jd_queue.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_JD_QUEUE_H
-#define INCLUDED_GCELL_GC_JD_QUEUE_H
-
-#include <gcell/gc_jd_queue_data.h>
-
-__GC_BEGIN_DECLS
-
-/*!
- * \brief Initialize the queue to empty.
- */
-void
-gc_jd_queue_init(gc_jd_queue_t *q);
-
-
-/*!
- * \brief Add \p item to the tail of \p q.
- */
-void
-gc_jd_queue_enqueue(gc_jd_queue_t *q, gc_job_desc_t *item);
-
-
-/*!
- * \brief Remove and return item at head of queue, or 0 if queue is empty
- */
-gc_job_desc_t *
-gc_jd_queue_dequeue(gc_jd_queue_t *q);
-
-__GC_END_DECLS
-
-
-#endif /* INCLUDED_GCELL_GC_JD_QUEUE_H */
diff --git a/gcell/include/gcell/gc_jd_queue_data.h b/gcell/include/gcell/gc_jd_queue_data.h
deleted file mode 100644
index 819b3712e..000000000
--- a/gcell/include/gcell/gc_jd_queue_data.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_JD_QUEUE_DATA_H
-#define INCLUDED_GCELL_GC_JD_QUEUE_DATA_H
-
-#include <gcell/gc_types.h>
-#include <gcell/gc_job_desc.h>
-
-__GC_BEGIN_DECLS
-
-/*!
- * \brief (Lock free someday...) queue for job descriptors
- *
- * This is the main data structure shared between PPEs and SPEs.
- * It is used to enqueue work for SPEs. SPEs or PPEs may enqueue
- * work. SPE's dequeue from here.
- *
- * FIXME make it lock free ;) For now, use a spin lock.
- *
- * (Fills a single cache line)
- */
-typedef struct gc_jd_queue
-{
- gc_eaddr_t head _AL16;
- gc_eaddr_t tail _AL16;
- uint32_t mutex _AL16; // libsync mutex (spin lock)
-} _AL128 gc_jd_queue_t;
-
-__GC_END_DECLS
-
-#endif /* INCLUDED_GCELL_GC_JD_QUEUE_DATA_H */
-
-
diff --git a/gcell/include/gcell/gc_jd_stack.h b/gcell/include/gcell/gc_jd_stack.h
deleted file mode 100644
index 9eab4e402..000000000
--- a/gcell/include/gcell/gc_jd_stack.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_JD_STACK_H
-#define INCLUDED_GCELL_GC_JD_STACK_H
-
-#include <gcell/gc_types.h>
-#include <gcell/gc_job_desc.h>
-
-__GC_BEGIN_DECLS
-
-/*!
- * \brief Lock free stack for job descriptors (used for free list)
- *
- * This is aligned to a cache line, and fills the cache line,
- * to avoid inadvertently losing reservations created with
- * the load-and-reserve instructions.
- */
-
-typedef struct gc_jd_stack
-{
- gc_eaddr_t top;
-
- // pad out to a full cache line
- uint8_t _pad[128 - sizeof(gc_eaddr_t)];
-} _AL128 gc_jd_stack_t;
-
-
-/*!
- * \brief Initialize the stack to empty.
- */
-void
-gc_jd_stack_init(gc_jd_stack_t *stack);
-
-
-/*!
- * \brief Add \p item to the top of \p stack.
- */
-void
-gc_jd_stack_push(gc_jd_stack_t *stack, gc_job_desc_t *item);
-
-
-/*!
- * \brief pop and return top item on stack, or 0 if stack is empty
- */
-gc_job_desc_t *
-gc_jd_stack_pop(gc_jd_stack_t *stack);
-
-__GC_END_DECLS
-
-
-#endif /* INCLUDED_GCELL_GC_JD_STACK_H */
diff --git a/gcell/include/gcell/gc_job_desc.h b/gcell/include/gcell/gc_job_desc.h
deleted file mode 100644
index 7dc9d182c..000000000
--- a/gcell/include/gcell/gc_job_desc.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- c -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_JOB_DESC_H
-#define INCLUDED_GCELL_GC_JOB_DESC_H
-
-/*!
- * This file contains the structures that are used to describe how to
- * call "jobs" that execute on the SPEs. A "job" is a task, or piece of
- * work that you want to run on an SPE.
- *
- * There is code running in the SPE that knows how to interpret
- * these job descriptions. Thus, in most cases, the overhead
- * of invoking these is very low.
- *
- * The whole "job idea" is SPE centric. At first pass,
- * the PPE will be constructing jobs and enqueing them.
- * However, there is nothing in the implementation that
- * prohibits SPEs from creating their own jobs in the
- * future. Also, there is nothing prohibiting SPE-to-SPE
- * DMA's.
- *
- * SPE's dequeue and "pull" jobs to themselves, do the work, then
- * notify the entity that submitted the job.
- */
-
-#include <gcell/gc_types.h>
-#include <gcell/gc_job_desc_private.h>
-
-/*
- * This is C, not C++ code...
- *
- * ...and is used by both PPE and SPE code
- */
-__GC_BEGIN_DECLS
-
-
-//! opaque ID that specifies which code to invoke on the SPE
-typedef uint32_t gc_proc_id_t;
-#define GCP_UNKNOWN_PROC ((gc_proc_id_t) -1)
-
-
-//! final job status
-typedef enum {
- JS_OK,
- JS_SHUTTING_DOWN, // job mananger is shutting down
- JS_TOO_MANY_CLIENTS, // too many client threads
- JS_UNKNOWN_PROC, // didn't recognize the procedure ID
- JS_BAD_DIRECTION, // EA arg has invalid direction
- JS_BAD_EAH, // not all EA args have the same high 32 address bits
- JS_BAD_N_DIRECT, // too many direct args
- JS_BAD_N_EA, // too many EA args
- JS_ARGS_TOO_LONG, // total length of EA args exceeds limit
- JS_BAD_JUJU, // misc problem: you're having a bad day
- JS_BAD_JOB_DESC, // gc_job_desc was not allocated using mgr->alloc_job_desc()
-
-} gc_job_status_t;
-
-#define MAX_ARGS_DIRECT 8 // maximum number of args passed using "direct" method
-#define MAX_ARGS_EA 8 // maximum number of args passed via EA memory (dma)
-
-/*
- * We support two classes of arguments,
- * "direct", which are contained in the gc_job_desc_args and
- * "EA", which are copied in/out according to info in gc_job_desc_args
- */
-
-/*!
- * \brief Tag type of "direct" argument
- */
-typedef enum {
- GCT_S32,
- GCT_U32,
- GCT_S64,
- GCT_U64,
- GCT_FLOAT,
- GCT_DOUBLE,
- GCT_FLT_CMPLX,
- GCT_DBL_CMPLX,
- GCT_EADDR,
-
-} gc_tag_t;
-
-
-/*!
- * \brief union for passing "direct" argument
- */
-typedef union gc_arg_union
-{
- int32_t s32;
- uint32_t u32;
- int64_t s64;
- uint64_t u64;
- float f;
- double d;
- //float complex cf; // 64-bits (C99)
- //double complex cd; // 128-bits (C99)
- gc_eaddr_t ea; // 64-bits
-} _AL8 gc_arg_union_t;
-
-
-/*!
- * \brief "direct" input or output arguments
- */
-typedef struct gc_job_direct_args
-{
- uint32_t nargs; // # of "direct" args
- gc_tag_t tag[MAX_ARGS_DIRECT] _AL16; // type of direct arg[i]
- gc_arg_union_t arg[MAX_ARGS_DIRECT] _AL16; // direct argument values
-
-} _AL16 gc_job_direct_args_t;
-
-
-// specifies direction for args passed in EA memory
-
-#define GCJD_DMA_GET 0x01 // in to SPE
-#define GCJD_DMA_PUT 0x02 // out from SPE
-
-/*!
- * \brief Description of args passed in EA memory.
- * These are DMA'd between EA and LS as specified.
- */
-typedef struct gc_job_ea_arg {
- //! EA address of buffer
- gc_eaddr_t ea_addr;
-
- //! GC_JD_DMA_* get arg or put arg
- uint32_t direction;
-
- //! number of bytes to get
- uint32_t get_size;
-
- //! number of bytes to put
- uint32_t put_size;
-
-#if defined(__SPU__)
- //! local store address (filled in by SPU runtime)
- void *ls_addr;
- uint32_t _pad[2];
-#else
- uint32_t _pad[3];
-#endif
-
-} _AL16 gc_job_ea_arg_t;
-
-
-typedef struct gc_job_ea_args {
- uint32_t nargs;
- gc_job_ea_arg_t arg[MAX_ARGS_EA];
-
-} _AL16 gc_job_ea_args_t;
-
-
-/*!
- * \brief "job description" that is DMA'd to/from the SPE.
- * \ingroup gcell
- */
-typedef struct gc_job_desc
-{
- gc_job_desc_private_t sys; // internals
- gc_job_status_t status; // what happened (output)
- gc_proc_id_t proc_id; // specifies which procedure to run
- gc_job_direct_args_t input; // direct args to SPE
- gc_job_direct_args_t output; // direct args from SPE
- gc_job_ea_args_t eaa; // args passed via EA memory
-
-} _AL128 gc_job_desc_t;
-
-
-/*!
- * type of procedure invoked on spu
- */
-typedef void (*gc_spu_proc_t)(const gc_job_direct_args_t *input,
- gc_job_direct_args_t *output,
- const gc_job_ea_args_t *eaa);
-
-#if !defined(__SPU__)
-
-static inline gc_job_desc_t *
-ea_to_jdp(gc_eaddr_t ea)
-{
- return (gc_job_desc_t *) ea_to_ptr(ea);
-}
-
-static inline gc_eaddr_t
-jdp_to_ea(gc_job_desc_t *item)
-{
- return ptr_to_ea(item);
-}
-
-#endif
-
-
-__GC_END_DECLS
-
-#endif /* INCLUDED_GCELL_GC_JOB_DESC_H */
diff --git a/gcell/include/gcell/gc_job_desc_private.h b/gcell/include/gcell/gc_job_desc_private.h
deleted file mode 100644
index fa831a88e..000000000
--- a/gcell/include/gcell/gc_job_desc_private.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- c -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_JOB_DESC_PRIVATE_H
-#define INCLUDED_GCELL_GC_JOB_DESC_PRIVATE_H
-
-// #include <libsync.h>
-
-/*!
- * \brief Implementation details we'd like to hide from the user.
- */
-typedef struct gc_job_desc_private
-{
- gc_eaddr_t next; // used to implement job queue and free list
- uint16_t job_id;
- uint16_t client_id;
- uint32_t direction_union; // union of all gc_job_ea_arg.direction fields
-} gc_job_desc_private_t;
-
-#endif /* INCLUDED_GCELL_GC_JOB_PRIVATE_H */
-
diff --git a/gcell/include/gcell/gc_job_manager.h b/gcell/include/gcell/gc_job_manager.h
deleted file mode 100644
index 8e5de5217..000000000
--- a/gcell/include/gcell/gc_job_manager.h
+++ /dev/null
@@ -1,287 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GC_JOB_MANAGER_H
-#define INCLUDED_GC_JOB_MANAGER_H
-
-#include <boost/utility.hpp>
-#include <boost/shared_ptr.hpp>
-#include <vector>
-#include <string>
-#include <stdexcept>
-#include <libspe2.h>
-#include "gc_job_desc.h"
-
-class gc_job_manager;
-typedef boost::shared_ptr<gc_job_manager> gc_job_manager_sptr;
-typedef boost::shared_ptr<spe_program_handle_t> spe_program_handle_sptr;
-typedef boost::shared_ptr<gc_job_desc> gc_job_desc_sptr;
-
-/*!
- * \brief Return a boost::shared_ptr to an spe_program_handle_t
- *
- * \param filename is the name of the SPE ELF executable to open.
- *
- * Calls spe_image_open to open the file. If successful returns a
- * boost::shared_ptr that will call spe_image_close when it's time to
- * free the object.
- *
- * Returns the equivalent of the NULL pointer if the file cannot be
- * opened, or if it's not an SPE ELF object file.
- *
- * \sa gc_program_handle_from_address
- */
-spe_program_handle_sptr
-gc_program_handle_from_filename(const std::string &filename);
-
-/*!
- * \brief Return a boost::shared_ptr to an spe_program_handle_t
- *
- * \param handle is a non-zero pointer to an embedded SPE image.
- *
- * If successful returns a boost::shared_ptr that does nothing when
- * it's time to free the object.
- *
- * \sa gc_program_handle_from_filename
- */
-spe_program_handle_sptr
-gc_program_handle_from_address(spe_program_handle_t *handle);
-
-/*!
- * \brief map gc_job_status_t into a string
- */
-const std::string
-gc_job_status_string(gc_job_status_t status);
-
-/*
- * \brief Options that configure the job_manager.
- * The default values are reasonable.
- */
-struct gc_jm_options {
- unsigned int max_jobs; // max # of job descriptors in system
- unsigned int max_client_threads; // max # of client threads of job manager
- unsigned int nspes; // how many SPEs shall we use? 0 -> all of them
- bool gang_schedule; // shall we gang schedule?
- bool use_affinity; // shall we try for affinity (FIXME not implmented)
- bool enable_logging; // shall we log SPE events?
- uint32_t log2_nlog_entries; // log2 of number of log entries (default is 12 == 4k)
- spe_program_handle_sptr program_handle; // program to load into SPEs
-
- gc_jm_options() :
- max_jobs(0), max_client_threads(0), nspes(0),
- gang_schedule(false), use_affinity(false),
- enable_logging(false), log2_nlog_entries(12)
- {
- }
-
- gc_jm_options(spe_program_handle_sptr program_handle_,
- unsigned int nspes_ = 0) :
- max_jobs(0), max_client_threads(0), nspes(nspes_),
- gang_schedule(false), use_affinity(false),
- enable_logging(false), log2_nlog_entries(12),
- program_handle(program_handle_)
- {
- }
-};
-
-enum gc_wait_mode {
- GC_WAIT_ANY,
- GC_WAIT_ALL,
-};
-
-/*
- * exception classes
- */
-class gc_exception : public std::runtime_error
-{
-public:
- gc_exception(const std::string &msg);
-};
-
-class gc_unknown_proc : public gc_exception
-{
-public:
- gc_unknown_proc(const std::string &msg);
-};
-
-class gc_bad_alloc : public gc_exception
-{
-public:
- gc_bad_alloc(const std::string &msg);
-};
-
-class gc_bad_align : public gc_exception
-{
-public:
- gc_bad_align(const std::string &msg);
-};
-
-class gc_bad_submit : public gc_exception
-{
-public:
- gc_bad_submit(const std::string &name, gc_job_status_t status);
-};
-
-/*
- * \brief Create an instance of the job manager
- */
-gc_job_manager_sptr
-gc_make_job_manager(const gc_jm_options *options = 0);
-
-
-/*!
- * \brief Abstract class that manages SPE jobs.
- * \ingroup gcell
- *
- * There is typically a single instance derived from this class.
- * It is safe to call its methods from any thread.
- */
-class gc_job_manager : boost::noncopyable
-{
-public:
- gc_job_manager(const gc_jm_options *options = 0);
-
- virtual ~gc_job_manager();
-
- /*!
- * Stop accepting new jobs. Wait for existing jobs to complete.
- * Return all managed SPE's to the system.
- */
- virtual bool shutdown() = 0;
-
- /*!
- * \brief Return number of SPE's currently allocated to job manager.
- */
- virtual int nspes() const = 0;
-
- /*!
- * \brief Return a pointer to a properly aligned job descriptor,
- * or throws gc_bad_alloc if there are none available.
- */
- virtual gc_job_desc *alloc_job_desc() = 0;
-
- /*
- *! Free a job descriptor previously allocated with alloc_job_desc()
- *
- * \param[in] jd pointer to job descriptor to free.
- */
- virtual void free_job_desc(gc_job_desc *jd) = 0;
-
- /*!
- * \brief Submit a job for asynchronous processing on an SPE.
- *
- * \param[in] jd pointer to job description
- *
- * The caller must not read or write the job description
- * or any of the memory associated with any indirect arguments
- * until after calling wait_job.
- *
- * \returns true iff the job was successfully enqueued.
- * If submit_job returns false, check jd->status for additional info.
- */
- virtual bool submit_job(gc_job_desc *jd) = 0;
-
- /*!
- * \brief Wait for job to complete.
- *
- * A thread may only wait for jobs which it submitted.
- *
- * \returns true if sucessful, else false.
- */
- virtual bool
- wait_job(gc_job_desc *jd) = 0;
-
- /*!
- * \brief wait for 1 or more jobs to complete.
- *
- * \param[in] njobs is the length of arrays \p jd and \p done.
- * \param[in] jd are the jobs that are to be waited for.
- * \param[out] done indicates whether the corresponding job is complete.
- * \param[in] mode indicates whether to wait for ALL or ANY of the jobs
- * in \p jd to complete.
- *
- * A thread may only wait for jobs which it submitted.
- *
- * \returns number of jobs completed, or -1 if error.
- * The caller must examine the status field of each job to confirm
- * successful completion of the job.
- */
- virtual int
- wait_jobs(unsigned int njobs,
- gc_job_desc *jd[], bool done[], gc_wait_mode mode) = 0;
-
- /*!
- * Return the maximum number of bytes of EA arguments that may be
- * copied to or from the SPE in a single job. The limit applies
- * independently to the "get" and "put" args.
- * \sa gc_job_desc_t, gc_job_ea_args_t
- */
- virtual int ea_args_maxsize() = 0;
-
- /*!
- * Return gc_proc_id_t associated with spu procedure \p proc_name if one
- * exists, otherwise throws gc_unknown_proc.
- */
- virtual gc_proc_id_t lookup_proc(const std::string &proc_name) = 0;
-
- /*!
- * Return a vector of all known spu procedure names.
- */
- virtual std::vector<std::string> proc_names() = 0;
-
- virtual void set_debug(int debug);
- virtual int debug();
-
- /* ----- static methods ----- */
-
- /*!
- * \brief Set the singleton gc_job_manager instance.
- * \param mgr is the job manager instance.
- *
- * The singleton is weakly held, thus the caller must maintain
- * a reference to the mgr for the duration. (If we held the
- * manager strongly, the destructor would never be called, and the
- * resources (SPEs) would not be returned.) Bottom line: the
- * caller is responsible for life-time management.
- */
- static void set_singleton(gc_job_manager_sptr mgr);
-
- /*!
- * \brief Retrieve the singleton gc_job_manager instance.
- *
- * Returns the singleton gc_job_manager instance or raises
- * boost::bad_weak_ptr if the singleton is empty.
- */
- static gc_job_manager_sptr singleton();
-
- /*!
- * \brief return a boost::shared_ptr to a job descriptor.
- */
- static gc_job_desc_sptr make_jd_sptr(gc_job_manager_sptr mgr, gc_job_desc *jd);
-
- /*!
- * \brief allocate a job descriptor and return a boost::shared_ptr to it.
- */
- static gc_job_desc_sptr alloc_job_desc(gc_job_manager_sptr mgr);
-};
-
-
-#endif /* INCLUDED_GC_JOB_MANAGER_H */
diff --git a/gcell/include/gcell/gc_logging.h b/gcell/include/gcell/gc_logging.h
deleted file mode 100644
index 9cc6fa77b..000000000
--- a/gcell/include/gcell/gc_logging.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_GC_LOGGING_H
-#define INCLUDED_GCELL_GC_LOGGING_H
-
-#include <gcell/gc_types.h>
-#include <string.h>
-
-__GC_BEGIN_DECLS
-
-typedef struct gc_log {
- gc_eaddr_t base; // gc_log_entry_t * (16 byte aligned)
- uint32_t nentries; // number of entries (power-of-2)
-} gc_log_t;
-
-typedef struct gc_log_entry {
- uint32_t seqno; // monotonic sequence number
- uint32_t timestamp; // decrementer value (wraps every 53s on PS3)
- uint16_t subsystem; // 0 to 255 reserved for system, user gets 256 and up
- uint16_t event;
- uint32_t info[5];
-} _AL16 gc_log_entry_t;
-
-#define GCL_SS_SYS 0 // lowest system reserved subsystem
-#define GCL_SS_USER 256 // lowest user reserved subsystem
-
-
-/*
- * The resulting log files can be displayed using using:
- *
- * $ od -t x4 -w32 spu_log.00 | less
- */
-
-
-#if defined(__SPU__)
-
-/*!
- * System fills in seqno and timestamp. User is responsible for the rest.
- */
-
-void _gc_log_write(gc_log_entry_t entry);
-
-#ifdef ENABLE_GC_LOGGING
-#define gc_log_write(entry) _gc_log_write(entry)
-#else
-#define gc_log_write(entry) do { } while (0)
-#endif
-
-inline static void
-gc_log_write0(int subsystem, int event)
-{
- gc_log_entry_t e;
- e.subsystem = subsystem;
- e.event = event;
- e.info[0] = 0;
- e.info[1] = 0;
- e.info[2] = 0;
- e.info[3] = 0;
- e.info[4] = 0;
- gc_log_write(e);
-}
-
-inline static void
-gc_log_write1(int subsystem, int event,
- uint32_t info0)
-{
- gc_log_entry_t e;
- e.subsystem = subsystem;
- e.event = event;
- e.info[0] = info0;
- e.info[1] = 0;
- e.info[2] = 0;
- e.info[3] = 0;
- e.info[4] = 0;
- gc_log_write(e);
-}
-
-inline static void
-gc_log_write2(int subsystem, int event,
- uint32_t info0, uint32_t info1)
-{
- gc_log_entry_t e;
- e.subsystem = subsystem;
- e.event = event;
- e.info[0] = info0;
- e.info[1] = info1;
- e.info[2] = 0;
- e.info[3] = 0;
- e.info[4] = 0;
- gc_log_write(e);
-}
-
-inline static void
-gc_log_write3(int subsystem, int event,
- uint32_t info0, uint32_t info1, uint32_t info2)
-{
- gc_log_entry_t e;
- e.subsystem = subsystem;
- e.event = event;
- e.info[0] = info0;
- e.info[1] = info1;
- e.info[2] = info2;
- e.info[3] = 0;
- e.info[4] = 0;
- gc_log_write(e);
-}
-
-inline static void
-gc_log_write4(int subsystem, int event,
- uint32_t info0, uint32_t info1, uint32_t info2, uint32_t info3)
-{
- gc_log_entry_t e;
- e.subsystem = subsystem;
- e.event = event;
- e.info[0] = info0;
- e.info[1] = info1;
- e.info[2] = info2;
- e.info[3] = info3;
- e.info[4] = 0;
- gc_log_write(e);
-}
-
-inline static void
-gc_log_write5(int subsystem, int event,
- uint32_t info0, uint32_t info1, uint32_t info2, uint32_t info3, uint32_t info4)
-{
- gc_log_entry_t e;
- e.subsystem = subsystem;
- e.event = event;
- e.info[0] = info0;
- e.info[1] = info1;
- e.info[2] = info2;
- e.info[3] = info3;
- e.info[4] = info4;
- gc_log_write(e);
-}
-
-/*!
- * One time initialization called by system runtime
- */
-void
-_gc_log_init(gc_log_t log_info);
-
-#endif
-
-__GC_END_DECLS
-
-#endif /* INCLUDED_GCELL_GC_LOGGING_H */
diff --git a/gcell/include/gcell/gc_mbox.h b/gcell/include/gcell/gc_mbox.h
deleted file mode 100644
index 9793401f1..000000000
--- a/gcell/include/gcell/gc_mbox.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_GC_MBOX_H
-#define INCLUDED_GCELL_GC_MBOX_H
-
-/*
- * The PPE and SPE exchange a few 32-bit messages via mailboxes.
- * All have a 4 bit opcode in the high bits.
- *
- * 3 2 1
- * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- * | op | arg |
- * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- *
- */
-
-#define MK_MBOX_MSG(cmd, args) ((((cmd) & 0xf) << 28) | ((args) & 0x0fffffff))
-#define MBOX_MSG_OP(msg) (((msg) >> 28) & 0xf)
-#define MBOX_MSG_ARG(msg) ((msg) & 0x0fffffff)
-
-// PPE to SPE (sent via SPE Read Inbound Mailbox)
-
-#define OP_EXIT 0x0 // exit now
-#define OP_GET_SPU_BUFSIZE 0x1
-#define OP_CHECK_QUEUE 0x2
-
-// SPE to PPE (sent via SPE Write Outbound Interrupt Mailbox)
-
-#define OP_JOBS_DONE 0x3 // arg is 0 or 1, indicating which
- // gc_completion_info_t contains the info
-#define OP_SPU_BUFSIZE 0x4 // arg is max number of bytes
-
-
-#endif /* INCLUDED_GCELL_GC_MBOX_H */
diff --git a/gcell/include/gcell/gc_spu_args.h b/gcell/include/gcell/gc_spu_args.h
deleted file mode 100644
index 3719bac22..000000000
--- a/gcell/include/gcell/gc_spu_args.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_GC_SPU_ARGS_H
-#define INCLUDED_GCELL_GC_SPU_ARGS_H
-
-#include <gcell/gc_types.h>
-#include <gcell/gc_logging.h>
-
-// args passed to SPE at initialization time
-
-typedef struct gc_spu_args {
- gc_eaddr_t queue; // address of job queue (gc_jd_queue_t *)
- gc_eaddr_t comp_info[2]; // completion info (gc_comp_info_t *)
- uint32_t spu_idx; // which spu we are: [0,nspus-1]
- uint32_t nspus; // number of spus we're using
- uint32_t proc_def_ls_addr; // LS addr of proc_def table
- uint32_t nproc_defs; // number of proc_defs in table
- gc_log_t log; // logging info
-} _AL16 gc_spu_args_t;
-
-
-#define GC_CI_NJOBS 62 // makes gc_comp_info 1 cache line long
-
-/*!
- * \brief Used to return info to PPE on which jobs are completed.
- *
- * When each SPE is initalized, it is passed EA pointers to two of
- * these structures. The SPE uses these to communicate which jobs
- * that it has worked on are complete. The SPE notifies the PPE by
- * sending an OP_JOBS_DONE message (see gc_mbox.h) with an argument of
- * 0 or 1, indicating which of the two comp_info's to examine. The
- * SPE sets the in_use flag to 1 before DMA'ing to the PPE. When the
- * PPE is done with the structure, it must clear the in_use field to
- * let the SPE know it can begin using it again.
- */
-typedef struct gc_comp_info {
- uint16_t in_use; // set by SPE, cleared by PPE when it's finished
- uint16_t ncomplete; // number of valid job_id's
- uint16_t job_id[GC_CI_NJOBS]; // job_id's of completed jobs
-} _AL128 gc_comp_info_t;
-
-#endif /* INCLUDED_GCELL_GC_SPU_ARGS_H */
diff --git a/gcell/include/gcell/gc_types.h b/gcell/include/gcell/gc_types.h
deleted file mode 100644
index b75bcd8d7..000000000
--- a/gcell/include/gcell/gc_types.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- c -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_GC_TYPES_H
-#define INCLUDED_GCELL_GC_TYPES_H
-
-#include <stdint.h>
-#include <gcell/gc_cdefs.h>
-#include <gcell/compiler.h>
-
-__GC_BEGIN_DECLS
-
-#ifndef __cplusplus
-typedef int bool;
-#define true 1
-#define false 0
-#endif
-
-/*!
- * \brief 64-bit integer type representing an effective address (EA)
- *
- * This type is always 64-bits, regardless of whether we're
- * running in 32 or 64-bit mode.
- */
-typedef uint64_t gc_eaddr_t;
-
-#if !defined(__SPU__)
-static inline void *
-ea_to_ptr(gc_eaddr_t ea)
-{
- // in 32-bit mode we're tossing the top 32-bits.
- return (void *) (uintptr_t) ea;
-}
-
-static inline gc_eaddr_t
-ptr_to_ea(void *p)
-{
- // two steps to avoid compiler warning in 32-bit mode.
- return (gc_eaddr_t) (uintptr_t) p;
-}
-#endif
-
-__GC_END_DECLS
-
-#endif /* INCLUDED_GCELL_GC_TYPES_H */
diff --git a/gcell/include/gcell/gcp_fft_1d_r2.h b/gcell/include/gcell/gcp_fft_1d_r2.h
deleted file mode 100644
index c1d331833..000000000
--- a/gcell/include/gcell/gcp_fft_1d_r2.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCP_FFT_1D_R2_H
-#define INCLUDED_GCP_FFT_1D_R2_H
-
-#include <gcell/gc_job_manager.h>
-#include <complex>
-
-/*!
- * \brief Submit a job that computes the forward or inverse FFT.
- *
- * \param mgr is the job manager instance
- * \param log2_fft_length is the log2 of the fft_length (4 <= x <= 12).
- * \param forward is true to compute the forward transform, else the inverse.
- * \param shift indicates if an "fftshift" should be applied to the output data
- * \param out is the fft_length output from FFT (must be 16-byte aligned).
- * \param in is the fft_length input to FFT (must be 16-byte aligned).
- * \param twiddle is fft_length/4 twiddle factor input to FFT (must be 16-byte aligned).
- * \param window is the window to be applied to the input data.
- * The window length must be either 0 or fft_length (must be 16-byte aligned).
- *
- * Returns a shared_ptr to a job descriptor which should be passed to wait_job*.
- * Throws an exception in the event of a problem.
- * This uses the FFTW conventions for scaling. That is, neither the forward nor inverse
- * are scaled by 1/fft_length.
- */
-gc_job_desc_sptr
-gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
- unsigned int log2_fft_length,
- bool forward,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window);
-
-/*!
- * \brief Compute twiddle factors
- *
- * \param log2_fft_length is the log2 of the fft_length.
- * \param W is fft_length/4 twiddle factor output (must be 16-byte aligned).
- */
-void
-gcp_fft_1d_r2_twiddle(unsigned int log2_fft_length, std::complex<float> *W);
-
-#endif /* INCLUDED_GCP_FFT_1D_R2_H */
diff --git a/gcell/include/gcell/memory_barrier.h b/gcell/include/gcell/memory_barrier.h
deleted file mode 100644
index 4a1f87000..000000000
--- a/gcell/include/gcell/memory_barrier.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_MEMORY_BARRIER_H
-#define INCLUDED_GCELL_MEMORY_BARRIER_H
-
-/*
- * powerpc memory barriers
- *
- * The sync instruction guarantees that all memory accesses initiated
- * by this processor have been performed (with respect to all other
- * mechanisms that access memory). The eieio instruction is a barrier
- * providing an ordering (separately) for (a) cacheable stores and (b)
- * loads and stores to non-cacheable memory (e.g. I/O devices).
- *
- * smp_mb() prevents loads and stores being reordered across this point.
- * smp_rmb() prevents loads being reordered across this point.
- * smp_wmb() prevents stores being reordered across this point.
- *
- * We have to use the sync instructions for smp_mb(), since lwsync
- * doesn't order loads with respect to previous stores. Lwsync is
- * fine for smp_rmb(), though. For smp_wmb(), we use eieio since it
- * is only used to order updates to system memory.
- *
- * For details, see "PowerPC Virtual Environment Architecture, Book
- * II". Especially Chapter 1, "Storage Model" and Chapter 3, "Storage
- * Control Instructions." (site:ibm.com)
- */
-
-static inline void smp_mb(void)
-{
- __asm__ volatile ("sync" : : : "memory");
-}
-
-static inline void smp_rmb(void)
-{
- __asm__ volatile ("lwsync" : : : "memory");
-}
-
-static inline void smp_wmb(void)
-{
- __asm__ volatile ("eieio" : : : "memory");
-}
-
-
-#endif /* INCLUDED_GCELL_MEMORY_BARRIER_H */
diff --git a/gcell/include/gcell/spu/.gitignore b/gcell/include/gcell/spu/.gitignore
deleted file mode 100644
index a02b6ff73..000000000
--- a/gcell/include/gcell/spu/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
diff --git a/gcell/include/gcell/spu/Makefile.am b/gcell/include/gcell/spu/Makefile.am
deleted file mode 100644
index 58816819d..000000000
--- a/gcell/include/gcell/spu/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-gcellspuinclude_HEADERS = \
- fft_1d.h \
- fft_1d_r2.h \
- gc_delay.h \
- gc_jd_queue.h \
- gc_random.h \
- gc_spu_macs.h \
- libfft.h
diff --git a/gcell/include/gcell/spu/fft_1d.h b/gcell/include/gcell/spu/fft_1d.h
deleted file mode 100644
index 355b84bf1..000000000
--- a/gcell/include/gcell/spu/fft_1d.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _FFT_1D_H_
-#define _FFT_1D_H_ 1
-
-#include <spu_intrinsics.h>
-
-/* BIT_SWAP - swaps up to 16 bits of the integer _i according to the
- * pattern specified by _pat.
- */
-#define BIT_SWAP(_i, _pat) spu_extract(spu_gather(spu_shuffle(spu_maskb(_i), _pat, _pat)), 0)
-
-
-#ifndef MAX_FFT_1D_SIZE
-#define MAX_FFT_1D_SIZE 8192
-#endif
-
-#ifndef INV_SQRT_2
-#define INV_SQRT_2 0.7071067811865
-#endif
-
-
-/* The following macro, FFT_1D_BUTTERFLY, performs a 4 way SIMD basic butterfly
- * operation. The inputs are in parallel arrays (seperate real and imaginary
- * vectors).
- *
- * p --------------------------> P = p + q*Wi
- * \ /
- * \ /
- * \ /
- * \/
- * /\
- * / \
- * / \
- * ____ / \
- * q --| Wi |-----------------> Q = p - q*Wi
- * ----
- */
-
-#define FFT_1D_BUTTERFLY(_P_re, _P_im, _Q_re, _Q_im, _p_re, _p_im, _q_re, _q_im, _W_re, _W_im) { \
- vector float _qw_re, _qw_im; \
- \
- _qw_re = spu_msub(_q_re, _W_re, spu_mul(_q_im, _W_im)); \
- _qw_im = spu_madd(_q_re, _W_im, spu_mul(_q_im, _W_re)); \
- _P_re = spu_add(_p_re, _qw_re); \
- _P_im = spu_add(_p_im, _qw_im); \
- _Q_re = spu_sub(_p_re, _qw_re); \
- _Q_im = spu_sub(_p_im, _qw_im); \
-}
-
-
-/* FFT_1D_BUTTERFLY_HI is equivalent to FFT_1D_BUTTERFLY with twiddle factors (W_im, -W_re)
- */
-#define FFT_1D_BUTTERFLY_HI(_P_re, _P_im, _Q_re, _Q_im, _p_re, _p_im, _q_re, _q_im, _W_re, _W_im) { \
- vector float _qw_re, _qw_im; \
- \
- _qw_re = spu_madd(_q_re, _W_im, spu_mul(_q_im, _W_re)); \
- _qw_im = spu_msub(_q_im, _W_im, spu_mul(_q_re, _W_re)); \
- _P_re = spu_add(_p_re, _qw_re); \
- _P_im = spu_add(_p_im, _qw_im); \
- _Q_re = spu_sub(_p_re, _qw_re); \
- _Q_im = spu_sub(_p_im, _qw_im); \
-}
-
-#endif /* _FFT_1D_H_ */
diff --git a/gcell/include/gcell/spu/fft_1d_r2.h b/gcell/include/gcell/spu/fft_1d_r2.h
deleted file mode 100644
index a51cbc341..000000000
--- a/gcell/include/gcell/spu/fft_1d_r2.h
+++ /dev/null
@@ -1,529 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-#ifndef _FFT_1D_R2_H_
-#define _FFT_1D_R2_H_ 1
-
-#include "fft_1d.h"
-
-/* fft_1d_r2
- * ---------
- * Performs a single precision, complex Fast Fourier Transform using
- * the DFT (Discrete Fourier Transform) with radix-2 decimation in time.
- * The input <in> is an array of complex numbers of length (1<<log2_size)
- * entries. The result is returned in the array of complex numbers specified
- * by <out>. Note: This routine can support an in-place transformation
- * by specifying <in> and <out> to be the same array.
- *
- * This implementation utilizes the Cooley-Tukey algorithm consisting
- * of <log2_size> stages. The basic operation is the butterfly.
- *
- * p --------------------------> P = p + q*Wi
- * \ /
- * \ /
- * \ /
- * \/
- * /\
- * / \
- * / \
- * ____ / \
- * q --| Wi |-----------------> Q = p - q*Wi
- * ----
- *
- * This routine also requires pre-computed twiddle values, W. W is an
- * array of single precision complex numbers of length 1<<(log2_size-2)
- * and is computed as follows:
- *
- * for (i=0; i<n/4; i++)
- * W[i].real = cos(i * 2*PI/n);
- * W[i].imag = -sin(i * 2*PI/n);
- * }
- *
- * This array actually only contains the first half of the twiddle
- * factors. Due for symmetry, the second half of the twiddle factors
- * are implied and equal:
- *
- * for (i=0; i<n/4; i++)
- * W[i+n/4].real = W[i].imag = sin(i * 2*PI/n);
- * W[i+n/4].imag = -W[i].real = -cos(i * 2*PI/n);
- * }
- *
- * Further symmetry allows one to generate the twiddle factor table
- * using half the number of trig computations as follows:
- *
- * W[0].real = 1.0;
- * W[0].imag = 0.0;
- * for (i=1; i<n/4; i++)
- * W[i].real = cos(i * 2*PI/n);
- * W[n/4 - i].imag = -W[i].real;
- * }
- *
- * The complex numbers are packed into quadwords as follows:
- *
- * quadword complex
- * array element array elements
- * -----------------------------------------------------
- * i | real 2*i | imag 2*i | real 2*i+1 | imag 2*i+1 |
- * -----------------------------------------------------
- *
- */
-
-
-static __inline void _fft_1d_r2(vector float *out, vector float *in, vector float *W, int log2_size)
-{
- int i, j, k;
- int stage, offset;
- int i_rev;
- int n, n_2, n_4, n_8, n_16, n_3_16;
- int w_stride, w_2stride, w_3stride, w_4stride;
- int stride, stride_2, stride_4, stride_3_4;
- vector float *W0, *W1, *W2, *W3;
- vector float *re0, *re1, *re2, *re3;
- vector float *im0, *im1, *im2, *im3;
- vector float *in0, *in1, *in2, *in3, *in4, *in5, *in6, *in7;
- vector float *out0, *out1, *out2, *out3;
- vector float tmp0, tmp1;
- vector float w0_re, w0_im, w1_re, w1_im;
- vector float w0, w1, w2, w3;
- vector float src_lo0, src_lo1, src_lo2, src_lo3;
- vector float src_hi0, src_hi1, src_hi2, src_hi3;
- vector float dst_lo0, dst_lo1, dst_lo2, dst_lo3;
- vector float dst_hi0, dst_hi1, dst_hi2, dst_hi3;
- vector float out_re_lo0, out_re_lo1, out_re_lo2, out_re_lo3;
- vector float out_im_lo0, out_im_lo1, out_im_lo2, out_im_lo3;
- vector float out_re_hi0, out_re_hi1, out_re_hi2, out_re_hi3;
- vector float out_im_hi0, out_im_hi1, out_im_hi2, out_im_hi3;
- vector float re_lo0, re_lo1, re_lo2, re_lo3;
- vector float im_lo0, im_lo1, im_lo2, im_lo3;
- vector float re_hi0, re_hi1, re_hi2, re_hi3;
- vector float im_hi0, im_hi1, im_hi2, im_hi3;
- vector float pq_lo0, pq_lo1, pq_lo2, pq_lo3;
- vector float pq_hi0, pq_hi1, pq_hi2, pq_hi3;
- vector float re[MAX_FFT_1D_SIZE/4], im[MAX_FFT_1D_SIZE/4]; /* real & imaginary working arrays */
- vector float ppmm = (vector float) { 1.0f, 1.0f, -1.0f, -1.0f};
- vector float pmmp = (vector float) { 1.0f, -1.0f, -1.0f, 1.0f};
- vector unsigned char reverse;
- vector unsigned char shuf_lo = (vector unsigned char) {
- 0, 1, 2, 3, 4, 5, 6, 7,
- 16,17,18,19, 20,21,22,23};
- vector unsigned char shuf_hi = (vector unsigned char) {
- 8, 9,10,11, 12,13,14,15,
- 24,25,26,27, 28,29,30,31};
- vector unsigned char shuf_0202 = (vector unsigned char) {
- 0, 1, 2, 3, 8, 9,10,11,
- 0, 1, 2, 3, 8, 9,10,11};
- vector unsigned char shuf_1313 = (vector unsigned char) {
- 4, 5, 6, 7, 12,13,14,15,
- 4, 5, 6, 7, 12,13,14,15};
- vector unsigned char shuf_0303 = (vector unsigned char) {
- 0, 1, 2, 3, 12,13,14,15,
- 0, 1, 2, 3, 12,13,14,15};
- vector unsigned char shuf_1212 = (vector unsigned char) {
- 4, 5, 6, 7, 8, 9,10,11,
- 4, 5, 6, 7, 8, 9,10,11};
- vector unsigned char shuf_0415 = (vector unsigned char) {
- 0, 1, 2, 3, 16,17,18,19,
- 4, 5, 6, 7, 20,21,22,23};
- vector unsigned char shuf_2637 = (vector unsigned char) {
- 8, 9,10,11, 24,25,26,27,
- 12,13,14,15,28,29,30,31};
- vector unsigned char shuf_0246 = (vector unsigned char) {
- 0, 1, 2, 3, 8, 9,10,11,
- 16,17,18,19,24,25,26,27};
- vector unsigned char shuf_1357 = (vector unsigned char) {
- 4, 5, 6, 7, 12,13,14,15,
- 20,21,22,23,28,29,30,31};
-
- n = 1 << log2_size;
- n_2 = n >> 1;
- n_4 = n >> 2;
- n_8 = n >> 3;
- n_16 = n >> 4;
-
- n_3_16 = n_8 + n_16;
-
- /* Compute a byte reverse shuffle pattern to be used to produce
- * an address bit swap.
- */
- reverse = spu_or(spu_slqwbyte(spu_splats((unsigned char)0x80), log2_size),
- spu_rlmaskqwbyte(((vec_uchar16){15,14,13,12, 11,10,9,8,
- 7, 6, 5, 4, 3, 2,1,0}),
- log2_size-16));
-
- /* Perform the first 3 stages of the FFT. These stages differs from
- * other stages in that the inputs are unscrambled and the data is
- * reformated into parallel arrays (ie, seperate real and imaginary
- * arrays). The term "unscramble" means the bit address reverse the
- * data array. In addition, the first three stages have simple twiddle
- * weighting factors.
- * stage 1: (1, 0)
- * stage 2: (1, 0) and (0, -1)
- * stage 3: (1, 0), (0.707, -0.707), (0, -1), (-0.707, -0.707)
- *
- * The arrays are processed as two halves, simultaneously. The lo (first
- * half) and hi (second half). This is done because the scramble
- * shares source value between each half of the output arrays.
- */
- i = 0;
- i_rev = 0;
-
- in0 = in;
- in1 = in + n_8;
- in2 = in + n_16;
- in3 = in + n_3_16;
-
- in4 = in + n_4;
- in5 = in1 + n_4;
- in6 = in2 + n_4;
- in7 = in3 + n_4;
-
- re0 = re;
- re1 = re + n_8;
- im0 = im;
- im1 = im + n_8;
-
- w0_re = (vector float) { 1.0f, INV_SQRT_2, 0.0f, -INV_SQRT_2};
- w0_im = (vector float) { 0.0f, -INV_SQRT_2, -1.0f, -INV_SQRT_2};
-
- do {
- src_lo0 = in0[i_rev];
- src_lo1 = in1[i_rev];
- src_lo2 = in2[i_rev];
- src_lo3 = in3[i_rev];
-
- src_hi0 = in4[i_rev];
- src_hi1 = in5[i_rev];
- src_hi2 = in6[i_rev];
- src_hi3 = in7[i_rev];
-
- /* Perform scramble.
- */
- dst_lo0 = spu_shuffle(src_lo0, src_hi0, shuf_lo);
- dst_hi0 = spu_shuffle(src_lo0, src_hi0, shuf_hi);
- dst_lo1 = spu_shuffle(src_lo1, src_hi1, shuf_lo);
- dst_hi1 = spu_shuffle(src_lo1, src_hi1, shuf_hi);
- dst_lo2 = spu_shuffle(src_lo2, src_hi2, shuf_lo);
- dst_hi2 = spu_shuffle(src_lo2, src_hi2, shuf_hi);
- dst_lo3 = spu_shuffle(src_lo3, src_hi3, shuf_lo);
- dst_hi3 = spu_shuffle(src_lo3, src_hi3, shuf_hi);
-
- /* Perform the stage 1 butterfly. The multiplier constant, ppmm,
- * is used to control the sign of the operands since a single
- * quadword contains both of P and Q valule of the butterfly.
- */
- pq_lo0 = spu_madd(ppmm, dst_lo0, spu_rlqwbyte(dst_lo0, 8));
- pq_hi0 = spu_madd(ppmm, dst_hi0, spu_rlqwbyte(dst_hi0, 8));
- pq_lo1 = spu_madd(ppmm, dst_lo1, spu_rlqwbyte(dst_lo1, 8));
- pq_hi1 = spu_madd(ppmm, dst_hi1, spu_rlqwbyte(dst_hi1, 8));
- pq_lo2 = spu_madd(ppmm, dst_lo2, spu_rlqwbyte(dst_lo2, 8));
- pq_hi2 = spu_madd(ppmm, dst_hi2, spu_rlqwbyte(dst_hi2, 8));
- pq_lo3 = spu_madd(ppmm, dst_lo3, spu_rlqwbyte(dst_lo3, 8));
- pq_hi3 = spu_madd(ppmm, dst_hi3, spu_rlqwbyte(dst_hi3, 8));
-
- /* Perfrom the stage 2 butterfly. For this stage, the
- * inputs pq are still interleaved (p.real, p.imag, q.real,
- * q.imag), so we must first re-order the data into
- * parallel arrays as well as perform the reorder
- * associated with the twiddle W[n/4], which equals
- * (0, -1).
- *
- * ie. (A, B) * (0, -1) => (B, -A)
- */
- re_lo0 = spu_madd(ppmm,
- spu_shuffle(pq_lo1, pq_lo1, shuf_0303),
- spu_shuffle(pq_lo0, pq_lo0, shuf_0202));
- im_lo0 = spu_madd(pmmp,
- spu_shuffle(pq_lo1, pq_lo1, shuf_1212),
- spu_shuffle(pq_lo0, pq_lo0, shuf_1313));
-
- re_lo1 = spu_madd(ppmm,
- spu_shuffle(pq_lo3, pq_lo3, shuf_0303),
- spu_shuffle(pq_lo2, pq_lo2, shuf_0202));
- im_lo1 = spu_madd(pmmp,
- spu_shuffle(pq_lo3, pq_lo3, shuf_1212),
- spu_shuffle(pq_lo2, pq_lo2, shuf_1313));
-
-
- re_hi0 = spu_madd(ppmm,
- spu_shuffle(pq_hi1, pq_hi1, shuf_0303),
- spu_shuffle(pq_hi0, pq_hi0, shuf_0202));
- im_hi0 = spu_madd(pmmp,
- spu_shuffle(pq_hi1, pq_hi1, shuf_1212),
- spu_shuffle(pq_hi0, pq_hi0, shuf_1313));
-
- re_hi1 = spu_madd(ppmm,
- spu_shuffle(pq_hi3, pq_hi3, shuf_0303),
- spu_shuffle(pq_hi2, pq_hi2, shuf_0202));
- im_hi1 = spu_madd(pmmp,
- spu_shuffle(pq_hi3, pq_hi3, shuf_1212),
- spu_shuffle(pq_hi2, pq_hi2, shuf_1313));
-
-
- /* Perform stage 3 butterfly.
- */
- FFT_1D_BUTTERFLY(re0[0], im0[0], re0[1], im0[1], re_lo0, im_lo0, re_lo1, im_lo1, w0_re, w0_im);
- FFT_1D_BUTTERFLY(re1[0], im1[0], re1[1], im1[1], re_hi0, im_hi0, re_hi1, im_hi1, w0_re, w0_im);
-
- re0 += 2;
- re1 += 2;
- im0 += 2;
- im1 += 2;
-
- i += 8;
- i_rev = BIT_SWAP(i, reverse) / 2;
- } while (i < n_2);
-
- /* Process stages 4 to log2_size-2
- */
- for (stage=4, stride=4; stage<log2_size-1; stage++, stride += stride) {
- w_stride = n_2 >> stage;
- w_2stride = n >> stage;
- w_3stride = w_stride + w_2stride;
- w_4stride = w_2stride + w_2stride;
-
- W0 = W;
- W1 = W + w_stride;
- W2 = W + w_2stride;
- W3 = W + w_3stride;
-
- stride_2 = stride >> 1;
- stride_4 = stride >> 2;
- stride_3_4 = stride_2 + stride_4;
-
- re0 = re; im0 = im;
- re1 = re + stride_2; im1 = im + stride_2;
- re2 = re + stride_4; im2 = im + stride_4;
- re3 = re + stride_3_4; im3 = im + stride_3_4;
-
- for (i=0, offset=0; i<stride_4; i++, offset += w_4stride) {
- /* Compute the twiddle factors
- */
- w0 = W0[offset];
- w1 = W1[offset];
- w2 = W2[offset];
- w3 = W3[offset];
-
- tmp0 = spu_shuffle(w0, w2, shuf_0415);
- tmp1 = spu_shuffle(w1, w3, shuf_0415);
-
- w0_re = spu_shuffle(tmp0, tmp1, shuf_0415);
- w0_im = spu_shuffle(tmp0, tmp1, shuf_2637);
-
- j = i;
- k = i + stride;
- do {
- re_lo0 = re0[j]; im_lo0 = im0[j];
- re_lo1 = re1[j]; im_lo1 = im1[j];
-
- re_hi0 = re2[j]; im_hi0 = im2[j];
- re_hi1 = re3[j]; im_hi1 = im3[j];
-
- re_lo2 = re0[k]; im_lo2 = im0[k];
- re_lo3 = re1[k]; im_lo3 = im1[k];
-
- re_hi2 = re2[k]; im_hi2 = im2[k];
- re_hi3 = re3[k]; im_hi3 = im3[k];
-
- FFT_1D_BUTTERFLY (re0[j], im0[j], re1[j], im1[j], re_lo0, im_lo0, re_lo1, im_lo1, w0_re, w0_im);
- FFT_1D_BUTTERFLY_HI(re2[j], im2[j], re3[j], im3[j], re_hi0, im_hi0, re_hi1, im_hi1, w0_re, w0_im);
-
- FFT_1D_BUTTERFLY (re0[k], im0[k], re1[k], im1[k], re_lo2, im_lo2, re_lo3, im_lo3, w0_re, w0_im);
- FFT_1D_BUTTERFLY_HI(re2[k], im2[k], re3[k], im3[k], re_hi2, im_hi2, re_hi3, im_hi3, w0_re, w0_im);
-
- j += 2 * stride;
- k += 2 * stride;
- } while (j < n_4);
- }
- }
-
- /* Process stage log2_size-1. This is identical to the stage processing above
- * except for this stage the inner loop is only executed once so it is removed
- * entirely.
- */
- w_stride = n_2 >> stage;
- w_2stride = n >> stage;
- w_3stride = w_stride + w_2stride;
- w_4stride = w_2stride + w_2stride;
-
- stride_2 = stride >> 1;
- stride_4 = stride >> 2;
-
- stride_3_4 = stride_2 + stride_4;
-
- re0 = re; im0 = im;
- re1 = re + stride_2; im1 = im + stride_2;
- re2 = re + stride_4; im2 = im + stride_4;
- re3 = re + stride_3_4; im3 = im + stride_3_4;
-
- for (i=0, offset=0; i<stride_4; i++, offset += w_4stride) {
- /* Compute the twiddle factors
- */
- w0 = W[offset];
- w1 = W[offset + w_stride];
- w2 = W[offset + w_2stride];
- w3 = W[offset + w_3stride];
-
- tmp0 = spu_shuffle(w0, w2, shuf_0415);
- tmp1 = spu_shuffle(w1, w3, shuf_0415);
-
- w0_re = spu_shuffle(tmp0, tmp1, shuf_0415);
- w0_im = spu_shuffle(tmp0, tmp1, shuf_2637);
-
- j = i;
- k = i + stride;
-
- re_lo0 = re0[j]; im_lo0 = im0[j];
- re_lo1 = re1[j]; im_lo1 = im1[j];
-
- re_hi0 = re2[j]; im_hi0 = im2[j];
- re_hi1 = re3[j]; im_hi1 = im3[j];
-
- re_lo2 = re0[k]; im_lo2 = im0[k];
- re_lo3 = re1[k]; im_lo3 = im1[k];
-
- re_hi2 = re2[k]; im_hi2 = im2[k];
- re_hi3 = re3[k]; im_hi3 = im3[k];
-
- FFT_1D_BUTTERFLY (re0[j], im0[j], re1[j], im1[j], re_lo0, im_lo0, re_lo1, im_lo1, w0_re, w0_im);
- FFT_1D_BUTTERFLY_HI(re2[j], im2[j], re3[j], im3[j], re_hi0, im_hi0, re_hi1, im_hi1, w0_re, w0_im);
-
- FFT_1D_BUTTERFLY (re0[k], im0[k], re1[k], im1[k], re_lo2, im_lo2, re_lo3, im_lo3, w0_re, w0_im);
- FFT_1D_BUTTERFLY_HI(re2[k], im2[k], re3[k], im3[k], re_hi2, im_hi2, re_hi3, im_hi3, w0_re, w0_im);
- }
-
-
- /* Process the final stage (stage log2_size). For this stage,
- * reformat the data from parallel arrays back into
- * interleaved arrays,storing the result into <in>.
- *
- * This loop has been manually unrolled by 2 to improve
- * dual issue rates and reduce stalls. This unrolling
- * forces a minimum FFT size of 32.
- */
- re0 = re;
- re1 = re + n_8;
- re2 = re + n_16;
- re3 = re + n_3_16;
-
- im0 = im;
- im1 = im + n_8;
- im2 = im + n_16;
- im3 = im + n_3_16;
-
- out0 = out;
- out1 = out + n_4;
- out2 = out + n_8;
- out3 = out1 + n_8;
-
- i = n_16;
-
- do {
- /* Fetch the twiddle factors
- */
- w0 = W[0];
- w1 = W[1];
- w2 = W[2];
- w3 = W[3];
-
- W += 4;
-
- w0_re = spu_shuffle(w0, w1, shuf_0246);
- w0_im = spu_shuffle(w0, w1, shuf_1357);
- w1_re = spu_shuffle(w2, w3, shuf_0246);
- w1_im = spu_shuffle(w2, w3, shuf_1357);
-
- /* Fetch the butterfly inputs, reals and imaginaries
- */
- re_lo0 = re0[0]; im_lo0 = im0[0];
- re_lo1 = re1[0]; im_lo1 = im1[0];
- re_lo2 = re0[1]; im_lo2 = im0[1];
- re_lo3 = re1[1]; im_lo3 = im1[1];
-
- re_hi0 = re2[0]; im_hi0 = im2[0];
- re_hi1 = re3[0]; im_hi1 = im3[0];
- re_hi2 = re2[1]; im_hi2 = im2[1];
- re_hi3 = re3[1]; im_hi3 = im3[1];
-
- re0 += 2; im0 += 2;
- re1 += 2; im1 += 2;
- re2 += 2; im2 += 2;
- re3 += 2; im3 += 2;
-
- /* Perform the butterflys
- */
- FFT_1D_BUTTERFLY (out_re_lo0, out_im_lo0, out_re_lo1, out_im_lo1, re_lo0, im_lo0, re_lo1, im_lo1, w0_re, w0_im);
- FFT_1D_BUTTERFLY (out_re_lo2, out_im_lo2, out_re_lo3, out_im_lo3, re_lo2, im_lo2, re_lo3, im_lo3, w1_re, w1_im);
-
- FFT_1D_BUTTERFLY_HI(out_re_hi0, out_im_hi0, out_re_hi1, out_im_hi1, re_hi0, im_hi0, re_hi1, im_hi1, w0_re, w0_im);
- FFT_1D_BUTTERFLY_HI(out_re_hi2, out_im_hi2, out_re_hi3, out_im_hi3, re_hi2, im_hi2, re_hi3, im_hi3, w1_re, w1_im);
-
- /* Interleave the results and store them into the output buffers (ie,
- * the original input buffers.
- */
- out0[0] = spu_shuffle(out_re_lo0, out_im_lo0, shuf_0415);
- out0[1] = spu_shuffle(out_re_lo0, out_im_lo0, shuf_2637);
- out0[2] = spu_shuffle(out_re_lo2, out_im_lo2, shuf_0415);
- out0[3] = spu_shuffle(out_re_lo2, out_im_lo2, shuf_2637);
-
- out1[0] = spu_shuffle(out_re_lo1, out_im_lo1, shuf_0415);
- out1[1] = spu_shuffle(out_re_lo1, out_im_lo1, shuf_2637);
- out1[2] = spu_shuffle(out_re_lo3, out_im_lo3, shuf_0415);
- out1[3] = spu_shuffle(out_re_lo3, out_im_lo3, shuf_2637);
-
- out2[0] = spu_shuffle(out_re_hi0, out_im_hi0, shuf_0415);
- out2[1] = spu_shuffle(out_re_hi0, out_im_hi0, shuf_2637);
- out2[2] = spu_shuffle(out_re_hi2, out_im_hi2, shuf_0415);
- out2[3] = spu_shuffle(out_re_hi2, out_im_hi2, shuf_2637);
-
- out3[0] = spu_shuffle(out_re_hi1, out_im_hi1, shuf_0415);
- out3[1] = spu_shuffle(out_re_hi1, out_im_hi1, shuf_2637);
- out3[2] = spu_shuffle(out_re_hi3, out_im_hi3, shuf_0415);
- out3[3] = spu_shuffle(out_re_hi3, out_im_hi3, shuf_2637);
-
- out0 += 4;
- out1 += 4;
- out2 += 4;
- out3 += 4;
-
- i -= 2;
- } while (i);
-}
-
-#endif /* _FFT_1D_R2_H_ */
diff --git a/gcell/include/gcell/spu/gc_delay.h b/gcell/include/gcell/spu/gc_delay.h
deleted file mode 100644
index e995b3a94..000000000
--- a/gcell/include/gcell/spu/gc_delay.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_SPU_GC_DELAY_H
-#define INCLUDED_GCELL_SPU_GC_DELAY_H
-
-void gc_udelay(unsigned int usecs);
-void gc_cdelay(unsigned int cpu_cycles);
-
-#endif /* INCLUDED_GCELL_SPU_GC_DELAY_H */
diff --git a/gcell/include/gcell/spu/gc_jd_queue.h b/gcell/include/gcell/spu/gc_jd_queue.h
deleted file mode 100644
index c2300478c..000000000
--- a/gcell/include/gcell/spu/gc_jd_queue.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GCELL_SPU_GC_JD_QUEUE_H
-#define INCLUDED_GCELL_SPU_GC_JD_QUEUE_H
-
-#include <gcell/gc_jd_queue_data.h>
-
-/*
- * Declarations for SPU side of job queue interface
- */
-
-__GC_BEGIN_DECLS
-
-typedef enum {
- GCQ_OK, // Got an item
- GCQ_EMPTY, // Q is empty
- GCQ_LOCKED, // Somebody else has the queue locked
-} gc_dequeue_status_t;
-
-/*!
- * \brief Remove and return item at head of queue.
- *
- * \param[in] q is EA address of queue structure.
- * \param[out] item_ea is EA address of item at head of queue.
- * \param[in] jd_tag is the tag to use to get the LS copy of the item.
- * \param[out] item is local store copy of item at head of queue.
- * \returns false if the queue is empty, otherwise returns true
- * and sets \p item_ea and DMA's job descriptor into \p item
- *
- * If return is not GCQ_OK, we're holding a lock-line reservation that
- * covers the queue.
- */
-gc_dequeue_status_t
-gc_jd_queue_dequeue(gc_eaddr_t q, gc_eaddr_t *item_ea,
- int jd_tag, gc_job_desc_t *item);
-
-__GC_END_DECLS
-
-
-#endif /* INCLUDED_GCELL_SPU_GC_JD_QUEUE_H */
diff --git a/gcell/include/gcell/spu/gc_random.h b/gcell/include/gcell/spu/gc_random.h
deleted file mode 100644
index f51b187d4..000000000
--- a/gcell/include/gcell/spu/gc_random.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_SPU_GC_RANDOM_H
-#define INCLUDED_GCELL_SPU_GC_RANDOM_H
-
-/*!
- * \brief Return a uniformly distributed value in the range [0, 1.0)
- * (Linear congruential generator. YMMV. Caveat emptor.)
- */
-
-float gc_uniform_deviate(void);
-void gc_set_seed(int seed);
-
-#endif /* INCLUDED_GCELL_SPU_GC_RANDOM_H */
diff --git a/gcell/include/gcell/spu/gc_spu_macs.h b/gcell/include/gcell/spu/gc_spu_macs.h
deleted file mode 100644
index 0d7dc9978..000000000
--- a/gcell/include/gcell/spu/gc_spu_macs.h
+++ /dev/null
@@ -1,380 +0,0 @@
-/* -*- asm -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_GC_SPU_MACS_H
-#define INCLUDED_GC_SPU_MACS_H
-
-/*
- * This file contains a set of macros that are generally useful when
- * coding in SPU assembler
- *
- * Note that the multi-instruction macros in here may overwrite
- * registers 77, 78, and 79 without warning.
- */
-
-/*
- * defines for all registers
- */
-#define r0 $0
-#define r1 $1
-#define r2 $2
-#define r3 $3
-#define r4 $4
-#define r5 $5
-#define r6 $6
-#define r7 $7
-#define r8 $8
-#define r9 $9
-#define r10 $10
-#define r11 $11
-#define r12 $12
-#define r13 $13
-#define r14 $14
-#define r15 $15
-#define r16 $16
-#define r17 $17
-#define r18 $18
-#define r19 $19
-#define r20 $20
-#define r21 $21
-#define r22 $22
-#define r23 $23
-#define r24 $24
-#define r25 $25
-#define r26 $26
-#define r27 $27
-#define r28 $28
-#define r29 $29
-#define r30 $30
-#define r31 $31
-#define r32 $32
-#define r33 $33
-#define r34 $34
-#define r35 $35
-#define r36 $36
-#define r37 $37
-#define r38 $38
-#define r39 $39
-#define r40 $40
-#define r41 $41
-#define r42 $42
-#define r43 $43
-#define r44 $44
-#define r45 $45
-#define r46 $46
-#define r47 $47
-#define r48 $48
-#define r49 $49
-#define r50 $50
-#define r51 $51
-#define r52 $52
-#define r53 $53
-#define r54 $54
-#define r55 $55
-#define r56 $56
-#define r57 $57
-#define r58 $58
-#define r59 $59
-#define r60 $60
-#define r61 $61
-#define r62 $62
-#define r63 $63
-#define r64 $64
-#define r65 $65
-#define r66 $66
-#define r67 $67
-#define r68 $68
-#define r69 $69
-#define r70 $70
-#define r71 $71
-#define r72 $72
-#define r73 $73
-#define r74 $74
-#define r75 $75
-#define r76 $76
-#define r77 $77
-#define r78 $78
-#define r79 $79
-#define r80 $80
-#define r81 $81
-#define r82 $82
-#define r83 $83
-#define r84 $84
-#define r85 $85
-#define r86 $86
-#define r87 $87
-#define r88 $88
-#define r89 $89
-#define r90 $90
-#define r91 $91
-#define r92 $92
-#define r93 $93
-#define r94 $94
-#define r95 $95
-#define r96 $96
-#define r97 $97
-#define r98 $98
-#define r99 $99
-#define r100 $100
-#define r101 $101
-#define r102 $102
-#define r103 $103
-#define r104 $104
-#define r105 $105
-#define r106 $106
-#define r107 $107
-#define r108 $108
-#define r109 $109
-#define r110 $110
-#define r111 $111
-#define r112 $112
-#define r113 $113
-#define r114 $114
-#define r115 $115
-#define r116 $116
-#define r117 $117
-#define r118 $118
-#define r119 $119
-#define r120 $120
-#define r121 $121
-#define r122 $122
-#define r123 $123
-#define r124 $124
-#define r125 $125
-#define r126 $126
-#define r127 $127
-
-
-#define lr r0 // link register
-#define sp r1 // stack pointer
- // r2 is environment pointer for langs that need it (ALGOL)
-
-#define retval r3 // return values are passed in regs starting at r3
-
-#define arg1 r3 // args are passed in regs starting at r3
-#define arg2 r4
-#define arg3 r5
-#define arg4 r6
-#define arg5 r7
-#define arg6 r8
-#define arg7 r9
-#define arg8 r10
-#define arg9 r11
-#define arg10 r12
-
-// r3 - r74 are volatile (caller saves)
-// r74 - r79 are volatile (scratch regs possibly destroyed by fct prolog/epilog)
-// r80 - r127 are non-volatile (callee-saves)
-
-// scratch registers reserved for use by the macros in this file.
-
-#define _gc_t0 r79
-#define _gc_t1 r78
-#define _gc_t2 r77
-
-/*
- * ----------------------------------------------------------------
- * pseudo ops
- * ----------------------------------------------------------------
- */
-#define PROC_ENTRY(name) \
- .text; \
- .p2align 4; \
- .global name; \
- .type name, @function; \
-name:
-
-/*
- * ----------------------------------------------------------------
- * aliases for common operations
- * ----------------------------------------------------------------
- */
-
-// Move register (even pipe, 2 cycles)
-#define MR(rt, ra) or rt, ra, ra;
-
-// Move register (odd pipe, 4 cycles)
-#define LMR(rt, ra) rotqbyi rt, ra, 0;
-
-// return
-#define RETURN() bi lr;
-
-// hint for a return
-#define HINT_RETURN(ret_label) hbr ret_label, lr;
-
-// return if zero
-#define BRZ_RETURN(rt) biz rt, lr;
-
-// return if not zero
-#define BRNZ_RETURN(rt) binz rt, lr;
-
-// return if halfword zero
-#define BRHZ_RETURN(rt) bihz rt, lr;
-
-// return if halfword not zero
-#define BRHNZ_RETURN(rt) bihnz rt, lr;
-
-
-/*
- * ----------------------------------------------------------------
- * modulo like things for constant moduli that are powers of 2
- * ----------------------------------------------------------------
- */
-
-// rt = ra & (pow2 - 1)
-#define MODULO(rt, ra, pow2) \
- andi rt, ra, (pow2)-1;
-
-// rt = pow2 - (ra & (pow2 - 1))
-#define MODULO_NEG(rt, ra, pow2) \
- andi rt, ra, (pow2)-1; \
- sfi rt, rt, (pow2);
-
-// rt = ra & -(pow2)
-#define ROUND_DOWN(rt, ra, pow2) \
- andi rt, ra, -(pow2);
-
-// rt = (ra + (pow2 - 1)) & -(pow2)
-#define ROUND_UP(rt, ra, pow2) \
- ai rt, ra, (pow2)-1; \
- andi rt, rt, -(pow2);
-
-/*
- * ----------------------------------------------------------------
- * Splat - replicate a particular slot into all slots
- * Altivec analogs...
- * ----------------------------------------------------------------
- */
-
-// replicate byte from slot s [0,15]
-#define VSPLTB(rt, ra, s) \
- ilh _gc_t0, (s)*0x0101; \
- shufb rt, ra, ra, _gc_t0;
-
-// replicate halfword from slot s [0,7]
-#define VSPLTH(rt, ra, s) \
- ilh _gc_t0, 2*(s)*0x0101 + 0x0001; \
- shufb rt, ra, ra, _gc_t0;
-
-// replicate word from slot s [0,3]
-#define VSPLTW(rt, ra, s) \
- iluh _gc_t0, 4*(s)*0x0101 + 0x0001; \
- iohl _gc_t0, 4*(s)*0x0101 + 0x0203; \
- shufb rt, ra, ra, _gc_t0;
-
-// replicate double from slot s [0,1]
-#define VSPLTD(rt, ra, s) \
- /* sp is always 16-byte aligned */ \
- cdd _gc_t0, 8(sp); /* 0x10111213 14151617 00010203 04050607 */ \
- rotqbyi rt, ra, ra, (s) << 3; /* rotate double into preferred slot */ \
- shufb rt, rt, rt, _gc_t0;
-
-/*
- * ----------------------------------------------------------------
- * lots of min/max variations...
- *
- * On a slot by slot basis, compute the min or max
- *
- * U - unsigned, else signed
- * B,H,{} - byte, halfword, word
- * F float
- * ----------------------------------------------------------------
- */
-
-#define MIN_SELB(rt, ra, rb, rc) selb rt, ra, rb, rc;
-#define MAX_SELB(rt, ra, rb, rc) selb rt, rb, ra, rc;
-
- // words
-
-#define MIN(rt, ra, rb) \
- cgt _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define MAX(rt, ra, rb) \
- cgt _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
-#define UMIN(rt, ra, rb) \
- clgt _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define UMAX(rt, ra, rb) \
- clgt _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
- // bytes
-
-#define MINB(rt, ra, rb) \
- cgtb _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define MAXB(rt, ra, rb) \
- cgtb _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
-#define UMINB(rt, ra, rb) \
- clgtb _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define UMAXB(rt, ra, rb) \
- clgtb _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
- // halfwords
-
-#define MINH(rt, ra, rb) \
- cgth _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define MAXH(rt, ra, rb) \
- cgth _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
-#define UMINH(rt, ra, rb) \
- clgth _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define UMAXH(rt, ra, rb) \
- clgth _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
- // floats
-
-#define FMIN(rt, ra, rb) \
- fcgt _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-#define FMAX(rt, ra, rb) \
- fcgt _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
-// Ignoring the sign, select the values with the minimum magnitude
-#define FMINMAG(rt, ra, rb) \
- fcmgt _gc_t0, ra, rb; \
- MIN_SELB(rt, ra, rb, _gc_t0)
-
-// Ignoring the sign, select the values with the maximum magnitude
-#define FMAXMAG(rt, ra, rb) \
- fcmgt _gc_t0, ra, rb; \
- MAX_SELB(rt, ra, rb, _gc_t0)
-
-
-#endif /* INCLUDED_GC_SPU_MACS_H */
diff --git a/gcell/include/gcell/spu/libfft.h b/gcell/include/gcell/spu/libfft.h
deleted file mode 100644
index dd387be0c..000000000
--- a/gcell/include/gcell/spu/libfft.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -------------------------------------------------------------- */
-/* (C)Copyright 2008 Free Software Foundation, Inc. */
-/* (C)Copyright 2001,2007, */
-/* International Business Machines Corporation, */
-/* Sony Computer Entertainment, Incorporated, */
-/* Toshiba Corporation, */
-/* */
-/* All Rights Reserved. */
-/* */
-/* Redistribution and use in source and binary forms, with or */
-/* without modification, are permitted provided that the */
-/* following conditions are met: */
-/* */
-/* - Redistributions of source code must retain the above copyright*/
-/* notice, this list of conditions and the following disclaimer. */
-/* */
-/* - Redistributions in binary form must reproduce the above */
-/* copyright notice, this list of conditions and the following */
-/* disclaimer in the documentation and/or other materials */
-/* provided with the distribution. */
-/* */
-/* - Neither the name of IBM Corporation nor the names of its */
-/* contributors may be used to endorse or promote products */
-/* derived from this software without specific prior written */
-/* permission. */
-/* */
-/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
-/* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
-/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
-/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
-/* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */
-/* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
-/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT */
-/* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
-/* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) */
-/* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN */
-/* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */
-/* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
-/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-/* -------------------------------------------------------------- */
-/* PROLOG END TAG zYx */
-
-#ifndef INCLUDED_LIBFFT_H
-#define INCLUDED_LIBFFT_H
-
-// must be defined before inclusion of fft_1d_r2.h
-#define MAX_FFT_1D_SIZE 4096
-
-/* fft_1d_r2
- * ---------
- * Performs a single precision, complex Fast Fourier Transform using
- * the DFT (Discrete Fourier Transform) with radix-2 decimation in time.
- * The input <in> is an array of complex numbers of length (1<<log2_size)
- * entries. The result is returned in the array of complex numbers specified
- * by <out>. Note: This routine can support an in-place transformation
- * by specifying <in> and <out> to be the same array.
- *
- * This implementation utilizes the Cooley-Tukey algorithm consisting
- * of <log2_size> stages. The basic operation is the butterfly.
- *
- * p --------------------------> P = p + q*Wi
- * \ /
- * \ /
- * \ /
- * \/
- * /\
- * / \
- * / \
- * ____ / \
- * q --| Wi |-----------------> Q = p - q*Wi
- * ----
- *
- * This routine also requires pre-computed twiddle values, W. W is an
- * array of single precision complex numbers of length 1<<(log2_size-2)
- * and is computed as follows:
- *
- * for (i=0; i<n/4; i++)
- * W[i].real = cos(i * 2*PI/n);
- * W[i].imag = -sin(i * 2*PI/n);
- * }
- *
- * This array actually only contains the first half of the twiddle
- * factors. Due for symmetry, the second half of the twiddle factors
- * are implied and equal:
- *
- * for (i=0; i<n/4; i++)
- * W[i+n/4].real = W[i].imag = sin(i * 2*PI/n);
- * W[i+n/4].imag = -W[i].real = -cos(i * 2*PI/n);
- * }
- *
- * Further symmetry allows one to generate the twiddle factor table
- * using half the number of trig computations as follows:
- *
- * W[0].real = 1.0;
- * W[0].imag = 0.0;
- * for (i=1; i<n/4; i++)
- * W[i].real = cos(i * 2*PI/n);
- * W[n/4 - i].imag = -W[i].real;
- * }
- *
- * The complex numbers are packed into quadwords as follows:
- *
- * quadword complex
- * array element array elements
- * -----------------------------------------------------
- * i | real 2*i | imag 2*i | real 2*i+1 | imag 2*i+1 |
- * -----------------------------------------------------
- *
- */
-
-void fft_1d_r2(vector float *out, vector float *in, vector float *W, int log2_size);
-
-#endif /* INCLUDED_LIBFFT_H */
diff --git a/gcell/lib/Makefile.am b/gcell/lib/Makefile.am
deleted file mode 100644
index 7a727ea84..000000000
--- a/gcell/lib/Makefile.am
+++ /dev/null
@@ -1,44 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = spu runtime general wrapper .
-
-# generate libgcell.la from the convenience libraries in subdirs
-
-lib_LTLIBRARIES = libgcell.la libgcell-qa.la
-
-libgcell_la_SOURCES =
-libgcell_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-libgcell_qa_la_SOURCES =
-libgcell_qa_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-libgcell_la_LIBADD = \
- runtime/libruntime.la \
- wrapper/libwrapper.la \
- -lspe2 \
- $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB)
-
-libgcell_qa_la_LIBADD = \
- runtime/libruntime-qa.la \
- wrapper/libwrapper-qa.la \
- $(CPPUNIT_LIBS)
diff --git a/gcell/lib/general/.gitignore b/gcell/lib/general/.gitignore
deleted file mode 100644
index 3531485fb..000000000
--- a/gcell/lib/general/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.a
-/*.o
diff --git a/gcell/lib/general/Makefile.am b/gcell/lib/general/Makefile.am
deleted file mode 100644
index bd5a4de62..000000000
--- a/gcell/lib/general/Makefile.am
+++ /dev/null
@@ -1,23 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-
diff --git a/gcell/lib/general/spu/fft_1d_r2.c b/gcell/lib/general/spu/fft_1d_r2.c
deleted file mode 100644
index 0a87e74a8..000000000
--- a/gcell/lib/general/spu/fft_1d_r2.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/spu/libfft.h>
-#include <gcell/spu/fft_1d_r2.h>
-#include <assert.h>
-
-/*
- * invoke the inline version
- */
-void
-fft_1d_r2(vector float *out, vector float *in, vector float *W, int log2_size)
-{
- assert((1 << log2_size) <= MAX_FFT_1D_SIZE);
-
- _fft_1d_r2(out, in, W, log2_size);
-}
diff --git a/gcell/lib/general/spu/memset.S b/gcell/lib/general/spu/memset.S
deleted file mode 100644
index 39eabce02..000000000
--- a/gcell/lib/general/spu/memset.S
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- asm -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/spu/gc_spu_macs.h>
-
- .file "memset.S"
-
- /*
- * Computes this, only a lot faster...
- *
- * void *
- * memset(void *pv, int c, size_t n)
- * {
- * unsigned char *p = (unsigned char *) pv;
- * size_t i;
- * for (i = 0; i < n; i++)
- * p[i] = c;
- *
- * return pv;
- * }
- */
-
-#define p_arg arg1 // we're going to clobber arg1 w/ the return value
-#define c arg2 // the constant we're writing
-#define n arg3 // how many bytes to write
-
-#define p r13 // where we're writing
-#define t0 r14
-#define t1 r15
-#define mask r16
-#define old r17
-#define an r18 // aligned n (n rounded down to mod 16 boundary)
-#define next_p r19
-#define cond1 r20
-#define cond2 r21
-#define m r22
-#define r r23
-
- PROC_ENTRY(memset)
-
- // Hint the return from do_head, in case we go that way.
- // There's pretty much nothing to can do to hint the branch to it.
- hbrr do_head_br, head_complete
-
- MR(p, p_arg) // leaves p, the return value, in the correct reg (r3)
- BRZ_RETURN(n)
-
- MODULO(t0, p, 16) // is p%16 == 0?
- VSPLTB(c, c, 3) // splat byte in preferred slot of c into all slots
- brnz t0, do_head // no, handle it
-head_complete:
-
- /*
- * preconditions:
- * p%16 == 0, n > 0
- */
- hbrr middle_loop_br, middle_loop
-
- ROUND_DOWN(an, n, 16) // an is "aligned n"
- MODULO(n, n, 16) // what's left over in the last quad
- brz an, do_tail // no whole quad words; skip to tail
- clgti t0, an, 127 // an >= 128?
- brz t0, middle2 // nope, go handle the cases between 0 and 112
-
- /*
- * 128 bytes / iteration
- */
- .p2align 4
-middle_loop:
- ai an, an, -128
- stqd c, 0*16(p)
- ai next_p, p, 128
- stqd c, 1*16(p)
- cgti cond1, an, 127
- stqd c, 2*16(p)
-
- stqd c, 3*16(p)
- stqd c, 4*16(p)
- stqd c, 5*16(p)
- stqd c, 6*16(p)
-
- MR(p, next_p)
- stqd c, 7*16-128(next_p)
- or cond2, n, an
-middle_loop_br:
- brnz cond1, middle_loop
-
- /*
- * if an and n are both zero, return now
- */
- BRZ_RETURN(cond2)
-
- /*
- * otherwise handle last of full quad words
- *
- * 0 <= an < 128, p%16 == 0
- */
-middle2:
- /*
- * if an == 0, go handle the final non-full quadword
- */
- brz an, do_tail
- hbrr middle2_loop_br, middle2_loop
-
- .p2align 3
-middle2_loop:
- ai next_p, p, 16
- stqd c, 0(p)
- ai an, an, -16
- LMR(p, next_p)
-middle2_loop_br:
- brnz an, middle2_loop
-
- /* We're done with the full quadwords. */
-
- /*
- * Handle the final partial quadword.
- * We'll be modifying only the left hand portion of the quad.
- *
- * preconditions:
- * an == 0, 0 <= n < 16, p%16 == 0
- */
-do_tail:
- HINT_RETURN(do_tail_ret)
- il mask, -1
- sfi t1, n, 16 // t1 = 16 - n
- lqd old, 0(p)
- shlqby mask, mask, t1
- selb t0, old, c, mask
- stqd t0, 0(p)
-do_tail_ret:
- RETURN()
-
- /*
- * ----------------------------------------------------------------
- * Handle the first partial quadword
- *
- * preconditions:
- * p%16 != 0
- *
- * postconditions:
- * p%16 == 0 or n == 0
- *
- * |-- m --|
- * +----------------+----------------+
- * | //////// | |
- * +----------------+----------------+
- * |----- r -----|
- * p
- * ----------------------------------------------------------------
- */
-do_head:
- lqd old, 0(p)
- MODULO_NEG(r, p, 16)
- il mask, -1
- UMIN(m, r, n)
- shlqby mask, mask, m // 1's in the top, m*8 0's in the bottom
- MR(t1, p)
- sf t0, m, r // t0 = r - m
- a p, p, m // p += m
- rotqby mask, mask, t0 // rotate 0's to the right place
- sf n, m, n // n -= m
- selb t0, c, old, mask // merge
- stqd t0, 0(t1)
- BRZ_RETURN(n)
-do_head_br:
- br head_complete
diff --git a/gcell/lib/general/spu/qa_memset.c b/gcell/lib/general/spu/qa_memset.c
deleted file mode 100644
index e51b02c9a..000000000
--- a/gcell/lib/general/spu/qa_memset.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_declare_proc.h>
-#include <spu_intrinsics.h>
-#include <spu_mfcio.h>
-#include <string.h>
-#include <stdio.h>
-
-
-#define MAX_QA_BYTES 1024
-#define MAX_OFFSET 32
-#define ALIGNMENT 16
-#define K 0xA5
-
-// FIXME should be passed at gcell init time
-//static const int TIMEBASE = 79800000; // ps3
-static const int TIMEBASE = 26666666; // qs21
-
-typedef void* (*memset_fptr)(void *s, int val, size_t n);
-
-void *
-memset_ref(void *sv, int c, size_t n)
-{
- unsigned char *s = (unsigned char *) sv;
- size_t i;
- for (i = 0; i < n; i++)
- s[i] = c;
-
- return sv;
-}
-
-static bool
-check_before(unsigned char *buf, size_t len, size_t offset)
-{
- unsigned char *p = buf + sizeof(vector unsigned char) + offset;
- bool ok = true;
- int i;
-
- for (i = -16; i < 0; i++){
- unsigned char expected = (&p[i] - buf) & 0xff;
- if (p[i] != expected){
- printf("b:memset(%p, 0x%x, %zu) <offset %2zd> [%3d] expected %02x, got %02x\n",
- p, K, len, offset, i, K, p[i]);
- ok = false;
- }
- }
- return ok;
-}
-
-static bool
-check_middle(unsigned char *buf, size_t len, size_t offset)
-{
- unsigned char *p = buf + sizeof(vector unsigned char) + offset;
- bool ok = true;
- size_t i;
-
- for (i = 0; i < len; i++){
- unsigned char expected = K;
- if (p[i] != expected){
- printf("m:memset(%p, 0x%x, %zu) <offset %2zd> [%3zd] expected %02x, got %02x\n",
- p, K, len, offset, i, expected, p[i]);
- ok = false;
- }
- }
- return ok;
-}
-
-static bool
-check_after(unsigned char *buf, size_t len, size_t offset)
-{
- unsigned char *p = buf + sizeof(vector unsigned char) + offset;
- bool ok = true;
- size_t i;
-
- for (i = len; i < len + 16; i++){
- unsigned char expected = (&p[i] - buf) & 0xff;
- if (p[i] != expected){
- printf("a:memset(%p, 0x%x, %zu) <offset %2zd> [%3zd] expected %02x, got %02x\n",
- p, K, len, offset, i, expected, p[i]);
- ok = false;
- }
- }
- return ok;
-}
-
-
-static bool
-test_memset_aux(memset_fptr f,
- unsigned char *buf, size_t buflen, size_t len, size_t offset)
-{
- size_t i;
-
- // init buffer to non-zero known state
- for (i = 0; i < buflen; i++)
- buf[i] = i;
-
- // Our working buffer. Starts 16 bytes + offset into buf.
- // We offset by 16 so that we can see if data before is getting damaged.
- unsigned char *p = buf + sizeof(vector unsigned char) + offset;
-
- (*f)(p, K, len);
-
- bool ok = true;
- ok &= check_before(buf, len, offset);
- ok &= check_middle(buf, len, offset);
- ok &= check_after(buf, len, offset);
-
- return ok;
-}
-
-bool
-test_memset(memset_fptr f)
-{
- size_t BUFLEN = MAX_QA_BYTES + 2*sizeof(vector unsigned char) + MAX_OFFSET;
- unsigned char unaligned_buf[BUFLEN + ALIGNMENT -1];
- unsigned char *aligned_buf =
- (unsigned char *)((((intptr_t) unaligned_buf) + ALIGNMENT - 1) & -ALIGNMENT);
-
- // printf("unaligned = %p\n", unaligned_buf);
- // printf("aligned = %p\n", aligned_buf);
-
- size_t len;
- size_t offset;
- bool ok = true;
-
- for (len = 0; len < MAX_QA_BYTES; len++){
- for (offset = 0; offset <= MAX_OFFSET; offset++){
- ok &= test_memset_aux(f, aligned_buf, BUFLEN, len, offset);
- }
- }
-
- return ok;
-}
-
-// returns bytes/s
-float
-benchmark_memset(memset_fptr f, bool aligned)
-{
- static const int SIZE = 32768;
- unsigned char buf[SIZE];
- uint32_t t0, t1;
- int nbytes;
-
- spu_write_decrementer(0xffffffff);
-
- if (aligned){
- nbytes = SIZE;
- t0 = spu_read_decrementer();
- (*f)(buf, 0x55, nbytes);
- (*f)(buf, 0x55, nbytes);
- (*f)(buf, 0x55, nbytes);
- (*f)(buf, 0x55, nbytes);
- t1 = spu_read_decrementer();
- }
- else {
- nbytes = SIZE - 2;
- t0 = spu_read_decrementer();
- (*f)(buf + 1, 0x55, nbytes);
- (*f)(buf + 1, 0x55, nbytes);
- (*f)(buf + 1, 0x55, nbytes);
- (*f)(buf + 1, 0x55, nbytes);
- t1 = spu_read_decrementer();
- }
-
- //printf("delta ticks: %d\n", t0 - t1);
- return (float) nbytes * 4 / ((t0 - t1) * 1.0/TIMEBASE);
-}
-
-/*
- * Implement the standard QA stub.
- * No input arguments, 1 bool output.
- */
-static void
-gcs_qa_memset(const gc_job_direct_args_t *input _UNUSED,
- gc_job_direct_args_t *output,
- const gc_job_ea_args_t *eaa _UNUSED)
-{
- bool ok = test_memset(memset);
- output->arg[0].u32 = ok;
-}
-
-GC_DECLARE_PROC(gcs_qa_memset, "qa_memset");
diff --git a/gcell/lib/runtime/.gitignore b/gcell/lib/runtime/.gitignore
deleted file mode 100644
index a02b6ff73..000000000
--- a/gcell/lib/runtime/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
diff --git a/gcell/lib/runtime/Makefile.am b/gcell/lib/runtime/Makefile.am
deleted file mode 100644
index 3ce637636..000000000
--- a/gcell/lib/runtime/Makefile.am
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Copyright 2007,2008,2010 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-IBM_PPU_SYNC_INCLUDES = -I$(top_srcdir)/gcell/ibm/sync/ppu_source
-
-
-AM_CPPFLAGS = $(DEFINES) $(GCELL_INCLUDES) $(IBM_PPU_SYNC_INCLUDES) \
- $(BOOST_CPPFLAGS) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
-
-
-dist_bin_SCRIPTS = gcell-embedspu-libtool
-
-noinst_LTLIBRARIES = libruntime.la libruntime-qa.la
-
-libruntime_la_SOURCES = \
- gc_aligned_alloc.cc \
- gc_job_manager.cc \
- gc_job_manager_impl.cc \
- gc_jd_queue.c \
- gc_jd_stack.c \
- gc_proc_def_utils.cc
-
-libruntime_qa_la_SOURCES = \
- qa_gcell_runtime.cc \
- qa_jd_queue.cc \
- qa_jd_stack.cc \
- qa_job_manager.cc
-
-
-noinst_HEADERS = \
- gc_client_thread_info.h \
- gc_job_manager_impl.h \
- gc_proc_def_utils.h \
- qa_jd_queue.h \
- qa_jd_stack.h \
- qa_job_manager.h \
- qa_gcell_runtime.h
-
-# generate a libtool.lo that contains an embeded SPU executable
-gcell_runtime_qa.lo: ../spu/gcell_runtime_qa
- $(GCELL_EMBEDSPU_LIBTOOL) $< $@
-
-libruntime_qa_la_LIBADD = \
- gcell_runtime_qa.lo \
- libruntime.la
-
-CLEANFILES = gcell_runtime_qa.lo
diff --git a/gcell/lib/runtime/gc_aligned_alloc.cc b/gcell/lib/runtime/gc_aligned_alloc.cc
deleted file mode 100644
index 905154e3d..000000000
--- a/gcell/lib/runtime/gc_aligned_alloc.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <gcell/gc_aligned_alloc.h>
-#include <stdlib.h>
-#include <stdexcept>
-#include <string.h>
-
-// custom deleter of anything that can be freed with "free"
-class free_deleter {
-public:
- void operator()(void *p) {
- free(p);
- }
-};
-
-void *
-gc_aligned_alloc(size_t size, size_t alignment)
-{
- void *p = 0;
- if (posix_memalign(&p, alignment, size) != 0){
- perror("posix_memalign");
- throw std::runtime_error("memory");
- }
- memset(p, 0, size); // zero the memory
- return p;
-}
-
-boost::shared_ptr<void>
-gc_aligned_alloc_sptr(size_t size, size_t alignment)
-{
- return boost::shared_ptr<void>(gc_aligned_alloc(size, alignment),
- free_deleter());
-}
diff --git a/gcell/lib/runtime/gc_client_thread_info.h b/gcell/lib/runtime/gc_client_thread_info.h
deleted file mode 100644
index e49c07097..000000000
--- a/gcell/lib/runtime/gc_client_thread_info.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2010 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_GC_CLIENT_THREAD_INFO_H
-#define INCLUDED_GC_CLIENT_THREAD_INFO_H
-
-#include <boost/thread.hpp>
-#include <boost/utility.hpp>
-
-enum gc_ct_state {
- CT_NOT_WAITING,
- CT_WAIT_ALL,
- CT_WAIT_ANY,
-};
-
-/*
- * \brief per client-thread data used by gc_job_manager
- *
- * "Client threads" are any threads that invoke methods on
- * gc_job_manager. We use pthread_set_specific to store a pointer to
- * one of these for each thread that comes our way.
- */
-class gc_client_thread_info : boost::noncopyable {
-public:
- gc_client_thread_info() :
- d_free(1), d_cond(), d_state(CT_NOT_WAITING),
- d_jobs_done(0), d_njobs_waiting_for(0),
- d_jobs_waiting_for(0){ }
-
- ~gc_client_thread_info() {
- d_free = 1;
- d_state = CT_NOT_WAITING;
- d_jobs_done = 0;
- d_njobs_waiting_for = 0;
- d_jobs_waiting_for = 0;
- }
-
- //! is this cti free? (1->free, 0->in use)
- uint32_t d_free;
-
- //! which client info are we?
- uint16_t d_client_id;
-
- //! hold this mutex to manipulate anything below here
- boost::mutex d_mutex;
-
- //! signaled by event handler to wake client thread up
- boost::condition_variable d_cond;
-
- //! Is this client waiting?
- gc_ct_state d_state;
-
- //! Jobs that have finished and not yet been waited for (bitvector)
- unsigned long *d_jobs_done;
-
- //! # of jobs we're waiting for
- unsigned int d_njobs_waiting_for;
-
- //! Jobs that client thread is waiting for
- gc_job_desc **d_jobs_waiting_for;
-
-};
-
-#endif /* INCLUDED_GC_CLIENT_THREAD_INFO_H */
diff --git a/gcell/lib/runtime/gc_jd_queue.c b/gcell/lib/runtime/gc_jd_queue.c
deleted file mode 100644
index aeabd305a..000000000
--- a/gcell/lib/runtime/gc_jd_queue.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- c -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_jd_queue.h>
-#include <gcell/memory_barrier.h>
-#include <mutex_init.h>
-#include <mutex_lock.h>
-#include <mutex_unlock.h>
-
-void
-gc_jd_queue_init(gc_jd_queue_t *q)
-{
- _mutex_init(ptr_to_ea(&q->mutex));
- q->head = 0;
- q->tail = 0;
- smp_wmb();
-}
-
-void
-gc_jd_queue_enqueue(gc_jd_queue_t *q, gc_job_desc_t *item)
-{
- item->sys.next = 0;
- _mutex_lock(ptr_to_ea(&q->mutex));
- smp_rmb(); // import barrier
-
- if (q->tail == 0){ // currently empty
- q->tail = q->head = jdp_to_ea(item);
- }
- else { // not empty, append
- ea_to_jdp(q->tail)->sys.next = jdp_to_ea(item);
- q->tail = jdp_to_ea(item);
- }
-
- smp_wmb(); // orders stores above before clearing of mutex
- _mutex_unlock(ptr_to_ea(&q->mutex));
-}
-
-gc_job_desc_t *
-gc_jd_queue_dequeue(gc_jd_queue_t *q)
-{
- _mutex_lock(ptr_to_ea(&q->mutex));
- smp_rmb(); // import barrier
-
- gc_eaddr_t item_ea = q->head;
- if (item_ea == 0){ // empty
- _mutex_unlock(ptr_to_ea(&q->mutex));
- return 0;
- }
-
- q->head = ea_to_jdp(item_ea)->sys.next;
- if (q->head == 0) // now emtpy
- q->tail = 0;
-
- gc_job_desc_t *item = ea_to_jdp(item_ea);
- item->sys.next = 0;
-
- smp_wmb(); // orders stores above before clearing of mutex
- _mutex_unlock(ptr_to_ea(&q->mutex));
- return item;
-}
diff --git a/gcell/lib/runtime/gc_jd_stack.c b/gcell/lib/runtime/gc_jd_stack.c
deleted file mode 100644
index 4d865acf0..000000000
--- a/gcell/lib/runtime/gc_jd_stack.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- c -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_jd_stack.h>
-#include <gcell/memory_barrier.h>
-
-/*
- * begin extract from ppu_intrinics.h
- * FIXME handle this a different way
- */
-
-#if !defined(__PPU__) && !defined(__ppc__) && !defined(__ppc64__)
- && !defined(__GNUC__)
- #error ppu_intrinsics.h included on wrong platform/compiler
-#endif
-
-#define __lwarx(base) __extension__ \
- ({unsigned int result; \
- typedef struct {char a[4];} wordsize; \
- wordsize *ptrp = (wordsize*)(base); \
- __asm__ volatile ("lwarx %0,%y1" \
- : "=r" (result) \
- : "Z" (*ptrp)); \
- result; })
-
-#ifdef __powerpc64__
-#define __ldarx(base) __extension__ \
- ({unsigned long long result; \
- typedef struct {char a[8];} doublewordsize; \
- doublewordsize *ptrp = (doublewordsize*)(base); \
- __asm__ volatile ("ldarx %0,%y1" \
- : "=r" (result) \
- : "Z" (*ptrp)); \
- result; })
-#endif /* __powerpc64__ */
-
-#define __stwcx(base, value) __extension__ \
- ({unsigned int result; \
- typedef struct {char a[4];} wordsize; \
- wordsize *ptrp = (wordsize*)(base); \
- __asm__ volatile ("stwcx. %2,%y1\n" \
- "\tmfocrf %0,0x80" \
- : "=r" (result), \
- "=Z" (*ptrp) \
- : "r" (value)); \
- ((result & 0x20000000) >> 29); })
-
-
-#ifdef __powerpc64__
-#define __stdcx(base, value) __extension__ \
- ({unsigned long long result; \
- typedef struct {char a[8];} doublewordsize; \
- doublewordsize *ptrp = (doublewordsize*)(base); \
- __asm__ volatile ("stdcx. %2,%y1\n" \
- "\tmfocrf %0,0x80" \
- : "=r" (result), \
- "=Z" (*ptrp) \
- : "r" (value)); \
- ((result & 0x20000000) >> 29); })
-#endif /* __powerpc64__ */
-
-
-/*
- * --- end extract from ppu_intrinics.h --
- */
-
-
-void
-gc_jd_stack_init(gc_jd_stack_t *stack)
-{
- stack->top = 0;
-}
-
-
-#ifdef __powerpc64__ // 64-bit mode
-
-void
-gc_jd_stack_push(gc_jd_stack_t *stack, gc_job_desc_t *item)
-{
- gc_eaddr_t top;
- gc_eaddr_t item_ea = ptr_to_ea(item);
- unsigned int done;
-
- do {
- top = __ldarx(&stack->top);
- item->sys.next = top;
- smp_wmb(); // order store of item->next before store of stack->top
- done = __stdcx(&stack->top, item_ea);
- } while (unlikely(done == 0));
-}
-
-gc_job_desc_t *
-gc_jd_stack_pop(gc_jd_stack_t *stack)
-{
- gc_eaddr_t s;
- gc_eaddr_t t;
- unsigned int done;
-
- do {
- s = __ldarx(&stack->top);
- if (s == 0) /* stack's empty */
- return 0;
- t = ((gc_job_desc_t *) ea_to_ptr(s))->sys.next;
- done = __stdcx(&stack->top, t);
- } while (unlikely(done == 0));
-
- return ea_to_ptr(s);
-}
-
-#else // 32-bit mode
-
-/*
- * In 32-bit mode, gc_eaddr's will have the top 32-bits zero.
- * The ldarx/stdcx instructions aren't available in 32-bit mode,
- * thus we use lwarx/stwcx on the low 32-bits of the 64-bit addresses.
- * Since we're big-endian, the low 32-bits are at word offset 1.
- */
-void
-gc_jd_stack_push(gc_jd_stack_t *stack, gc_job_desc_t *item)
-{
- gc_eaddr_t top;
- unsigned int done;
-
- do {
- top = __lwarx((int32_t *)(&stack->top) + 1);
- item->sys.next = top;
- smp_wmb(); // order store of item->sys.next before store of stack->top
- done = __stwcx((int32_t *)(&stack->top) + 1, item);
- } while (unlikely(done == 0));
-}
-
-gc_job_desc_t *
-gc_jd_stack_pop(gc_jd_stack_t *stack)
-{
- gc_eaddr_t s;
- gc_eaddr_t t;
- unsigned int done;
-
- do {
- s = __lwarx((int32_t *)(&stack->top) + 1);
- if (s == 0) /* stack's empty */
- return 0;
- t = ((gc_job_desc_t *) ea_to_ptr(s))->sys.next;
- done = __stwcx((int32_t *)(&stack->top) + 1, (uint32_t) t);
- } while (unlikely(done == 0));
-
- return ea_to_ptr(s);
-}
-
-#endif
diff --git a/gcell/lib/runtime/gc_job_manager.cc b/gcell/lib/runtime/gc_job_manager.cc
deleted file mode 100644
index d96bc5381..000000000
--- a/gcell/lib/runtime/gc_job_manager.cc
+++ /dev/null
@@ -1,186 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <gcell/gc_job_manager.h>
-#include "gc_job_manager_impl.h"
-#include <boost/weak_ptr.hpp>
-#include <stdio.h>
-
-
-static boost::weak_ptr<gc_job_manager> s_singleton;
-
-
-// custom deleter of gc_job_desc allocated via alloc_job_desc_sptr
-class job_desc_deleter {
- gc_job_manager_sptr d_mgr;
-public:
- job_desc_deleter(gc_job_manager_sptr mgr) : d_mgr(mgr) {}
-
- void operator()(gc_job_desc *jd) {
- d_mgr->free_job_desc(jd);
- }
-};
-
-
-
-gc_job_manager_sptr
-gc_make_job_manager(const gc_jm_options *options)
-{
- return gc_job_manager_sptr(new gc_job_manager_impl(options));
-}
-
-gc_job_manager::gc_job_manager(const gc_jm_options *options)
-{
- // nop
-}
-
-gc_job_manager::~gc_job_manager()
-{
- // nop
-}
-
-void
-gc_job_manager::set_debug(int debug)
-{
- // nop
-}
-
-int
-gc_job_manager::debug()
-{
- return 0;
-}
-
-void
-gc_job_manager::set_singleton(gc_job_manager_sptr mgr)
-{
- s_singleton = mgr;
-}
-
-gc_job_manager_sptr
-gc_job_manager::singleton()
-{
- return gc_job_manager_sptr(s_singleton);
-}
-
-gc_job_desc_sptr
-gc_job_manager::make_jd_sptr(gc_job_manager_sptr mgr, gc_job_desc *jd)
-{
- return gc_job_desc_sptr(jd, job_desc_deleter(mgr));
-}
-
-gc_job_desc_sptr
-gc_job_manager::alloc_job_desc(gc_job_manager_sptr mgr)
-{
- return make_jd_sptr(mgr, mgr->alloc_job_desc());
-}
-
-
-// ------------------------------------------------------------------------
-
-
-// custom deleter
-class spe_program_handle_deleter {
-public:
- void operator()(spe_program_handle_t *program) {
- if (program){
- int r = spe_image_close(program);
- if (r != 0){
- perror("spe_image_close");
- }
- }
- }
-};
-
-// nop custom deleter
-class nop_spe_program_handle_deleter {
-public:
- void operator()(spe_program_handle_t *program) {
- }
-};
-
-spe_program_handle_sptr
-gc_program_handle_from_filename(const std::string &filename)
-{
- return spe_program_handle_sptr(spe_image_open(filename.c_str()),
- spe_program_handle_deleter());
-}
-
-
-spe_program_handle_sptr
-gc_program_handle_from_address(spe_program_handle_t *handle)
-{
- return spe_program_handle_sptr(handle, nop_spe_program_handle_deleter());
-}
-
-const std::string
-gc_job_status_string(gc_job_status_t status)
-{
- switch(status){
- case JS_OK: return "JS_OK";
- case JS_SHUTTING_DOWN: return "JS_SHUTTING_DOWN";
- case JS_TOO_MANY_CLIENTS: return "JS_TOO_MANY_CLIENTS";
- case JS_UNKNOWN_PROC: return "JS_UNKNOWN_PROC";
- case JS_BAD_DIRECTION: return "JS_BAD_DIRECTION";
- case JS_BAD_EAH: return "JS_BAD_EAH";
- case JS_BAD_N_DIRECT: return "JS_BAD_N_DIRECT";
- case JS_BAD_N_EA: return "JS_BAD_N_EA";
- case JS_ARGS_TOO_LONG: return "JS_ARGS_TOO_LONG";
- case JS_BAD_JUJU: return "JS_BAD_JUJU";
- case JS_BAD_JOB_DESC: return "JS_BAD_JOB_DESC";
- default:
- char buf[100];
- snprintf(buf, sizeof(buf), "unknown gc_job_status_t (%d)\n", status);
- return buf;
- }
-}
-
-/*
- * exception classes
- */
-
-gc_exception::gc_exception(const std::string &msg)
- : runtime_error(msg)
-{
-}
-
-gc_unknown_proc::gc_unknown_proc(const std::string &msg)
- : gc_exception("gc_unknown_proc: " + msg)
-{
-}
-
-gc_bad_alloc::gc_bad_alloc(const std::string &msg)
- : gc_exception("gc_bad_alloc: " + msg)
-{
-}
-
-gc_bad_align::gc_bad_align(const std::string &msg)
- : gc_exception("gc_bad_align: " + msg)
-{
-}
-
-gc_bad_submit::gc_bad_submit(const std::string &name, gc_job_status_t status)
- : gc_exception("gc_bad_submit(" + name + "): " + gc_job_status_string(status))
-{
-}
diff --git a/gcell/lib/runtime/gc_job_manager_impl.cc b/gcell/lib/runtime/gc_job_manager_impl.cc
deleted file mode 100644
index 58597cf27..000000000
--- a/gcell/lib/runtime/gc_job_manager_impl.cc
+++ /dev/null
@@ -1,1404 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,2009,2010 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "gc_job_manager_impl.h"
-#include <gcell/gc_mbox.h>
-#include <gcell/gc_aligned_alloc.h>
-#include <gcell/memory_barrier.h>
-#include <gc_proc_def_utils.h>
-#include <atomic_dec_if_positive.h>
-#include <stdio.h>
-#include <stdexcept>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sched.h>
-
-typedef boost::unique_lock<boost::mutex> scoped_lock;
-
-#define __nop() __asm__ volatile ("ori 0,0,0" : : : "memory")
-#define __cctpl() __asm__ volatile ("or 1,1,1" : : : "memory")
-#define __cctpm() __asm__ volatile ("or 2,2,2" : : : "memory")
-#define __cctph() __asm__ volatile ("or 3,3,3" : : : "memory")
-#define __db8cyc() __asm__ volatile ("or 28,28,28" : : : "memory")
-#define __db10cyc() __asm__ volatile ("or 29,29,29" : : : "memory")
-#define __db12cyc() __asm__ volatile ("or 30,30,30" : : : "memory")
-#define __db16cyc() __asm__ volatile ("or 31,31,31" : : : "memory")
-
-
-#if 1
-#define CCTPL() __cctpl()
-#define CCTPM() __cctpm()
-#else
-#define CCTPL() (void) 0
-#define CCTPM() (void) 0
-#endif
-
-static const size_t CACHE_LINE_SIZE = 128;
-
-static const unsigned int DEFAULT_MAX_JOBS = 128;
-static const unsigned int DEFAULT_MAX_CLIENT_THREADS = 64;
-
-// FIXME this really depends on the SPU code...
-static const unsigned int MAX_TOTAL_INDIRECT_LENGTH = 16 * 1024;
-
-
-static bool s_key_initialized = false;
-static pthread_key_t s_client_key;
-
-static int s_worker_debug = 0;
-
-// custom deleter of gang_contexts for use with boost::shared_ptr
-class gang_deleter {
-public:
- void operator()(spe_gang_context_ptr_t ctx) {
- if (ctx){
- int r = spe_gang_context_destroy(ctx);
- if (r != 0){
- perror("spe_gang_context_destroy");
- }
- }
- }
-};
-
-
-// custom deleter of anything that can be freed with "free"
-class free_deleter {
-public:
- void operator()(void *p) {
- free(p);
- }
-};
-
-
-/*
- * Called when client thread is destroyed.
- * We mark our client info free.
- */
-static void
-client_key_destructor(void *p)
-{
- ((gc_client_thread_info *) p)->d_free = 1;
-}
-
-static bool
-is_power_of_2(uint32_t x)
-{
- return (x != 0) && !(x & (x - 1));
-}
-
-////////////////////////////////////////////////////////////////////////
-
-
-gc_job_manager_impl::gc_job_manager_impl(const gc_jm_options *options)
- : d_debug(0), d_spu_args(0),
- d_eh_cond(), d_eh_thread(0), d_eh_state(EHS_INIT),
- d_shutdown_requested(false),
- d_jc_cond(), d_jc_thread(0), d_jc_state(JCS_INIT), d_jc_njobs_active(0),
- d_ntell(0), d_tell_start(0),
- d_client_thread(0), d_ea_args_maxsize(0),
- d_proc_def(0), d_proc_def_ls_addr(0), d_nproc_defs(0)
-{
- if (!s_key_initialized){
- int r = pthread_key_create(&s_client_key, client_key_destructor);
- if (r != 0)
- throw std::runtime_error("pthread_key_create");
- s_key_initialized = true;
- }
-
- // ensure it's zero
- pthread_setspecific(s_client_key, 0);
-
- if (options != 0)
- d_options = *options;
-
- // provide the real default for those indicated with a zero
- if (d_options.max_jobs == 0)
- d_options.max_jobs = DEFAULT_MAX_JOBS;
- if (d_options.max_client_threads == 0)
- d_options.max_client_threads = DEFAULT_MAX_CLIENT_THREADS;
-
- if (!d_options.program_handle){
- fprintf(stderr, "gc_job_manager: options->program_handle must be non-zero\n");
- throw std::runtime_error("gc_job_manager: options->program_handle must be non-zero");
- }
-
- int ncpu_nodes = spe_cpu_info_get(SPE_COUNT_PHYSICAL_CPU_NODES, -1);
- int nusable_spes = spe_cpu_info_get(SPE_COUNT_USABLE_SPES, -1);
-
- if (debug()){
- printf("cpu_nodes = %d\n", ncpu_nodes);
- for (int i = 0; i < ncpu_nodes; i++){
- printf("node[%d].physical_spes = %2d\n", i,
- spe_cpu_info_get(SPE_COUNT_PHYSICAL_SPES, i));
- printf("node[%d].usable_spes = %2d\n", i,
- spe_cpu_info_get(SPE_COUNT_USABLE_SPES, i));
- }
- }
-
- // clamp nspes
- d_options.nspes = std::min(d_options.nspes, (unsigned int) MAX_SPES);
- nusable_spes = std::min(nusable_spes, (int) MAX_SPES);
-
- //
- // sanity check requested number of spes.
- //
- if (d_options.nspes == 0) // use all of them
- d_options.nspes = nusable_spes;
- else {
- if (d_options.nspes > (unsigned int) nusable_spes){
- fprintf(stderr,
- "gc_job_manager: warning: caller requested %d spes. There are only %d available.\n",
- d_options.nspes, nusable_spes);
- if (d_options.gang_schedule){
- // If we're gang scheduling we'll never get scheduled if we
- // ask for more than are available.
- throw std::out_of_range("gang_scheduling: not enough spes available");
- }
- else { // FIXME clamp to usable. problem on PS3 when overcommited
- fprintf(stderr, "gc_job_manager: clamping nspes to %d\n", nusable_spes);
- d_options.nspes = nusable_spes;
- }
- }
- }
-
- if (d_options.use_affinity){
- printf("gc_job_manager: warning: affinity request was ignored\n");
- }
-
- if (d_options.gang_schedule){
- d_gang = spe_gang_context_sptr(spe_gang_context_create(0), gang_deleter());
- if (!d_gang){
- perror("gc_job_manager_impl[spe_gang_context_create]");
- throw std::runtime_error("spe_gang_context_create");
- }
- }
-
- d_ntell = std::min(d_options.nspes, 2U);
-
- // ----------------------------------------------------------------
- // initalize the job queue
-
- d_queue = (gc_jd_queue_t *) gc_aligned_alloc(sizeof(gc_jd_queue_t), CACHE_LINE_SIZE);
- _d_queue_boost =
- boost::shared_ptr<void>((void *) d_queue, free_deleter());
- gc_jd_queue_init(d_queue);
-
-
- // ----------------------------------------------------------------
- // create the spe contexts
-
- // 1 spu_arg struct for each SPE
- assert(sizeof(gc_spu_args_t) % 16 == 0);
- d_spu_args =
- (gc_spu_args_t *) gc_aligned_alloc(MAX_SPES * sizeof(gc_spu_args_t), 16);
- _d_spu_args_boost =
- boost::shared_ptr<void>((void *) d_spu_args, free_deleter());
-
- // 2 completion info structs for each SPE (we double buffer them)
- assert(sizeof(gc_comp_info_t) % CACHE_LINE_SIZE == 0);
- d_comp_info =
- (gc_comp_info_t *) gc_aligned_alloc(2 * MAX_SPES * sizeof(gc_comp_info_t),
- CACHE_LINE_SIZE);
- _d_comp_info_boost =
- boost::shared_ptr<void>((void *) d_comp_info, free_deleter());
-
-
- // get a handle to the spe program
-
- spe_program_handle_t *spe_image = d_options.program_handle.get();
-
- // fish proc_def table out of SPE ELF file
-
- if (!gcpd_find_table(spe_image, &d_proc_def, &d_nproc_defs, &d_proc_def_ls_addr)){
- fprintf(stderr, "gc_job_manager_impl: couldn't find gc_proc_defs in SPE ELF file.\n");
- throw std::runtime_error("no gc_proc_defs");
- }
- // fprintf(stderr, "d_proc_def_ls_addr = 0x%0x\n", d_proc_def_ls_addr);
-
- int spe_flags = (SPE_EVENTS_ENABLE
- | SPE_MAP_PS
- | SPE_CFG_SIGNOTIFY1_OR
- | SPE_CFG_SIGNOTIFY2_OR);
-
- for (unsigned int i = 0; i < d_options.nspes; i++){
- // FIXME affinity stuff goes here
- d_worker[i].spe_ctx = spe_context_create(spe_flags, d_gang.get());;
- if (d_worker[i].spe_ctx == 0){
- perror("spe_context_create");
- throw std::runtime_error("spe_context_create");
- }
-
- d_worker[i].spe_ctrl =
- (spe_spu_control_area_t *)spe_ps_area_get(d_worker[i].spe_ctx, SPE_CONTROL_AREA);
- if (d_worker[i].spe_ctrl == 0){
- perror("spe_ps_area_get(SPE_CONTROL_AREA)");
- throw std::runtime_error("spe_ps_area_get(SPE_CONTROL_AREA)");
- }
-
- d_worker[i].spe_idx = i;
- d_worker[i].spu_args = &d_spu_args[i];
- d_worker[i].spu_args->queue = ptr_to_ea(d_queue);
- d_worker[i].spu_args->comp_info[0] = ptr_to_ea(&d_comp_info[2*i+0]);
- d_worker[i].spu_args->comp_info[1] = ptr_to_ea(&d_comp_info[2*i+1]);
- d_worker[i].spu_args->spu_idx = i;
- d_worker[i].spu_args->nspus = d_options.nspes;
- d_worker[i].spu_args->proc_def_ls_addr = d_proc_def_ls_addr;
- d_worker[i].spu_args->nproc_defs = d_nproc_defs;
- d_worker[i].spu_args->log.base = 0;
- d_worker[i].spu_args->log.nentries = 0;
- d_worker[i].state = WS_INIT;
-
- int r = spe_program_load(d_worker[i].spe_ctx, spe_image);
- if (r != 0){
- perror("spe_program_load");
- throw std::runtime_error("spe_program_load");
- }
- }
-
- setup_logfiles();
-
- // ----------------------------------------------------------------
- // initalize the free list of job descriptors
-
- d_free_list = (gc_jd_stack_t *) gc_aligned_alloc(sizeof(gc_jd_stack_t), CACHE_LINE_SIZE);
- // This ensures that the memory associated with d_free_list is
- // automatically freed in the destructor or if an exception occurs
- // here in the constructor.
- _d_free_list_boost =
- boost::shared_ptr<void>((void *) d_free_list, free_deleter());
- gc_jd_stack_init(d_free_list);
-
- if (debug()){
- printf("sizeof(d_jd[0]) = %d (0x%x)\n", sizeof(d_jd[0]), sizeof(d_jd[0]));
- printf("max_jobs = %u\n", d_options.max_jobs);
- }
-
- // Initialize the array of job descriptors.
- d_jd = (gc_job_desc_t *) gc_aligned_alloc(sizeof(d_jd[0]) * d_options.max_jobs, CACHE_LINE_SIZE);
- _d_jd_boost = boost::shared_ptr<void>((void *) d_jd, free_deleter());
-
-
- // set unique job_id
- for (int i = 0; i < (int) d_options.max_jobs; i++)
- d_jd[i].sys.job_id = i;
-
- // push them onto the free list
- for (int i = d_options.max_jobs - 1; i >= 0; i--)
- free_job_desc(&d_jd[i]);
-
- // ----------------------------------------------------------------
- // initialize d_client_thread
-
- {
- gc_client_thread_info_sa cti(
- new gc_client_thread_info[d_options.max_client_threads]);
-
- d_client_thread.swap(cti);
-
- for (unsigned int i = 0; i < d_options.max_client_threads; i++)
- d_client_thread[i].d_client_id = i;
- }
-
- // ----------------------------------------------------------------
- // initialize bitvectors
-
- // initialize d_bvlen, the number of longs in job related bitvectors.
- int bits_per_long = sizeof(unsigned long) * 8;
- d_bvlen = (d_options.max_jobs + bits_per_long - 1) / bits_per_long;
-
- // allocate all bitvectors in a single cache-aligned chunk
- size_t nlongs = d_bvlen * d_options.max_client_threads;
- void *p = gc_aligned_alloc(nlongs * sizeof(unsigned long), CACHE_LINE_SIZE);
- _d_all_bitvectors = boost::shared_ptr<void>(p, free_deleter());
-
- // Now point the gc_client_thread_info bitvectors into this storage
- unsigned long *v = (unsigned long *) p;
-
- for (unsigned int i = 0; i < d_options.max_client_threads; i++, v += d_bvlen)
- d_client_thread[i].d_jobs_done = v;
-
-
- // ----------------------------------------------------------------
- // create the spe event handler & worker (SPE) threads
-
- create_event_handler();
-}
-
-////////////////////////////////////////////////////////////////////////
-
-gc_job_manager_impl::~gc_job_manager_impl()
-{
- shutdown();
-
- d_jd = 0; // handled via _d_jd_boost
- d_free_list = 0; // handled via _d_free_list_boost
- d_queue = 0; // handled via _d_queue_boost
-
- // clear cti, since we've deleted the underlying data
- pthread_setspecific(s_client_key, 0);
-
- unmap_logfiles();
-}
-
-bool
-gc_job_manager_impl::shutdown()
-{
- scoped_lock l(d_eh_mutex);
-
- {
- scoped_lock l2(d_jc_mutex);
- d_shutdown_requested = true; // set flag for event handler thread
- d_jc_cond.notify_one(); // wake up job completer
- }
-
- // should only happens during early QA code
- if (d_eh_thread == 0 && d_eh_state == EHS_INIT)
- return false;
-
- while (d_eh_state != EHS_DEAD) // wait for it to finish
- d_eh_cond.wait(l);
-
- return true;
-}
-
-int
-gc_job_manager_impl::nspes() const
-{
- return d_options.nspes;
-}
-
-////////////////////////////////////////////////////////////////////////
-
-void
-gc_job_manager_impl::bv_zero(unsigned long *bv)
-{
- memset(bv, 0, sizeof(unsigned long) * d_bvlen);
-}
-
-inline void
-gc_job_manager_impl::bv_clr(unsigned long *bv, unsigned int bitno)
-{
- unsigned int wi = bitno / (sizeof (unsigned long) * 8);
- unsigned int bi = bitno & ((sizeof (unsigned long) * 8) - 1);
- bv[wi] &= ~(1UL << bi);
-}
-
-inline void
-gc_job_manager_impl::bv_set(unsigned long *bv, unsigned int bitno)
-{
- unsigned int wi = bitno / (sizeof (unsigned long) * 8);
- unsigned int bi = bitno & ((sizeof (unsigned long) * 8) - 1);
- bv[wi] |= (1UL << bi);
-}
-
-inline bool
-gc_job_manager_impl::bv_isset(unsigned long *bv, unsigned int bitno)
-{
- unsigned int wi = bitno / (sizeof (unsigned long) * 8);
- unsigned int bi = bitno & ((sizeof (unsigned long) * 8) - 1);
- return (bv[wi] & (1UL << bi)) != 0;
-}
-
-inline bool
-gc_job_manager_impl::bv_isclr(unsigned long *bv, unsigned int bitno)
-{
- unsigned int wi = bitno / (sizeof (unsigned long) * 8);
- unsigned int bi = bitno & ((sizeof (unsigned long) * 8) - 1);
- return (bv[wi] & (1UL << bi)) == 0;
-}
-
-////////////////////////////////////////////////////////////////////////
-
-gc_job_desc *
-gc_job_manager_impl::alloc_job_desc()
-{
- // stack is lock free, and safe to call from any thread
- gc_job_desc *jd = gc_jd_stack_pop(d_free_list);
- if (jd == 0)
- throw gc_bad_alloc("alloc_job_desc: none available");
-
- return jd;
-}
-
-void
-gc_job_manager_impl::free_job_desc(gc_job_desc *jd)
-{
- // stack is lock free, thus safe to call from any thread
- if (jd != 0)
- gc_jd_stack_push(d_free_list, jd);
-}
-
-////////////////////////////////////////////////////////////////////////
-
-
-inline bool
-gc_job_manager_impl::incr_njobs_active()
-{
- scoped_lock l(d_jc_mutex);
-
- if (d_shutdown_requested)
- return false;
-
- if (d_jc_njobs_active++ == 0) // signal on 0 to 1 transition
- d_jc_cond.notify_one();
-
- return true;
-}
-
-inline void
-gc_job_manager_impl::decr_njobs_active(int n)
-{
- scoped_lock l(d_jc_mutex);
- d_jc_njobs_active -= n;
-}
-
-
-/*
- * We check as much as we can here on the PPE side, so that the SPE
- * doesn't have to.
- */
-static bool
-check_direct_args(gc_job_desc *jd, gc_job_direct_args *args)
-{
- if (args->nargs > MAX_ARGS_DIRECT){
- jd->status = JS_BAD_N_DIRECT;
- return false;
- }
-
- return true;
-}
-
-static bool
-check_ea_args(gc_job_desc *jd, gc_job_ea_args *p)
-{
- if (p->nargs > MAX_ARGS_EA){
- jd->status = JS_BAD_N_EA;
- return false;
- }
-
- uint32_t dir_union = 0;
-
- for (unsigned int i = 0; i < p->nargs; i++){
- dir_union |= p->arg[i].direction;
- switch(p->arg[i].direction){
- case GCJD_DMA_GET:
- case GCJD_DMA_PUT:
- break;
-
- default:
- jd->status = JS_BAD_DIRECTION;
- return false;
- }
- }
-
- if (p->nargs > 1){
- unsigned int common_eah = (p->arg[0].ea_addr) >> 32;
- for (unsigned int i = 1; i < p->nargs; i++){
- if ((p->arg[i].ea_addr >> 32) != common_eah){
- jd->status = JS_BAD_EAH;
- return false;
- }
- }
- }
-
- jd->sys.direction_union = dir_union;
- return true;
-}
-
-bool
-gc_job_manager_impl::submit_job(gc_job_desc *jd)
-{
- // Ensure it's one of our job descriptors
-
- if (jd < d_jd || jd >= &d_jd[d_options.max_jobs]){
- jd->status = JS_BAD_JOB_DESC;
- return false;
- }
-
- // Ensure we've got a client_thread_info assigned to this thread.
-
- gc_client_thread_info *cti =
- (gc_client_thread_info *) pthread_getspecific(s_client_key);
- if (unlikely(cti == 0)){
- if ((cti = alloc_cti()) == 0){
- fprintf(stderr, "gc_job_manager_impl::submit_job: Too many client threads.\n");
- jd->status = JS_TOO_MANY_CLIENTS;
- return false;
- }
- int r = pthread_setspecific(s_client_key, cti);
- if (r != 0){
- jd->status = JS_BAD_JUJU;
- fprintf(stderr, "pthread_setspecific failed (return = %d)\n", r);
- return false;
- }
- }
-
- if (jd->proc_id == GCP_UNKNOWN_PROC){
- jd->status = JS_UNKNOWN_PROC;
- return false;
- }
-
- if (!check_direct_args(jd, &jd->input))
- return false;
-
- if (!check_direct_args(jd, &jd->output))
- return false;
-
- if (!check_ea_args(jd, &jd->eaa))
- return false;
-
- jd->status = JS_OK;
- jd->sys.client_id = cti->d_client_id;
-
- if (!incr_njobs_active()){
- jd->status = JS_SHUTTING_DOWN;
- return false;
- }
-
- gc_jd_queue_enqueue(d_queue, jd);
- // tell_spes_to_check_queue();
- return true;
-}
-
-bool
-gc_job_manager_impl::wait_job(gc_job_desc *jd)
-{
- bool done;
- return wait_jobs(1, &jd, &done, GC_WAIT_ANY) == 1 && jd->status == JS_OK;
-}
-
-int
-gc_job_manager_impl::wait_jobs(unsigned int njobs,
- gc_job_desc *jd[],
- bool done[],
- gc_wait_mode mode)
-{
- unsigned int i;
-
- gc_client_thread_info *cti =
- (gc_client_thread_info *) pthread_getspecific(s_client_key);
- if (unlikely(cti == 0))
- return -1;
-
- for (i = 0; i < njobs; i++){
- done[i] = false;
- if (unlikely(jd[i]->sys.client_id != cti->d_client_id)){
- fprintf(stderr, "gc_job_manager_impl::wait_jobs: can't wait for a job you didn't submit\n");
- return -1;
- }
- }
-
- {
- scoped_lock l(cti->d_mutex);
-
- // setup info for event handler
- cti->d_state = (mode == GC_WAIT_ANY) ? CT_WAIT_ANY : CT_WAIT_ALL;
- cti->d_njobs_waiting_for = njobs;
- cti->d_jobs_waiting_for = jd;
- assert(cti->d_jobs_done != 0);
-
- unsigned int ndone = 0;
-
- // wait for jobs to complete
-
- while (1){
- ndone = 0;
- for (i= 0; i < njobs; i++){
- if (done[i])
- ndone++;
- else if (bv_isset(cti->d_jobs_done, jd[i]->sys.job_id)){
- bv_clr(cti->d_jobs_done, jd[i]->sys.job_id);
- done[i] = true;
- ndone++;
- }
- }
-
- if (mode == GC_WAIT_ANY && ndone > 0)
- break;
-
- if (mode == GC_WAIT_ALL && ndone == njobs)
- break;
-
- // FIXME what happens when somebody calls shutdown?
-
- cti->d_cond.wait(l); // wait for event handler to wake us up
- }
-
- cti->d_state = CT_NOT_WAITING;
- cti->d_njobs_waiting_for = 0; // tidy up (not reqd)
- cti->d_jobs_waiting_for = 0; // tidy up (not reqd)
- return ndone;
- }
-}
-
-////////////////////////////////////////////////////////////////////////
-
-bool
-gc_job_manager_impl::send_all_spes(uint32_t msg)
-{
- bool ok = true;
-
- for (unsigned int i = 0; i < d_options.nspes; i++)
- ok &= send_spe(i, msg);
-
- return ok;
-}
-
-bool
-gc_job_manager_impl::send_spe(unsigned int spe, uint32_t msg)
-{
- if (spe >= d_options.nspes)
- return false;
-
- int r = spe_in_mbox_write(d_worker[spe].spe_ctx, &msg, 1,
- SPE_MBOX_ALL_BLOCKING);
- if (r < 0){
- perror("spe_in_mbox_write");
- return false;
- }
-
- return r == 1;
-}
-
-void
-gc_job_manager_impl::tell_spes_to_check_queue()
-{
- int nspes = d_options.nspes;
-
- for (int i = 0, ntold = 0; ntold < d_ntell && i < nspes ; ++i){
- volatile spe_spu_control_area_t *spe_ctrl = d_worker[d_tell_start].spe_ctrl;
- int nfree = (spe_ctrl->SPU_Mbox_Stat >> 8) & 0xFF;
- if (nfree == 4){
- spe_ctrl->SPU_In_Mbox = MK_MBOX_MSG(OP_CHECK_QUEUE, 0);
- ntold++;
- }
-
- unsigned int t = d_tell_start + 1;
- if (t >= d_options.nspes)
- t = 0;
- d_tell_start = t;
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////
-
-static void
-pthread_create_failure_msg(int r, const char *which)
-{
- char buf[256];
- const char *s = 0;
-
- switch (r){
- case EAGAIN: s = "EAGAIN"; break;
- case EINVAL: s = "EINVAL"; break;
- case EPERM: s = "EPERM"; break;
- default:
- snprintf(buf, sizeof(buf), "Unknown error %d", r);
- s = buf;
- break;
- }
- fprintf(stderr, "pthread_create[%s] failed: %s\n", which, s);
-}
-
-
-static bool
-start_thread(pthread_t *thread,
- void *(*start_routine)(void *), void *arg,
- const char *msg)
-{
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
- // FIXME save sigprocmask
- // FIXME set sigprocmask
-
- int r = pthread_create(thread, &attr, start_routine, arg);
-
- // FIXME restore sigprocmask
-
- if (r != 0){
- pthread_create_failure_msg(r, msg);
- return false;
- }
- return true;
-}
-
-
-////////////////////////////////////////////////////////////////////////
-
-static void *start_worker(void *arg);
-
-static void *
-start_event_handler(void *arg)
-{
- gc_job_manager_impl *p = (gc_job_manager_impl *) arg;
- p->event_handler_loop();
- return 0;
-}
-
-static void *
-start_job_completer(void *arg)
-{
- gc_job_manager_impl *p = (gc_job_manager_impl *) arg;
- p->job_completer_loop();
- return 0;
-}
-
-void
-gc_job_manager_impl::create_event_handler()
-{
- // create the SPE event handler and register our interest in events
-
- d_spe_event_handler.ptr = spe_event_handler_create();
- if (d_spe_event_handler.ptr == 0){
- perror("spe_event_handler_create");
- throw std::runtime_error("spe_event_handler_create");
- }
-
- for (unsigned int i = 0; i < d_options.nspes; i++){
- spe_event_unit_t eu;
- memset(&eu, 0, sizeof(eu));
- eu.events = SPE_EVENT_OUT_INTR_MBOX | SPE_EVENT_SPE_STOPPED;
- eu.spe = d_worker[i].spe_ctx;
- eu.data.u32 = i; // set in events returned by spe_event_wait
-
- if (spe_event_handler_register(d_spe_event_handler.ptr, &eu) != 0){
- perror("spe_event_handler_register");
- throw std::runtime_error("spe_event_handler_register");
- }
- }
-
- // create the event handling thread
-
- if (!start_thread(&d_eh_thread, start_event_handler, this, "event_handler")){
- throw std::runtime_error("pthread_create");
- }
-
- // create the job completion thread
-
- if (!start_thread(&d_jc_thread, start_job_completer, this, "job_completer")){
- throw std::runtime_error("pthread_create");
- }
-
- // create the SPE worker threads
-
- bool ok = true;
- for (unsigned int i = 0; ok && i < d_options.nspes; i++){
- char name[256];
- snprintf(name, sizeof(name), "worker[%d]", i);
- ok &= start_thread(&d_worker[i].thread, start_worker,
- &d_worker[i], name);
- }
-
- if (!ok){
- //
- // FIXME Clean up the mess. Need to terminate event handler and all workers.
- //
- // this should cause the workers to exit, unless they're seriously broken
- send_all_spes(MK_MBOX_MSG(OP_EXIT, 0));
-
- shutdown();
-
- throw std::runtime_error("pthread_create");
- }
-}
-
-////////////////////////////////////////////////////////////////////////
-
-void
-gc_job_manager_impl::set_eh_state(evt_handler_state s)
-{
- scoped_lock l(d_eh_mutex);
- d_eh_state = s;
- d_eh_cond.notify_all();
-}
-
-void
-gc_job_manager_impl::set_ea_args_maxsize(int maxsize)
-{
- scoped_lock l(d_eh_mutex);
- d_ea_args_maxsize = maxsize;
- d_eh_cond.notify_all();
-}
-
-void
-gc_job_manager_impl::print_event(spe_event_unit_t *evt)
-{
- printf("evt: spe = %d events = (0x%x)", evt->data.u32, evt->events);
-
- if (evt->events & SPE_EVENT_OUT_INTR_MBOX)
- printf(" OUT_INTR_MBOX");
-
- if (evt->events & SPE_EVENT_IN_MBOX)
- printf(" IN_MBOX");
-
- if (evt->events & SPE_EVENT_TAG_GROUP)
- printf(" TAG_GROUP");
-
- if (evt->events & SPE_EVENT_SPE_STOPPED)
- printf(" SPE_STOPPED");
-
- printf("\n");
-}
-
-struct job_client_info {
- uint16_t job_id;
- uint16_t client_id;
-};
-
-static int
-compare_jci_clients(const void *va, const void *vb)
-{
- const job_client_info *a = (job_client_info *) va;
- const job_client_info *b = (job_client_info *) vb;
-
- return a->client_id - b->client_id;
-}
-
-void
-gc_job_manager_impl::notify_clients_jobs_are_done(unsigned int spe_num,
- unsigned int completion_info_idx)
-{
- const char *msg = "gc_job_manager_impl::notify_client_job_is_done (INTERNAL ERROR)";
-
- smp_rmb(); // order reads so we know that data sent from SPE is here
-
- gc_comp_info_t *ci = &d_comp_info[2 * spe_num + (completion_info_idx & 0x1)];
-
- if (ci->ncomplete == 0){ // never happens, but ensures code below is correct
- ci->in_use = 0;
- return;
- }
-
- decr_njobs_active(ci->ncomplete);
-
- if (0){
- static int total_jobs;
- static int total_msgs;
- total_msgs++;
- total_jobs += ci->ncomplete;
- printf("ppe: tj = %6d tm = %6d\n", total_jobs, total_msgs);
- }
-
- job_client_info gci[GC_CI_NJOBS];
-
- /*
- * Make one pass through and sanity check everything while filling in gci
- */
- for (unsigned int i = 0; i < ci->ncomplete; i++){
- unsigned int job_id = ci->job_id[i];
-
- if (job_id >= d_options.max_jobs){
- // internal error, shouldn't happen
- fprintf(stderr,"%s: invalid job_id = %d\n", msg, job_id);
- ci->in_use = 0; // clear flag so SPE knows we're done with it
- return;
- }
- gc_job_desc *jd = &d_jd[job_id];
-
- if (jd->sys.client_id >= d_options.max_client_threads){
- // internal error, shouldn't happen
- fprintf(stderr, "%s: invalid client_id = %d\n", msg, jd->sys.client_id);
- ci->in_use = 0; // clear flag so SPE knows we're done with it
- return;
- }
-
- gci[i].job_id = job_id;
- gci[i].client_id = jd->sys.client_id;
- }
-
- // sort by client_id so we only have to lock & signal once / client
-
- if (ci->ncomplete > 1)
- qsort(gci, ci->ncomplete, sizeof(gci[0]), compare_jci_clients);
-
- // "wind-in"
-
- gc_client_thread_info *last_cti = &d_client_thread[gci[0].client_id];
- last_cti->d_mutex.lock();
- bv_set(last_cti->d_jobs_done, gci[0].job_id); // mark job done
-
- for (unsigned int i = 1; i < ci->ncomplete; i++){
-
- gc_client_thread_info *cti = &d_client_thread[gci[i].client_id];
-
- if (cti != last_cti){ // new client?
-
- // yes. signal old client, unlock old, lock new
-
- // FIXME we could distinguish between CT_WAIT_ALL & CT_WAIT_ANY
-
- if (last_cti->d_state == CT_WAIT_ANY || last_cti->d_state == CT_WAIT_ALL)
- last_cti->d_cond.notify_one(); // wake client thread up
-
- last_cti->d_mutex.unlock();
- cti->d_mutex.lock();
- last_cti = cti;
- }
-
- // mark job done
- bv_set(cti->d_jobs_done, gci[i].job_id);
- }
-
- // "wind-out"
-
- if (last_cti->d_state == CT_WAIT_ANY || last_cti->d_state == CT_WAIT_ALL)
- last_cti->d_cond.notify_one(); // wake client thread up
- last_cti->d_mutex.unlock();
-
- ci->in_use = 0; // clear flag so SPE knows we're done with it
-}
-
-void
-gc_job_manager_impl::handle_event(spe_event_unit_t *evt)
-{
- // print_event(evt);
-
- int spe_num = evt->data.u32;
-
- // only a single event type can be signaled at a time
-
- if (evt->events == SPE_EVENT_OUT_INTR_MBOX) { // SPE sent us 1 or more msgs
- static const int NMSGS = 32;
- unsigned int msg[NMSGS];
- int n = spe_out_intr_mbox_read(evt->spe, msg, NMSGS, SPE_MBOX_ANY_BLOCKING);
- // printf("spe_out_intr_mbox_read = %d\n", n);
- if (n < 0){
- perror("spe_out_intr_mbox_read");
- }
- else {
- for (int i = 0; i < n; i++){
- switch(MBOX_MSG_OP(msg[i])){
-#if 0
- case OP_JOBS_DONE:
- if (debug())
- printf("eh: job_done (0x%08x) from spu[%d]\n", msg[i], spe_num);
- notify_clients_jobs_are_done(spe_num, MBOX_MSG_ARG(msg[i]));
- break;
-#endif
- case OP_SPU_BUFSIZE:
- set_ea_args_maxsize(MBOX_MSG_ARG(msg[i]));
- break;
-
- case OP_EXIT:
- default:
- printf("eh: Unexpected msg (0x%08x) from spu[%d]\n", msg[i], spe_num);
- break;
- }
- }
- }
- }
- else if (evt->events == SPE_EVENT_SPE_STOPPED){ // the SPE stopped
- spe_stop_info_t si;
- int r = spe_stop_info_read(evt->spe, &si);
- if (r < 0){
- perror("spe_stop_info_read");
- }
- else {
- switch (si.stop_reason){
- case SPE_EXIT:
- if (debug()){
- printf("eh: spu[%d] SPE_EXIT w/ exit_code = %d\n",
- spe_num, si.result.spe_exit_code);
- }
- break;
- case SPE_STOP_AND_SIGNAL:
- printf("eh: spu[%d] SPE_STOP_AND_SIGNAL w/ spe_signal_code = 0x%x\n",
- spe_num, si.result.spe_signal_code);
- break;
- case SPE_RUNTIME_ERROR:
- printf("eh: spu[%d] SPE_RUNTIME_ERROR w/ spe_runtime_error = 0x%x\n",
- spe_num, si.result.spe_runtime_error);
- break;
- case SPE_RUNTIME_EXCEPTION:
- printf("eh: spu[%d] SPE_RUNTIME_EXCEPTION w/ spe_runtime_exception = 0x%x\n",
- spe_num, si.result.spe_runtime_exception);
- break;
- case SPE_RUNTIME_FATAL:
- printf("eh: spu[%d] SPE_RUNTIME_FATAL w/ spe_runtime_fatal = 0x%x\n",
- spe_num, si.result.spe_runtime_fatal);
- break;
- case SPE_CALLBACK_ERROR:
- printf("eh: spu[%d] SPE_CALLBACK_ERROR w/ spe_callback_error = 0x%x\n",
- spe_num, si.result.spe_callback_error);
- break;
- case SPE_ISOLATION_ERROR:
- printf("eh: spu[%d] SPE_ISOLATION_ERROR w/ spe_isolation_error = 0x%x\n",
- spe_num, si.result.spe_isolation_error);
- break;
- default:
- printf("eh: spu[%d] UNKNOWN STOP REASON (%d) w/ spu_status = 0x%x\n",
- spe_num, si.stop_reason, si.spu_status);
- break;
- }
- }
- }
-#if 0 // not enabled
- else if (evt->events == SPE_EVENT_IN_MBOX){ // there's room to write to SPE
- // spe_in_mbox_write (ignore)
- }
- else if (evt->events == SPE_EVENT_TAG_GROUP){ // our DMA completed
- // spe_mfcio_tag_status_read
- }
-#endif
- else {
- fprintf(stderr, "handle_event: unexpected evt->events = 0x%x\n", evt->events);
- return;
- }
-}
-
-//
-// This is the "main program" of the event handling thread
-//
-void
-gc_job_manager_impl::event_handler_loop()
-{
- static const int MAX_EVENTS = 16;
- static const int TIMEOUT = 20; // how long to block in milliseconds
-
- spe_event_unit_t events[MAX_EVENTS];
-
- if (d_debug)
- printf("event_handler_loop: starting\n");
-
- set_eh_state(EHS_RUNNING);
-
- // ask the first spe for its max bufsize
- send_spe(0, MK_MBOX_MSG(OP_GET_SPU_BUFSIZE, 0));
-
- while (1){
- switch(d_eh_state){
-
- case EHS_RUNNING: // normal stuff
- if (d_shutdown_requested) {
- set_eh_state(EHS_SHUTTING_DOWN);
- }
- break;
-
- case EHS_SHUTTING_DOWN:
- if (d_jc_state == JCS_DEAD){
- send_all_spes(MK_MBOX_MSG(OP_EXIT, 0));
- set_eh_state(EHS_WAITING_FOR_WORKERS_TO_DIE);
- }
- break;
-
- case EHS_WAITING_FOR_WORKERS_TO_DIE:
- {
- bool all_dead = true;
- for (unsigned int i = 0; i < d_options.nspes; i++)
- all_dead &= d_worker[i].state == WS_DEAD;
-
- if (all_dead){
- set_eh_state(EHS_DEAD);
- if (d_debug)
- printf("event_handler_loop: exiting\n");
- return;
- }
- }
- break;
-
- default:
- set_eh_state(EHS_DEAD);
- printf("event_handler_loop(default): exiting\n");
- return;
- }
-
- // block waiting for events...
- int nevents = spe_event_wait(d_spe_event_handler.ptr,
- events, MAX_EVENTS, TIMEOUT);
- if (nevents < 0){
- perror("spe_wait_event");
- // FIXME bail?
- }
- for (int i = 0; i < nevents; i++){
- handle_event(&events[i]);
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////
-
-void
-gc_job_manager_impl::poll_for_job_completion()
-{
- static const int niter = 10000;
-
- CCTPL(); // change current (h/w) thread priority to low
-
- for (int n = 0; n < niter; n++){
-
- for (unsigned int spe_num = 0; spe_num < d_options.nspes; spe_num++){
- volatile spe_spu_control_area_t *spe_ctrl = d_worker[spe_num].spe_ctrl;
- int nentries = spe_ctrl->SPU_Mbox_Stat & 0xFF;
- while (nentries-- > 0){
- unsigned int msg = spe_ctrl->SPU_Out_Mbox;
- switch(MBOX_MSG_OP(msg)){
- case OP_JOBS_DONE:
- if (debug())
- printf("jc: job_done (0x%08x) from spu[%d]\n", msg, spe_num);
-
- CCTPM(); // change current thread priority to medium
- notify_clients_jobs_are_done(spe_num, MBOX_MSG_ARG(msg));
- CCTPL();
- break;
-
- default:
- printf("jc: Unexpected msg (0x%08x) from spu[%d]\n", msg, spe_num);
- break;
- }
- }
- }
- }
- CCTPM();
-}
-
-//
-// This is the "main program" of the job completer thread
-//
-void
-gc_job_manager_impl::job_completer_loop()
-{
- d_jc_state = JCS_RUNNING;
-
- while (1){
- {
- scoped_lock l(d_jc_mutex);
- if (d_jc_njobs_active == 0){
- if (d_shutdown_requested){
- d_jc_state = JCS_DEAD;
- return;
- }
- d_jc_cond.wait(l);
- }
- }
-
- poll_for_job_completion();
- }
-}
-
-////////////////////////////////////////////////////////////////////////
-// this is the top of the SPE worker threads
-
-static void *
-start_worker(void *arg)
-{
- worker_ctx *w = (worker_ctx *) arg;
- spe_stop_info_t si;
-
- w->state = WS_RUNNING;
- if (s_worker_debug)
- printf("worker[%d]: WS_RUNNING\n", w->spe_idx);
-
- unsigned int entry = SPE_DEFAULT_ENTRY;
- int r = spe_context_run(w->spe_ctx, &entry, 0, w->spu_args, 0, &si);
-
- if (r < 0){ // error
- char buf[64];
- snprintf(buf, sizeof(buf), "worker[%d]: spe_context_run", w->spe_idx);
- perror(buf);
- }
- else if (r == 0){
- // spe program called exit.
- if (s_worker_debug)
- printf("worker[%d]: SPE_EXIT w/ exit_code = %d\n",
- w->spe_idx, si.result.spe_exit_code);
- }
- else {
- // called stop_and_signal
- //
- // I'm not sure we'll ever get here. I think the event
- // handler will catch this...
- printf("worker[%d]: SPE_STOP_AND_SIGNAL w/ spe_signal_code = 0x%x\n",
- w->spe_idx, si.result.spe_signal_code);
- }
-
- // in any event, we're committing suicide now ;)
- if (s_worker_debug)
- printf("worker[%d]: WS_DEAD\n", w->spe_idx);
-
- w->state = WS_DEAD;
- return 0;
-}
-
-////////////////////////////////////////////////////////////////////////
-
-gc_client_thread_info *
-gc_job_manager_impl::alloc_cti()
-{
- for (unsigned int i = 0; i < d_options.max_client_threads; i++){
- if (d_client_thread[i].d_free){
- // try to atomically grab it
- if (_atomic_dec_if_positive(ptr_to_ea(&d_client_thread[i].d_free)) == 0){
- // got it...
- gc_client_thread_info *cti = &d_client_thread[i];
- cti->d_state = CT_NOT_WAITING;
- bv_zero(cti->d_jobs_done);
- cti->d_njobs_waiting_for = 0;
- cti->d_jobs_waiting_for = 0;
-
- return cti;
- }
- }
- }
- return 0;
-}
-
-void
-gc_job_manager_impl::free_cti(gc_client_thread_info *cti)
-{
- assert((size_t) (cti - d_client_thread.get()) < d_options.max_client_threads);
- cti->d_free = 1;
-}
-
-int
-gc_job_manager_impl::ea_args_maxsize()
-{
- scoped_lock l(d_eh_mutex);
-
- while (d_ea_args_maxsize == 0) // wait for it to be initialized
- d_eh_cond.wait(l);
-
- return d_ea_args_maxsize;
-}
-
-void
-gc_job_manager_impl::set_debug(int debug)
-{
- d_debug = debug;
- s_worker_debug = debug;
-}
-
-int
-gc_job_manager_impl::debug()
-{
- return d_debug;
-}
-
-////////////////////////////////////////////////////////////////////////
-
-void
-gc_job_manager_impl::setup_logfiles()
-{
- if (!d_options.enable_logging)
- return;
-
- if (d_options.log2_nlog_entries == 0)
- d_options.log2_nlog_entries = 12;
-
- // must end up a multiple of the page size
-
- size_t pagesize = getpagesize();
- size_t s = (1 << d_options.log2_nlog_entries) * sizeof(gc_log_entry_t);
- s = ((s + pagesize - 1) / pagesize) * pagesize;
- size_t nentries = s / sizeof(gc_log_entry_t);
- assert(is_power_of_2(nentries));
-
- for (unsigned int i = 0; i < d_options.nspes; i++){
- char filename[100];
- snprintf(filename, sizeof(filename), "spu_log.%02d", i);
- int fd = open(filename, O_CREAT|O_TRUNC|O_RDWR, 0664);
- if (fd == -1){
- perror(filename);
- return;
- }
- lseek(fd, s - 1, SEEK_SET);
- write(fd, "\0", 1);
- void *p = mmap(0, s, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
- if (p == MAP_FAILED){
- perror("gc_job_manager_impl::setup_logfiles: mmap");
- close(fd);
- return;
- }
- close(fd);
- memset(p, 0, s);
- d_spu_args[i].log.base = ptr_to_ea(p);
- d_spu_args[i].log.nentries = nentries;
- }
-}
-
-void
-gc_job_manager_impl::sync_logfiles()
-{
- for (unsigned int i = 0; i < d_options.nspes; i++){
- if (d_spu_args[i].log.base)
- msync(ea_to_ptr(d_spu_args[i].log.base),
- d_spu_args[i].log.nentries * sizeof(gc_log_entry_t),
- MS_ASYNC);
- }
-}
-
-void
-gc_job_manager_impl::unmap_logfiles()
-{
- for (unsigned int i = 0; i < d_options.nspes; i++){
- if (d_spu_args[i].log.base)
- munmap(ea_to_ptr(d_spu_args[i].log.base),
- d_spu_args[i].log.nentries * sizeof(gc_log_entry_t));
- }
-}
-
-////////////////////////////////////////////////////////////////////////
-//
-// lookup proc names in d_proc_def table
-
-gc_proc_id_t
-gc_job_manager_impl::lookup_proc(const std::string &proc_name)
-{
- for (int i = 0; i < d_nproc_defs; i++)
- if (proc_name == d_proc_def[i].name)
- return i;
-
- throw gc_unknown_proc(proc_name);
-}
-
-std::vector<std::string>
-gc_job_manager_impl::proc_names()
-{
- std::vector<std::string> r;
- for (int i = 0; i < d_nproc_defs; i++)
- r.push_back(d_proc_def[i].name);
-
- return r;
-}
-
-////////////////////////////////////////////////////////////////////////
-
-worker_ctx::~worker_ctx()
-{
- if (spe_ctx){
- int r = spe_context_destroy(spe_ctx);
- if (r != 0){
- perror("spe_context_destroy");
- }
- spe_ctx = 0;
- }
- state = WS_FREE;
-}
diff --git a/gcell/lib/runtime/gc_job_manager_impl.h b/gcell/lib/runtime/gc_job_manager_impl.h
deleted file mode 100644
index 640fdfe79..000000000
--- a/gcell/lib/runtime/gc_job_manager_impl.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,2009,2010 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_GC_JOB_MANAGER_IMPL_H
-#define INCLUDED_GC_JOB_MANAGER_IMPL_H
-
-#include <gcell/gc_job_manager.h>
-#include <gcell/gc_jd_stack.h>
-#include <gcell/gc_jd_queue.h>
-#include <gcell/gc_spu_args.h>
-#include "gc_client_thread_info.h"
-#include <libspe2.h>
-#include <vector>
-#include <boost/scoped_array.hpp>
-
-typedef boost::shared_ptr<spe_gang_context> spe_gang_context_sptr;
-typedef boost::shared_ptr<spe_program_handle_t> spe_program_handle_sptr;
-typedef boost::scoped_array<gc_client_thread_info> gc_client_thread_info_sa;
-
-
-enum worker_state {
- WS_FREE, // not in use
- WS_INIT, // allocated and being initialized
- WS_RUNNING, // the thread is running
- WS_DEAD, // the thread is dead
-};
-
-struct worker_ctx {
- volatile worker_state state;
- unsigned int spe_idx; // [0, nspes-1]
- spe_context_ptr_t spe_ctx;
- spe_spu_control_area_t *spe_ctrl;
- pthread_t thread;
- gc_spu_args_t *spu_args; // pointer to 16-byte aligned struct
-
- worker_ctx()
- : state(WS_FREE), spe_idx(0), spe_ctx(0), spe_ctrl(0),
- thread(0), spu_args(0) {}
- ~worker_ctx();
-};
-
-enum evt_handler_state {
- EHS_INIT, // being initialized
- EHS_RUNNING, // thread is running
- EHS_SHUTTING_DOWN, // in process of shutting down everything
- EHS_WAITING_FOR_WORKERS_TO_DIE,
- EHS_DEAD, // thread is dead
-};
-
-enum job_completer_state {
- JCS_INIT, // being initialized
- JCS_RUNNING, // thread is running
- JCS_DEAD, // thread is dead
-};
-
-struct spe_event_handler {
- spe_event_handler_ptr_t ptr;
-
- spe_event_handler() : ptr(0) {}
- ~spe_event_handler(){
- if (ptr){
- if (spe_event_handler_destroy(ptr) != 0){
- perror("spe_event_handler_destroy");
- }
- }
- }
-};
-
-
-/*!
- * \brief Concrete class that manages SPE jobs.
- *
- * This class contains all the implementation details.
- */
-class gc_job_manager_impl : public gc_job_manager
-{
- enum { MAX_SPES = 16 };
-
- int d_debug;
- gc_jm_options d_options;
- spe_program_handle_sptr d_spe_image;
- spe_gang_context_sptr d_gang; // boost::shared_ptr
-
- worker_ctx d_worker[MAX_SPES]; // SPE ctx, thread, etc
- gc_spu_args_t *d_spu_args; // 16-byte aligned structs
- boost::shared_ptr<void> _d_spu_args_boost; // hack for automatic storage mgmt
-
- gc_comp_info_t *d_comp_info; // 128-byte aligned structs
- boost::shared_ptr<void> _d_comp_info_boost; // hack for automatic storage mgmt
-
- // used to coordinate communication w/ the event handling thread
- boost::mutex d_eh_mutex;
- boost::condition_variable d_eh_cond;
- pthread_t d_eh_thread; // the event handler thread
- volatile evt_handler_state d_eh_state;
- volatile bool d_shutdown_requested;
- spe_event_handler d_spe_event_handler;
-
- // used to coordinate communication w/ the job completer thread
- boost::mutex d_jc_mutex;
- boost::condition_variable d_jc_cond;
- pthread_t d_jc_thread; // the job completion thread
- volatile job_completer_state d_jc_state;
- int d_jc_njobs_active; // # of jobs submitted but not yet reaped
-
- // round robin notification of spes
- int d_ntell; // # of spes to tell
- unsigned int d_tell_start; // which one to start with
-
- // All of the job descriptors are hung off of here.
- // We allocate them all in a single cache aligned chunk.
- gc_job_desc_t *d_jd; // [options.max_jobs]
- boost::shared_ptr<void> _d_jd_boost; // hack for automatic storage mgmt
-
- gc_client_thread_info_sa d_client_thread; // [options.max_client_threads]
-
- // We use bitvectors to represent the completing state of a job. Each
- // bitvector is d_bvlen longs in length.
- int d_bvlen; // bit vector length in longs
-
- // This contains the storage for all the bitvectors used by the job
- // manager. There's 1 for each client thread, in the d_jobs_done
- // field. We allocate them all in a single cache aligned chunk.
- boost::shared_ptr<void> _d_all_bitvectors; // hack for automatic storage mgmt
-
- // Lock free stack where we keep track of the free job descriptors.
- gc_jd_stack_t *d_free_list; // stack of free job descriptors
- boost::shared_ptr<void> _d_free_list_boost; // hack for automatic storage mgmt
-
- // The PPE inserts jobs here; SPEs pull jobs from here.
- gc_jd_queue_t *d_queue; // job queue
- boost::shared_ptr<void> _d_queue_boost; // hack for automatic storage mgmt
-
- int d_ea_args_maxsize;
-
- struct gc_proc_def *d_proc_def; // the SPE procedure table
- uint32_t d_proc_def_ls_addr; // the LS address of the table
- int d_nproc_defs; // number of proc_defs in table
-
- gc_client_thread_info *alloc_cti();
- void free_cti(gc_client_thread_info *cti);
-
- void create_event_handler();
- void set_eh_state(evt_handler_state s);
- void set_ea_args_maxsize(int maxsize);
-
- void notify_clients_jobs_are_done(unsigned int spe_num,
- unsigned int completion_info_idx);
-
-public:
- void event_handler_loop(); // really private
- void job_completer_loop(); // really private
-
-private:
- bool send_all_spes(uint32_t msg);
- bool send_spe(unsigned int spe, uint32_t msg);
- void print_event(spe_event_unit_t *evt);
- void handle_event(spe_event_unit_t *evt);
- bool incr_njobs_active();
- void decr_njobs_active(int n);
- void tell_spes_to_check_queue();
- void poll_for_job_completion();
-
- // bitvector ops
- void bv_zero(unsigned long *bv);
- void bv_clr(unsigned long *bv, unsigned int bitno);
- void bv_set(unsigned long *bv, unsigned int bitno);
- bool bv_isset(unsigned long *bv, unsigned int bitno);
- bool bv_isclr(unsigned long *bv, unsigned int bitno);
-
- void setup_logfiles();
- void sync_logfiles();
- void unmap_logfiles();
-
- friend gc_job_manager_sptr gc_make_job_manager(const gc_jm_options *options);
-
- gc_job_manager_impl(const gc_jm_options *options = 0);
-
-public:
- virtual ~gc_job_manager_impl();
-
- /*!
- * Stop accepting new jobs. Wait for existing jobs to complete.
- * Return all managed SPE's to the system.
- */
- virtual bool shutdown();
-
- /*!
- * \brief Return number of SPE's currently allocated to job manager.
- */
- virtual int nspes() const;
-
- /*!
- * \brief Return a pointer to a properly aligned job descriptor,
- * or zero if none are available.
- */
- virtual gc_job_desc *alloc_job_desc();
-
- /*
- *! Return a job descriptor previously allocated with alloc_job_desc()
- *
- * \param[in] jd pointer to job descriptor to free.
- */
- virtual void free_job_desc(gc_job_desc *jd);
-
- /*!
- * \brief Submit a job for asynchronous processing on an SPE.
- *
- * \param[in] jd pointer to job description
- *
- * The caller must not read or write the job description
- * or any of the memory associated with any indirect arguments
- * until after calling wait_job.
- *
- * \returns true iff the job was successfully enqueued.
- * If submit_job returns false, check jd->status for additional info.
- */
- virtual bool submit_job(gc_job_desc *jd);
-
- /*!
- * \brief Wait for job to complete.
- *
- * A thread may only wait for jobs which it submitted.
- *
- * \returns true if sucessful, else false.
- */
- virtual bool
- wait_job(gc_job_desc *jd);
-
- /*!
- * \brief wait for 1 or more jobs to complete.
- *
- * \param[in] njobs is the length of arrays \p jd and \p done.
- * \param[in] jd are the jobs that are to be waited for.
- * \param[out] done indicates whether the corresponding job is complete.
- * \param[in] mode indicates whether to wait for ALL or ANY of the jobs
- * in \p jd to complete.
- *
- * A thread may only wait for jobs which it submitted.
- *
- * \returns number of jobs completed, or -1 if error.
- */
- virtual int
- wait_jobs(unsigned int njobs,
- gc_job_desc *jd[], bool done[], gc_wait_mode mode);
-
- virtual int ea_args_maxsize();
-
- virtual gc_proc_id_t lookup_proc(const std::string &name);
- virtual std::vector<std::string> proc_names();
-
- virtual void set_debug(int debug);
- virtual int debug();
-};
-
-#endif /* INCLUDED_GC_JOB_MANAGER_IMPL_H */
diff --git a/gcell/lib/runtime/gc_proc_def_utils.cc b/gcell/lib/runtime/gc_proc_def_utils.cc
deleted file mode 100644
index 0250d677a..000000000
--- a/gcell/lib/runtime/gc_proc_def_utils.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gc_proc_def_utils.h>
-#include <gcell/gc_declare_proc.h>
-#include <elf.h>
-#include <stdio.h>
-#include <string.h>
-
-static const unsigned char expected[EI_PAD] = {
- ELFMAG0,
- ELFMAG1,
- ELFMAG2,
- ELFMAG3,
- ELFCLASS32,
- ELFDATA2MSB,
- EV_CURRENT,
- ELFOSABI_SYSV,
- 0
-};
-
-
-/*
- * Basically we're going to find the GC_PROC_DEF_SECTION section
- * in the ELF file and return a pointer to it. The only things in that
- * section are gc_proc_def's
- */
-bool
-gcpd_find_table(spe_program_handle_t *handle,
- struct gc_proc_def **table, int *nentries, uint32_t *ls_addr)
-{
- if (!handle || !table || !nentries)
- return false;
-
- *table = 0;
- *nentries = 0;
-
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *)handle->elf_image;
- if (!ehdr){
- fprintf(stderr, "gcpd: No ELF image has been loaded\n");
- return false;
- }
-
- // quick check that we're looking at a SPE EXEC object
-
- if (memcmp(ehdr->e_ident, expected, EI_PAD) != 0){
- fprintf(stderr, "gcpd: invalid ELF header\n");
- return false;
- }
-
- if (ehdr->e_machine != 0x17){ // confirm machine type (EM_SPU)
- fprintf(stderr, "gcpd: not an SPE ELF object\n");
- return false;
- }
-
- if (ehdr->e_type != ET_EXEC){
- fprintf(stderr, "gcpd: invalid SPE ELF type.\n");
- fprintf(stderr, "gcpd: SPE type %d != %d\n", ehdr->e_type, ET_EXEC);
- return false;
- }
-
- // find the section header table
-
- Elf32_Shdr *shdr;
- Elf32_Shdr *sh;
-
- if (ehdr->e_shentsize != sizeof (*shdr)){
- fprintf(stderr, "gcpd: invalid section header format.\n");
- return false;
- }
-
- if (ehdr->e_shnum == 0){
- fprintf(stderr, "gcpd: no section headers in file.\n");
- return false;
- }
-
- shdr = (Elf32_Shdr *) ((char *)ehdr + ehdr->e_shoff);
- char *str_table = (char *)ehdr + shdr[ehdr->e_shstrndx].sh_offset;
-
- // traverse the sections looking for GC_PROC_DEF_SECTION
-
- for (sh = shdr; sh < &shdr[ehdr->e_shnum]; sh++){
- if (0){
- fprintf(stderr, "section name: %s (start: 0x%04x, size: 0x%04x)\n",
- str_table + sh->sh_name, sh->sh_offset, sh->sh_size);
- }
-
- if (strcmp(GC_PROC_DEF_SECTION, str_table+sh->sh_name) == 0){
- *table = (struct gc_proc_def *)((char *)ehdr + sh->sh_offset);
- if (sh->sh_size % (sizeof(struct gc_proc_def)) != 0){
- fprintf(stderr, "gcpd: %s section has invalid format\n", GC_PROC_DEF_SECTION);
- return false;
- }
- *nentries = sh->sh_size / sizeof(struct gc_proc_def);
- *ls_addr = sh->sh_addr;
- return true;
- }
- }
-
- return false;
-}
diff --git a/gcell/lib/runtime/gc_proc_def_utils.h b/gcell/lib/runtime/gc_proc_def_utils.h
deleted file mode 100644
index 79c9b51aa..000000000
--- a/gcell/lib/runtime/gc_proc_def_utils.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GC_PROC_DEF_UTILS_H
-#define INCLUDED_GC_PROC_DEF_UTILS_H
-
-#include <gcell/gc_declare_proc.h>
-#include <libspe2.h>
-
-/*!
- * \brief find the gc_proc_def table in the SPE program
- *
- * \param[in] program is the handle to the loaded SPE program
- * \param[out] table points to the table, if it's found
- * \param[out] nentries is set to the number of entries in the table.
- * \param[out] ls_addr is set to the Local Store address of the table
- *
- * \returns true if successful, else false
- */
-bool
-gcpd_find_table(spe_program_handle_t *program,
- struct gc_proc_def **table, int *nentries, uint32_t *ls_addr);
-
-
-#endif /* INCLUDED_GC_PROC_DEF_UTILS_H */
diff --git a/gcell/lib/runtime/gcell-embedspu-libtool b/gcell/lib/runtime/gcell-embedspu-libtool
deleted file mode 100755
index c206086a4..000000000
--- a/gcell/lib/runtime/gcell-embedspu-libtool
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-#
-# Take a spu executable and turn into into a libtool compatible .lo (and .o) file.
-# This is needed when you want to embed a SPU executable into a shared library.
-#
-# The symbol assigned to the embedded executable is the basename of the
-# output file with an _spx appended. E.g., if the output filename is
-# my_spe_tricks.lo the symbol name is my_spe_tricks_spx.
-# ("_spx" stands for SPE executable)
-
-if [ $# -ne 2 ]; then
- echo "usage: gcell-embedspu-libtool spu_executable output_file.lo " 1>&2
- exit 1
-fi
-
-spu_executable=$1
-lo_file=$2
-symbol_name=${lo_file%%.lo}_spx
-
-# try to make .libs in case it's not there
-mkdir .libs >/dev/null 2>/dev/null
-
-# generate the .o file that wraps the SPU executable
-ppu-embedspu -m32 -fpic ${symbol_name} ${spu_executable} .libs/${symbol_name}.o
-
-# generate the .lo libtool file that points at all the right places
-rm -f $lo_file
-cat >$lo_file.new <<EOF
-# $lo_file - a libtool object file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-pic_object='.libs/${symbol_name}.o'
-non_pic_object=none
-EOF
-
-mv $lo_file.new $lo_file
-
diff --git a/gcell/lib/runtime/qa_gcell_runtime.cc b/gcell/lib/runtime/qa_gcell_runtime.cc
deleted file mode 100644
index fef9a7fb4..000000000
--- a/gcell/lib/runtime/qa_gcell_runtime.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/*
- * This class gathers together all the test cases for the lib
- * directory into a single test suite. As you create new test cases,
- * add them here.
- */
-
-#include <qa_gcell_runtime.h>
-#include <qa_jd_stack.h>
-#include <qa_jd_queue.h>
-#include <qa_job_manager.h>
-
-CppUnit::TestSuite *
-qa_gcell_runtime::suite()
-{
- CppUnit::TestSuite *s = new CppUnit::TestSuite("runtime");
-
- s->addTest(qa_jd_stack::suite());
- s->addTest(qa_jd_queue::suite());
- s->addTest(qa_job_manager::suite());
-
- return s;
-}
diff --git a/gcell/lib/runtime/qa_gcell_runtime.h b/gcell/lib/runtime/qa_gcell_runtime.h
deleted file mode 100644
index 36180c919..000000000
--- a/gcell/lib/runtime/qa_gcell_runtime.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_QA_GCELL_RUNTIME_H
-#define INCLUDED_QA_GCELL_RUNTIME_H
-
-#include <cppunit/TestSuite.h>
-
-//! collect all the tests for the runtime directory
-
-class qa_gcell_runtime {
-public:
- //! return suite of tests
- static CppUnit::TestSuite *suite();
-};
-
-
-#endif /* INCLUDED_QA_GCELL_RUNTIME_H */
diff --git a/gcell/lib/runtime/qa_jd_queue.cc b/gcell/lib/runtime/qa_jd_queue.cc
deleted file mode 100644
index 35ab9d82f..000000000
--- a/gcell/lib/runtime/qa_jd_queue.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "qa_jd_queue.h"
-#include <cppunit/TestAssert.h>
-#include <gcell/gc_jd_queue.h>
-#include <stdio.h>
-
-
-
-static const int NJDS = 16;
-static gc_jd_queue_t queue;
-static gc_job_desc_t jds[NJDS];
-
-// no brainer, single threaded basic checkout
-void
-qa_jd_queue::t1()
-{
- // N.B., queue allocated stuff doesn't obey ((aligned (N))) attributes
- //const int NJDS = 8;
- //gc_jd_queue_t queue;
- //gc_job_desc_t jds[NJDS];
-
- //printf("&queue = %p\n", &queue);
- //printf("&jds[0] = %p\n", &jds[0]);
- //printf("&jds[1] = %p\n", &jds[1]);
-
- CPPUNIT_ASSERT(((uintptr_t) &queue & 0x7f) == 0);
- CPPUNIT_ASSERT(((uintptr_t) &jds[0] & 0x7f) == 0);
- CPPUNIT_ASSERT(((uintptr_t) &jds[1] & 0x7f) == 0);
-
- gc_jd_queue_init(&queue);
-
- CPPUNIT_ASSERT(gc_jd_queue_dequeue(&queue) == 0);
-
- gc_jd_queue_enqueue(&queue, &jds[0]);
- CPPUNIT_ASSERT_EQUAL(&jds[0], gc_jd_queue_dequeue(&queue));
-
- CPPUNIT_ASSERT(gc_jd_queue_dequeue(&queue) == 0);
-
- for (int i = 0; i < NJDS; i++)
- gc_jd_queue_enqueue(&queue, &jds[i]);
-
- for (int i = 0; i < NJDS; i++)
- CPPUNIT_ASSERT_EQUAL(&jds[i], gc_jd_queue_dequeue(&queue));
-
- CPPUNIT_ASSERT(gc_jd_queue_dequeue(&queue) == 0);
-}
-
-// FIXME multithreaded (running on PPE)
-void
-qa_jd_queue::t2()
-{
-}
-
-// FIXME multithreaded (running on PPE & SPE)
-void
-qa_jd_queue::t3()
-{
-}
diff --git a/gcell/lib/runtime/qa_jd_queue.h b/gcell/lib/runtime/qa_jd_queue.h
deleted file mode 100644
index 5e1aab84f..000000000
--- a/gcell/lib/runtime/qa_jd_queue.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_QA_JD_QUEUE_H
-#define INCLUDED_QA_JD_QUEUE_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestCase.h>
-
-class qa_jd_queue : public CppUnit::TestCase {
-
- CPPUNIT_TEST_SUITE(qa_jd_queue);
- CPPUNIT_TEST(t1);
- CPPUNIT_TEST(t2);
- CPPUNIT_TEST(t3);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- void t1();
- void t2();
- void t3();
-};
-
-
-#endif /* INCLUDED_QA_JD_QUEUE_H */
diff --git a/gcell/lib/runtime/qa_jd_stack.cc b/gcell/lib/runtime/qa_jd_stack.cc
deleted file mode 100644
index ce4ce2d0d..000000000
--- a/gcell/lib/runtime/qa_jd_stack.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "qa_jd_stack.h"
-#include <cppunit/TestAssert.h>
-#include <gcell/gc_jd_stack.h>
-#include <stdio.h>
-
-
-
-static const int NJDS = 8;
-static gc_jd_stack_t stack;
-static gc_job_desc_t jds[NJDS];
-
-// no brainer, single threaded basic checkout
-void
-qa_jd_stack::t1()
-{
- // N.B., stack allocated stuff doesn't obey ((aligned (N))) attributes
- //const int NJDS = 8;
- //gc_jd_stack_t stack;
- //gc_job_desc_t jds[NJDS];
-
- //printf("&stack = %p\n", &stack);
- //printf("&jds[0] = %p\n", &jds[0]);
- //printf("&jds[1] = %p\n", &jds[1]);
-
- CPPUNIT_ASSERT(((uintptr_t) &stack & 0x7f) == 0);
- CPPUNIT_ASSERT(((uintptr_t) &jds[0] & 0x7f) == 0);
- CPPUNIT_ASSERT(((uintptr_t) &jds[1] & 0x7f) == 0);
-
- gc_jd_stack_init(&stack);
-
- CPPUNIT_ASSERT(gc_jd_stack_pop(&stack) == 0);
-
- for (int i = 0; i < NJDS; i++)
- gc_jd_stack_push(&stack, &jds[i]);
-
- for (int i = 0; i < NJDS; i++)
- CPPUNIT_ASSERT_EQUAL(&jds[NJDS - i - 1], gc_jd_stack_pop(&stack));
-
- CPPUNIT_ASSERT(gc_jd_stack_pop(&stack) == 0);
-}
-
-// FIXME multithreaded (running on PPE)
-void
-qa_jd_stack::t2()
-{
-}
diff --git a/gcell/lib/runtime/qa_jd_stack.h b/gcell/lib/runtime/qa_jd_stack.h
deleted file mode 100644
index 1546bbf9f..000000000
--- a/gcell/lib/runtime/qa_jd_stack.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_QA_JD_STACK_H
-#define INCLUDED_QA_JD_STACK_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestCase.h>
-
-class qa_jd_stack : public CppUnit::TestCase {
-
- CPPUNIT_TEST_SUITE(qa_jd_stack);
- CPPUNIT_TEST(t1);
- CPPUNIT_TEST(t2);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- void t1();
- void t2();
-
-};
-
-
-
-#endif /* INCLUDED_QA_JD_STACK_H */
diff --git a/gcell/lib/runtime/qa_job_manager.cc b/gcell/lib/runtime/qa_job_manager.cc
deleted file mode 100644
index 45cf26cfc..000000000
--- a/gcell/lib/runtime/qa_job_manager.cc
+++ /dev/null
@@ -1,790 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "qa_job_manager.h"
-#include <cppunit/TestAssert.h>
-#include <gcell/gc_job_manager.h>
-#include <stdexcept>
-#include <stdio.h>
-#include <time.h>
-#include <errno.h>
-#include <string.h>
-
-#include <malloc.h>
-
-// handle to embedded SPU executable w/ QA routines
-extern spe_program_handle_t gcell_runtime_qa_spx;
-
-#if 0
-static void
-gc_msleep(unsigned long millisecs)
-{
- int r;
- struct timespec tv;
- tv.tv_sec = millisecs / 1000;
- tv.tv_nsec = (millisecs - (tv.tv_sec * 1000)) * 1000000;
-
- while (1){
- r = nanosleep(&tv, &tv);
- if (r == 0)
- return;
- if (r == -1 && errno == EINTR)
- continue;
- perror("nanosleep");
- return;
- }
-}
-#endif
-
-void
-qa_job_manager::leak_check(test_t t, const std::string &name)
-{
- struct mallinfo before, after;
-
- before = mallinfo();
- (this->*t)();
- after = mallinfo();
-
- size_t delta = after.uordblks - before.uordblks;
- if (delta != 0){
- std::cout << name << " leaked memory\n";
- printf(" before.uordblks = %6d\n", before.uordblks);
- printf(" after.uordblks = %6d\n", after.uordblks);
- printf(" delta = %d\n", after.uordblks - before.uordblks);
- }
-}
-
-void
-qa_job_manager::t0()
-{
- //leak_check(&qa_job_manager::t1_body, "t1-0");
-}
-
-void
-qa_job_manager::t1()
-{
- t1_body(); // leaks 800 bytes first time, could be one-time inits
- leak_check(&qa_job_manager::t1_body, "t1");
-}
-
-void
-qa_job_manager::t2()
-{
- leak_check(&qa_job_manager::t2_body, "t2");
-}
-
-void
-qa_job_manager::t3()
-{
- t3_body(); // leaks first time only, could be cppunit
- leak_check(&qa_job_manager::t3_body, "t3");
-}
-
-void
-qa_job_manager::t4()
-{
- leak_check(&qa_job_manager::t4_body, "t4");
-}
-
-void
-qa_job_manager::t5()
-{
- leak_check(&qa_job_manager::t5_body, "t5");
-}
-
-void
-qa_job_manager::t6()
-{
- leak_check(&qa_job_manager::t6_body, "t6");
-}
-
-void
-qa_job_manager::t7()
-{
- leak_check(&qa_job_manager::t7_body, "t7");
-}
-
-void
-qa_job_manager::t8()
-{
- leak_check(&qa_job_manager::t8_body, "t8");
-}
-
-void
-qa_job_manager::t9()
-{
- leak_check(&qa_job_manager::t9_body, "t9");
-}
-
-void
-qa_job_manager::t10()
-{
- leak_check(&qa_job_manager::t10_body, "t10");
-}
-
-void
-qa_job_manager::t11()
-{
- leak_check(&qa_job_manager::t11_body, "t11");
-}
-
-void
-qa_job_manager::t12()
-{
- leak_check(&qa_job_manager::t12_body, "t12");
-}
-
-void
-qa_job_manager::t13()
-{
- leak_check(&qa_job_manager::t13_body, "t13");
-}
-
-void
-qa_job_manager::t14()
-{
- leak_check(&qa_job_manager::t14_body, "t14");
-}
-
-void
-qa_job_manager::t15()
-{
- leak_check(&qa_job_manager::t15_body, "t15");
-}
-
-// ----------------------------------------------------------------
-
-void
-qa_job_manager::t1_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- mgr = gc_make_job_manager(&opts);
-}
-
-void
-qa_job_manager::t2_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 100;
- opts.gang_schedule = false;
- mgr = gc_make_job_manager(&opts);
-}
-
-void
-qa_job_manager::t3_body()
-{
- // This leaks memory the first time it's invoked, but I'm not sure
- // if it's us or the underlying exception handling mechanism, or
- // cppunit. cppunit is the prime suspect.
-
-#if 0
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 100;
- opts.gang_schedule = true;
- CPPUNIT_ASSERT_THROW(mgr = gc_make_job_manager(&opts), std::out_of_range);
-#endif
-}
-
-static void
-init_jd(gc_job_desc *jd, gc_proc_id_t proc_id)
-{
- jd->proc_id = proc_id;
- jd->input.nargs = 0;
- jd->output.nargs = 0;
- jd->eaa.nargs = 0;
-}
-
-void
-qa_job_manager::t4_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
- //mgr->set_debug(-1);
- static const int NJOBS = 32;
- gc_job_desc *jds[NJOBS];
- bool done[NJOBS];
-
- gc_proc_id_t gcp_no_such;
- CPPUNIT_ASSERT_THROW(gcp_no_such = mgr->lookup_proc("--no-such-proc-name--"), gc_unknown_proc);
-
- gc_proc_id_t gcp_qa_nop = mgr->lookup_proc("qa_nop");
- CPPUNIT_ASSERT(gcp_qa_nop != GCP_UNKNOWN_PROC);
-
- for (int i = 0; i < NJOBS; i++){
- jds[i] = mgr->alloc_job_desc();
- init_jd(jds[i], gcp_qa_nop);
- }
-
- for (int i = 0; i < NJOBS; i++){
- if (!mgr->submit_job(jds[i])){
- printf("%d: submit_job(jds[%d]) failed, status = %d\n",
- __LINE__, i, jds[i]->status);
- }
- }
-
- int n = mgr->wait_jobs(NJOBS, jds, done, GC_WAIT_ALL);
- CPPUNIT_ASSERT_EQUAL(NJOBS, n);
-
- for (int i = 0; i < NJOBS; i++){
- mgr->free_job_desc(jds[i]);
- }
-}
-
-void
-qa_job_manager::t5_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 0; // use them all
- mgr = gc_make_job_manager(&opts);
- //mgr->set_debug(-1);
- static const int NJOBS = 32;
- gc_job_desc *jds[NJOBS];
- bool done[NJOBS];
-
- gc_proc_id_t gcp_qa_nop = mgr->lookup_proc("qa_nop");
-
- for (int i = 0; i < NJOBS; i++){
- jds[i] = mgr->alloc_job_desc();
- init_jd(jds[i], gcp_qa_nop);
- }
-
- for (int i = 0; i < NJOBS; i++){
- if (!mgr->submit_job(jds[i])){
- printf("%d: submit_job(jds[%d]) failed, status = %d\n",
- __LINE__, i, jds[i]->status);
- }
- }
-
- int n = mgr->wait_jobs(NJOBS, jds, done, GC_WAIT_ALL);
- CPPUNIT_ASSERT_EQUAL(NJOBS, n);
-
- for (int i = 0; i < NJOBS; i++){
- mgr->free_job_desc(jds[i]);
- }
-}
-
-void
-qa_job_manager::t6_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
- gc_proc_id_t gcp_qa_nop = mgr->lookup_proc("qa_nop");
- gc_job_desc *jd = mgr->alloc_job_desc();
-
-
- // test for success with gcp_qa_nop procedure
- init_jd(jd, gcp_qa_nop);
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd->status);
- }
-
- // test for JS_UNKNOWN_PROC with bogus procedure
- init_jd(jd, -2);
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_UNKNOWN_PROC, jd->status);
- }
-
- mgr->free_job_desc(jd);
-}
-
-static int
-sum_shorts(short *p, int nshorts)
-{
- int total = 0;
- for (int i = 0; i < nshorts; i++)
- total += p[i];
-
- return total;
-}
-
-static void
-test_sum_shorts(gc_job_manager_sptr mgr, short *buf, int nshorts)
-{
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_sum_shorts = mgr->lookup_proc("qa_sum_shorts");
-
- init_jd(jd, gcp_qa_sum_shorts);
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(buf);
- jd->eaa.arg[0].direction = GCJD_DMA_GET;
- jd->eaa.arg[0].get_size = nshorts * sizeof(short);
-
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd->status);
- int expected = sum_shorts(buf, nshorts);
- int actual = jd->output.arg[0].s32;
- CPPUNIT_ASSERT_EQUAL(expected, actual);
- }
-
- mgr->free_job_desc(jd);
-}
-
-static const int NS = 32768;
-static short short_buf[NS] _AL128; // for known alignment
-
-//
-// test all "get" alignments and sizes
-//
-void
-qa_job_manager::t7_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
-
- int ea_args_maxsize = mgr->ea_args_maxsize();
-
- for (int i = 0; i < NS; i++) // init buffer with known qty
- short_buf[i] = 0x1234 + i;
-
- for (int offset = 0; offset <= 128; offset++){
- for (int len = 0; len <= 128; len++){
- test_sum_shorts(mgr, &short_buf[offset], len);
- }
- }
-
- // confirm maximum length
- for (int offset = 0; offset <= 64; offset++){
- test_sum_shorts(mgr, &short_buf[offset], ea_args_maxsize/sizeof(short));
- }
-}
-
-//
-// test "get" args too long
-//
-void
-qa_job_manager::t8_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_sum_shorts = mgr->lookup_proc("qa_sum_shorts");
-
- init_jd(jd, gcp_qa_sum_shorts);
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].ea_addr = 0;
- jd->eaa.arg[0].direction = GCJD_DMA_GET;
- jd->eaa.arg[0].get_size = 1 << 20;
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_ARGS_TOO_LONG, jd->status);
- }
-
- mgr->free_job_desc(jd);
-}
-
-//
-// test MAX_ARGS_EA "get" case
-//
-void
-qa_job_manager::t9_body()
-{
- static const int N = 127;
- static const int M = 201;
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_sum_shorts = mgr->lookup_proc("qa_sum_shorts");
-
- init_jd(jd, gcp_qa_sum_shorts);
- jd->eaa.nargs = MAX_ARGS_EA;
- for (int i = 0; i < MAX_ARGS_EA; i++){
- jd->eaa.arg[i].direction = GCJD_DMA_GET;
- jd->eaa.arg[i].ea_addr = ptr_to_ea(&short_buf[i * M]);
- jd->eaa.arg[i].get_size = N * sizeof(short);
- }
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd->status);
- for (int i = 0; i < MAX_ARGS_EA; i++){
- int expected = sum_shorts(&short_buf[i * M], N);
- int actual = jd->output.arg[i].s32;
- CPPUNIT_ASSERT_EQUAL(expected, actual);
- }
- }
-
- mgr->free_job_desc(jd);
-}
-
-static bool
-confirm_const(const unsigned char *buf, size_t len, unsigned char v)
-{
- bool ok = true;
-
- for (size_t i = 0; i < len; i++){
- if (buf[i] != v){
- ok = false;
- printf("confirm_const: buf[%6d] = 0x%02x, expected = 0x%02x\n",
- i, buf[i], v);
- }
- }
-
- return ok;
-}
-
-static bool
-confirm_seq(const unsigned char *buf, size_t len, unsigned char v)
-{
- bool ok = true;
-
- for (size_t i = 0; i < len; i++, v++){
- if (buf[i] != v){
- ok = false;
- printf("confirm_seq: buf[%6d] = 0x%02x, expected = 0x%02x\n",
- i, buf[i], v);
- }
- }
-
- return ok;
-}
-
-static void
-test_put_seq(gc_job_manager_sptr mgr, int offset, int len, int starting_val)
-{
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_put_seq = mgr->lookup_proc("qa_put_seq");
-
- unsigned char *buf = (unsigned char *) short_buf;
- size_t buf_len = sizeof(short_buf);
- memset(buf, 0xff, buf_len);
-
- // two cache lines into the buffer, so we can check before and after
- int fixed_offset = 256;
-
- init_jd(jd, gcp_qa_put_seq);
- jd->input.nargs = 1;
- jd->input.arg[0].s32 = starting_val;
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(buf + fixed_offset + offset);
- jd->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd->eaa.arg[0].put_size = len;
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd->status);
-
- // check before
- CPPUNIT_ASSERT(confirm_const(&buf[0], fixed_offset + offset, 0xff));
-
- // check sequence
- CPPUNIT_ASSERT(confirm_seq(&buf[fixed_offset + offset], len, starting_val));
-
- // check after
- CPPUNIT_ASSERT(confirm_const(&buf[fixed_offset + offset + len],
- buf_len - fixed_offset - offset - len, 0xff));
- }
- mgr->free_job_desc(jd);
-}
-
-//
-// Test all "put" alignments and sizes
-//
-void
-qa_job_manager::t10_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
-
- int starting_val = 13;
-
- for (int offset = 0; offset <= 128; offset++){
- for (int len = 0; len <= 128; len++){
- test_put_seq(mgr, offset, len, starting_val++);
- }
- }
-
- int ea_args_maxsize = mgr->ea_args_maxsize();
-
- // confirm maximum length
- for (int offset = 0; offset <= 64; offset++){
- test_put_seq(mgr, offset, ea_args_maxsize, starting_val++);
- }
-}
-
-//
-// test "put" args too long
-//
-void
-qa_job_manager::t11_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_put_seq = mgr->lookup_proc("qa_put_seq");
-
- init_jd(jd, gcp_qa_put_seq);
- jd->input.nargs = 1;
- jd->input.arg[0].s32 = 0;
- jd->eaa.nargs = 1;
- jd->eaa.arg[0].ea_addr = 0;
- jd->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd->eaa.arg[0].put_size = 1 << 20;
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_ARGS_TOO_LONG, jd->status);
- }
-
- mgr->free_job_desc(jd);
-}
-
-//
-// test MAX_ARGS_EA "put" case
-//
-void
-qa_job_manager::t12_body()
-{
- static const int N = 127;
- static const int M = 201;
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_put_seq = mgr->lookup_proc("qa_put_seq");
-
- unsigned char *buf = (unsigned char *) short_buf;
- size_t buf_len = sizeof(short_buf);
- memset(buf, 0xff, buf_len);
-
- // two cache lines into the buffer, so we can check before and after
- int fixed_offset = 256;
-
- int starting_val = 13;
-
- init_jd(jd, gcp_qa_put_seq);
- jd->input.nargs = 1;
- jd->input.arg[0].s32 = starting_val;
- jd->eaa.nargs = MAX_ARGS_EA;
- for (int i = 0; i < MAX_ARGS_EA; i++){
- jd->eaa.arg[i].direction = GCJD_DMA_PUT;
- jd->eaa.arg[i].ea_addr = ptr_to_ea(&buf[i * M + fixed_offset]);
- jd->eaa.arg[i].put_size = N;
- }
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd->status);
- for (int i = 0; i < MAX_ARGS_EA; i++){
- CPPUNIT_ASSERT(confirm_seq(&buf[i * M + fixed_offset], N, starting_val));
- starting_val += N;
- }
- }
-
- mgr->free_job_desc(jd);
-}
-
-//
-// test qa_copy primitive
-//
-void
-qa_job_manager::t13_body()
-{
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
-
- memset(short_buf, 0, sizeof(short_buf));
- for (int i = 0; i < NS/2; i++) // init buffer with known qty
- short_buf[i] = 0x1234 + i;
-
- int nshorts = NS/2;
-
- gc_job_desc *jd = mgr->alloc_job_desc();
- gc_proc_id_t gcp_qa_copy = mgr->lookup_proc("qa_copy");
-
-#if 0
- printf("gcq_qa_copy = %d\n", gcp_qa_copy);
- std::vector<std::string> procs = mgr->proc_names();
- for (unsigned int i = 0; i < procs.size(); ++i)
- std::cout << procs[i] << std::endl;
-#endif
-
- init_jd(jd, gcp_qa_copy);
- jd->eaa.nargs = 2;
- jd->eaa.arg[0].ea_addr = ptr_to_ea(&short_buf[nshorts]);
- jd->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd->eaa.arg[0].put_size = nshorts * sizeof(short);
-
- jd->eaa.arg[1].ea_addr = ptr_to_ea(&short_buf[0]);
- jd->eaa.arg[1].direction = GCJD_DMA_GET;
- jd->eaa.arg[1].get_size = nshorts * sizeof(short);
-
-
- if (!mgr->submit_job(jd)){
- printf("%d: submit_job(jd) failed, status = %d\n", __LINE__, jd->status);
- }
- else {
- mgr->wait_job(jd);
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd->status);
- CPPUNIT_ASSERT_EQUAL(0, jd->output.arg[0].s32);
-
- bool ok = true;
- for (int i = 0; i < nshorts; i++){
- if (short_buf[i] != short_buf[i + nshorts])
- ok = false;
- }
- CPPUNIT_ASSERT(ok);
- }
- mgr->free_job_desc(jd);
-}
-
-/*
- * Parallel submission of NJOBS "put" jobs will test double buffered puts.
- */
-void
-qa_job_manager::t14_body()
-{
- //return;
-
- //static const int NJOBS = 64;
- static const int NJOBS = 128;
- static const int LEN_PER_JOB = 1021;
- unsigned char buf[NJOBS * LEN_PER_JOB];
- gc_job_desc_t *jd[NJOBS];
- bool done[NJOBS];
-
- static const int STARTING_VAL = 13;
-
- memset(buf, 0xff, LEN_PER_JOB * NJOBS);
-
- gc_job_manager_sptr mgr;
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- mgr = gc_make_job_manager(&opts);
-
-
- gc_proc_id_t gcp_qa_put_seq = mgr->lookup_proc("qa_put_seq");
-
- // do all the initialization up front
-
- for (int i = 0, val = STARTING_VAL; i < NJOBS; i++, val += 3){
- jd[i] = mgr->alloc_job_desc();
- init_jd(jd[i], gcp_qa_put_seq);
- jd[i]->input.nargs = 1;
- jd[i]->input.arg[0].s32 = val;
- jd[i]->eaa.nargs = 1;
- jd[i]->eaa.arg[0].ea_addr = ptr_to_ea(&buf[i * LEN_PER_JOB]);
- jd[i]->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd[i]->eaa.arg[0].put_size = LEN_PER_JOB;
- }
-
- // submit them all
-
- for (int i = 0; i < NJOBS; i++){
- if (!mgr->submit_job(jd[i])){
- printf("%d: submit_job(jd[%2d]) failed, status = %d\n", __LINE__, i, jd[i]->status);
- }
- }
-
- // wait for them all
-
- int n = mgr->wait_jobs(NJOBS, jd, done, GC_WAIT_ALL);
- CPPUNIT_ASSERT_EQUAL(NJOBS, n);
-
- // check results
-
- for (int i = 0, val = STARTING_VAL; i < NJOBS; i++, val += 3){
- CPPUNIT_ASSERT_EQUAL(JS_OK, jd[i]->status);
- CPPUNIT_ASSERT(confirm_seq(&buf[i * LEN_PER_JOB], LEN_PER_JOB, val));
- }
-
- // cleanup
- for (int i = 0; i < NJOBS; i++)
- mgr->free_job_desc(jd[i]);
-}
-
-void
-qa_job_manager::t15_body()
-{
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_runtime_qa_spx);
- opts.nspes = 1;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
- gc_job_manager::set_singleton(mgr);
-
- CPPUNIT_ASSERT(gc_job_manager::singleton());
- mgr.reset();
- CPPUNIT_ASSERT_THROW(gc_job_manager::singleton(), boost::bad_weak_ptr);
-}
diff --git a/gcell/lib/runtime/qa_job_manager.h b/gcell/lib/runtime/qa_job_manager.h
deleted file mode 100644
index ab3325b73..000000000
--- a/gcell/lib/runtime/qa_job_manager.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_QA_JOB_MANAGER_H
-#define INCLUDED_QA_JOB_MANAGER_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestCase.h>
-
-class qa_job_manager;
-typedef void (qa_job_manager::*test_t)();
-
-
-class qa_job_manager : public CppUnit::TestCase {
-
- CPPUNIT_TEST_SUITE(qa_job_manager);
- CPPUNIT_TEST(t0);
- CPPUNIT_TEST(t1);
- CPPUNIT_TEST(t2);
- CPPUNIT_TEST(t3);
- CPPUNIT_TEST(t4);
- CPPUNIT_TEST(t5);
- CPPUNIT_TEST(t6);
- CPPUNIT_TEST(t7);
- CPPUNIT_TEST(t8);
- CPPUNIT_TEST(t9);
- CPPUNIT_TEST(t10);
- CPPUNIT_TEST(t11);
- CPPUNIT_TEST(t12);
- CPPUNIT_TEST(t13);
- CPPUNIT_TEST(t14);
- CPPUNIT_TEST(t15);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- void leak_check(test_t t, const std::string &name);
-
- void t0();
- void t1();
- void t1_body();
- void t2();
- void t2_body();
- void t3();
- void t3_body();
- void t4();
- void t4_body();
- void t5();
- void t5_body();
- void t6();
- void t6_body();
- void t7();
- void t7_body();
- void t8();
- void t8_body();
- void t9();
- void t9_body();
- void t10();
- void t10_body();
- void t11();
- void t11_body();
- void t12();
- void t12_body();
- void t13();
- void t13_body();
- void t14();
- void t14_body();
- void t15();
- void t15_body();
-
-};
-
-#endif /* INCLUDED_QA_JOB_MANAGER_H */
diff --git a/gcell/lib/runtime/spu/.gitignore b/gcell/lib/runtime/spu/.gitignore
deleted file mode 100644
index 36b575570..000000000
--- a/gcell/lib/runtime/spu/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/Makefile
-/Makefile.in
-/*.a
-/*.la
-/*.lo
-/.deps
-/.libs
-/test_spu
-/gcell_spu_main
-/gcell_qa
diff --git a/gcell/lib/runtime/spu/gc_delay.c b/gcell/lib/runtime/spu/gc_delay.c
deleted file mode 100644
index 4d58935aa..000000000
--- a/gcell/lib/runtime/spu/gc_delay.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/spu/gc_delay.h>
-#include <gcell/compiler.h>
-
-inline static void
-gc_udelay_1us(void)
-{
- unsigned int i = 158;
-
- do { // 20 clocks per iteration of the loop
- asm ("nop $127; nop $127; nop $127; nop $127; nop $127");
- asm ("nop $127; nop $127; nop $127; nop $127; nop $127");
- asm ("nop $127; nop $127; nop $127; nop $127; nop $127");
- asm ("nop $127; nop $127");
- } while(--i != 0);
-}
-
-void
-gc_udelay(unsigned int usecs)
-{
- unsigned int i;
- for (i = 0; i < usecs; i++)
- gc_udelay_1us();
-}
-
-void
-gc_cdelay(unsigned int cpu_cycles)
-{
- if (cpu_cycles < 40) // roughly the amount of overhead
- return;
-
- cpu_cycles >>= 2; // about 4 cycles / loop
-
- while (cpu_cycles-- != 0){
- asm ("nop $127"); // keeps compiler from removing the loop
- }
-}
-
diff --git a/gcell/lib/runtime/spu/gc_logging.c b/gcell/lib/runtime/spu/gc_logging.c
deleted file mode 100644
index 48b7e5f25..000000000
--- a/gcell/lib/runtime/spu/gc_logging.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_logging.h>
-#include <gcell/gc_spu_args.h>
-#include <spu_intrinsics.h>
-#include <spu_mfcio.h>
-
-static gc_eaddr_t log_base_ea; // base address of log entries in EA
-static uint32_t log_idx_mask; // nentries - 1
-static uint32_t log_idx; // current log entry index
-static uint32_t log_seqno;
-
-static int log_tags; // two consecutive tags
-static int tmp_buffer_busy; // bitmask: buffer busy state
-static int tmp_buffer_idx; // 0 or 1
-static gc_log_entry_t tmp_buffer[2];
-
-void
-_gc_log_init(gc_log_t info)
-{
- spu_write_decrementer(~0);
-
- log_base_ea = info.base;
- log_idx_mask = info.nentries - 1;
- log_idx = 0;
- log_seqno = 0;
-
- log_tags = mfc_multi_tag_reserve(2);
- tmp_buffer_busy = 0;
- tmp_buffer_idx = 0;
-
- gc_log_write0(GCL_SS_SYS, 0);
-}
-
-void
-_gc_log_write(gc_log_entry_t entry)
-{
- if (log_base_ea == 0)
- return;
-
- entry.seqno = log_seqno++;
- entry.timestamp = spu_read_decrementer();
-
- if (tmp_buffer_busy & (1 << tmp_buffer_idx)){
- mfc_write_tag_mask(1 << (log_tags + tmp_buffer_idx));
- mfc_read_tag_status_all();
- }
-
- tmp_buffer[tmp_buffer_idx] = entry; // save local copy
-
- mfc_put(&tmp_buffer[tmp_buffer_idx],
- log_base_ea + log_idx * sizeof(entry), sizeof(entry),
- log_tags + tmp_buffer_idx, 0, 0);
-
- tmp_buffer_busy |= (1 << tmp_buffer_idx);
- tmp_buffer_idx ^= 0x1;
- log_idx = (log_idx + 1) & log_idx_mask;
-}
diff --git a/gcell/lib/runtime/spu/gc_main.c b/gcell/lib/runtime/spu/gc_main.c
deleted file mode 100644
index ba56e40f6..000000000
--- a/gcell/lib/runtime/spu/gc_main.c
+++ /dev/null
@@ -1,731 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-// #define ENABLE_GC_LOGGING // define to enable logging
-
-#include <spu_intrinsics.h>
-#include <spu_mfcio.h>
-#include <sync_utils.h>
-#include "gc_spu_config.h"
-#include "spu_buffers.h"
-#include <gcell/gc_spu_args.h>
-#include <gcell/gc_job_desc.h>
-#include <gcell/gc_mbox.h>
-#include <gcell/gc_declare_proc.h>
-#include <gcell/spu/gc_jd_queue.h>
-#include <gcell/spu/gc_random.h>
-#include <gcell/spu/gc_delay.h>
-
-#include <string.h>
-#include <assert.h>
-#include <stdio.h>
-
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-
-//! round x down to p2 boundary (p2 must be a power-of-2)
-#define ROUND_DN(x, p2) ((x) & ~((p2)-1))
-
-//! round x up to p2 boundary (p2 must be a power-of-2)
-#define ROUND_UP(x, p2) (((x)+((p2)-1)) & ~((p2)-1))
-
-
-//#define OUT_MBOX_CHANNEL SPU_WrOutIntrMbox
-#define OUT_MBOX_CHANNEL SPU_WrOutMbox
-
-#define CHECK_QUEUE_ON_MSG 0 // define to 0 or 1
-#define USE_LLR_LOST_EVENT 0 // define to 0 or 1
-
-int gc_sys_tag; // tag for misc DMA operations
-static gc_spu_args_t spu_args;
-
-static struct gc_proc_def *gc_proc_def; // procedure entry points
-
-// ------------------------------------------------------------------------
-
-// state for DMA'ing arguments in and out
-
-static int get_tag; // 1 tag for job arg gets
-static int put_tags; // 2 tags for job arg puts
-
-static int pb_idx = 0; // current put buffer index (0 or 1)
-
-// bitmask (bit per put buffer): bit is set if DMA is started but not complete
-static int put_in_progress = 0;
-#define PBI_MASK(_pbi_) (1 << (_pbi_))
-
-// ------------------------------------------------------------------------
-
-// our working copy of the completion info
-static gc_comp_info_t comp_info = {
- .in_use = 1,
- .ncomplete = 0
-};
-
-static int ci_idx = 0; // index of current comp_info
-static int ci_tags; // two consecutive dma tags
-
-// ------------------------------------------------------------------------
-
-/*
- * Wait until EA copy of comp_info[idx].in_use is 0
- */
-static void
-wait_for_ppe_to_be_done_with_comp_info(int idx)
-{
- char _tmp[256];
- char *buf = (char *) ALIGN(_tmp, 128); // get cache-aligned buffer
- gc_comp_info_t *p = (gc_comp_info_t *) buf;
-
- assert(sizeof(gc_comp_info_t) == 128);
-
- do {
- mfc_get(buf, spu_args.comp_info[idx], 128, gc_sys_tag, 0, 0);
- mfc_write_tag_mask(1 << gc_sys_tag);
- mfc_read_tag_status_all();
- if (p->in_use == 0)
- return;
-
- gc_udelay(1);
-
- } while (1);
-}
-
-static void
-flush_completion_info(void)
-{
- // events: 0x3X
-
- static int total_complete = 0;
-
- if (comp_info.ncomplete == 0)
- return;
-
- // ensure that PPE is done with the buffer we're about to overwrite
- wait_for_ppe_to_be_done_with_comp_info(ci_idx);
-
- // dma the comp_info out to PPE
- int tag = ci_tags + ci_idx;
- mfc_put(&comp_info, spu_args.comp_info[ci_idx], sizeof(gc_comp_info_t), tag, 0, 0);
-
- // we need to wait for the completion info to finish, as well as
- // any EA argument puts.
-
- int tag_mask = 1 << tag; // the comp_info tag
- if (put_in_progress & PBI_MASK(0))
- tag_mask |= (1 << (put_tags + 0));
- if (put_in_progress & PBI_MASK(1))
- tag_mask |= (1 << (put_tags + 1));
-
- gc_log_write2(GCL_SS_SYS, 0x30, put_in_progress, tag_mask);
-
- mfc_write_tag_mask(tag_mask); // the tags we're interested in
- mfc_read_tag_status_all(); // wait for DMA to complete
- put_in_progress = 0; // mark them all complete
-
- total_complete += comp_info.ncomplete;
- gc_log_write4(GCL_SS_SYS, 0x31,
- put_in_progress, ci_idx, comp_info.ncomplete, total_complete);
-
- // send PPE a message
- spu_writech(OUT_MBOX_CHANNEL, MK_MBOX_MSG(OP_JOBS_DONE, ci_idx));
-
- ci_idx ^= 0x1; // switch buffers
- comp_info.in_use = 1;
- comp_info.ncomplete = 0;
-}
-
-// ------------------------------------------------------------------------
-
-
-static unsigned int backoff; // current backoff value in clock cycles
-static unsigned int _backoff_start;
-static unsigned int _backoff_cap;
-
-/*
- * For 3.2 GHz SPE
- *
- * 10 1023 cycles 320 ns
- * 11 2047 cycle 640 ns
- * 12 4095 cycles 1.3 us
- * 13 8191 cycles 2.6 us
- * 14 16383 cycles 5.1 us
- * 15 32767 cycles 10.2 us
- * 16 20.4 us
- * 17 40.8 us
- * 18 81.9 us
- * 19 163.8 us
- * 20 327.7 us
- * 21 655.4 us
- */
-static unsigned char log2_backoff_start[16] = {
-// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
-// -------------------------------------------------------------
-//12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 16, 16
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
-};
-
-static unsigned char log2_backoff_cap[16] = {
-// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
-// -------------------------------------------------------------
-//17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 21, 21
- 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16
-};
-
-static void
-backoff_init(void)
-{
- _backoff_cap = (1 << (log2_backoff_cap[(spu_args.nspus - 1) & 0xf])) - 1;
- _backoff_start = (1 << (log2_backoff_start[(spu_args.nspus - 1) & 0xf])) - 1;
-
- backoff = _backoff_start;
-}
-
-#if !CHECK_QUEUE_ON_MSG
-
-static void
-backoff_reset(void)
-{
- backoff = _backoff_start;
-}
-
-
-#define RANDOM_WEIGHT 0.2
-
-static void
-backoff_delay(void)
-{
- gc_cdelay(backoff);
-
- // capped exponential backoff
- backoff = ((backoff << 1) + 1);
- if (backoff > _backoff_cap)
- backoff = _backoff_cap;
-
- // plus some randomness
- float r = (RANDOM_WEIGHT * (2.0 * (gc_uniform_deviate() - 0.5)));
- backoff = backoff * (1.0 + r);
-}
-
-#endif // !CHECK_QUEUE_ON_MSG
-
-// ------------------------------------------------------------------------
-
-static inline unsigned int
-make_mask(int nbits)
-{
- return ~(~0 << nbits);
-}
-
-static unsigned int dc_work;
-static int dc_put_tag;
-static unsigned char *dc_ls_base;
-static gc_eaddr_t dc_ea_base;
-
-// divide and conquer
-static void
-d_and_c(unsigned int offset, unsigned int len)
-{
- unsigned int mask = make_mask(len) << offset;
- unsigned int t = mask & dc_work;
- if (t == 0) // nothing to do
- return;
- if (t == mask){ // got a match, generate dma
- mfc_put(dc_ls_base + offset, dc_ea_base + offset, len, dc_put_tag, 0, 0);
- }
- else { // bisect
- len >>= 1;
- d_and_c(offset, len);
- d_and_c(offset + len, len);
- }
-}
-
-// Handle the nasty case of a dma xfer that's less than 16 bytes long.
-// len is guaranteed to be in [1, 15]
-
-static void
-handle_slow_and_tedious_dma(gc_eaddr_t ea, unsigned char *ls,
- unsigned int len, int put_tag)
-{
- // Set up for divide and conquer
- unsigned int alignment = ((uintptr_t) ls) & 0x7;
- dc_work = make_mask(len) << alignment;
- dc_ls_base = (unsigned char *) ROUND_DN((uintptr_t) ls, 8);
- dc_ea_base = ROUND_DN(ea, (gc_eaddr_t) 8);
- dc_put_tag = put_tag;
-
- d_and_c( 0, 8);
- d_and_c( 8, 8);
- d_and_c(16, 8);
-}
-
-
-static void
-process_job(gc_eaddr_t jd_ea, gc_job_desc_t *jd)
-{
- // events: 0x2X
-
- jd->status = JS_OK; // assume success
-
- if (jd->proc_id >= spu_args.nproc_defs)
- jd->status = JS_UNKNOWN_PROC;
-
- else {
-
- if (jd->eaa.nargs == 0)
- (*gc_proc_def[jd->proc_id].proc)(&jd->input, &jd->output, &jd->eaa);
-
- else { // handle EA args that must be DMA'd in/out
-
- gc_job_ea_args_t *eaa = &jd->eaa;
-
- int NELMS =
- MAX(MAX_ARGS_EA,
- (GC_SPU_BUFSIZE + MFC_MAX_DMA_SIZE - 1) / MFC_MAX_DMA_SIZE);
-
- mfc_list_element_t dma_get_list[NELMS];
- //mfc_list_element_t dma_put_list[NELMS];
-
- memset(dma_get_list, 0, sizeof(dma_get_list));
- //memset(dma_put_list, 0, sizeof(dma_put_list));
-
- int gli = 0; // get list index
- //int pli = 0; // put list index
-
- unsigned char *get_base = _gci_getbuf[0];
- unsigned char *get_t = get_base;
- unsigned int total_get_dma_len = 0;
-
- unsigned char *put_base = _gci_putbuf[pb_idx];
- unsigned char *put_t = put_base;
- unsigned int total_put_alloc = 0;
- int put_tag = put_tags + pb_idx;
-
- // Do we have any "put" args? If so ensure that previous
- // dma from this buffer is complete
-
- gc_log_write2(GCL_SS_SYS, 0x24, put_in_progress, jd->sys.direction_union);
-
- if ((jd->sys.direction_union & GCJD_DMA_PUT)
- && (put_in_progress & PBI_MASK(pb_idx))){
-
- gc_log_write2(GCL_SS_SYS, 0x25, put_in_progress, 1 << put_tag);
-
- mfc_write_tag_mask(1 << put_tag); // the tag we're interested in
- mfc_read_tag_status_all(); // wait for DMA to complete
- put_in_progress &= ~(PBI_MASK(pb_idx));
-
- gc_log_write1(GCL_SS_SYS, 0x26, put_in_progress);
- }
-
-
- // for now, all EA's must have the same high 32-bits
- gc_eaddr_t common_ea = eaa->arg[0].ea_addr;
-
-
- // assign LS addresses for buffers
-
- for (unsigned int i = 0; i < eaa->nargs; i++){
-
- gc_eaddr_t ea_base = 0;
- unsigned char *ls_base;
- int offset;
- unsigned int dma_len;
-
- if (eaa->arg[i].direction == GCJD_DMA_GET){
- ea_base = ROUND_DN(eaa->arg[i].ea_addr, (gc_eaddr_t) CACHE_LINE_SIZE);
- offset = eaa->arg[i].ea_addr & (CACHE_LINE_SIZE-1);
- dma_len = ROUND_UP(eaa->arg[i].get_size + offset, CACHE_LINE_SIZE);
- total_get_dma_len += dma_len;
-
- if (total_get_dma_len > GC_SPU_BUFSIZE){
- jd->status = JS_ARGS_TOO_LONG;
- goto wrap_up;
- }
-
- ls_base = get_t;
- get_t += dma_len;
- eaa->arg[i].ls_addr = ls_base + offset;
-
- if (0){
- assert((mfc_ea2l(eaa->arg[i].ea_addr) & 0x7f) == ((intptr_t)eaa->arg[i].ls_addr & 0x7f));
- assert((ea_base & 0x7f) == 0);
- assert(((intptr_t)ls_base & 0x7f) == 0);
- assert((dma_len & 0x7f) == 0);
- assert((eaa->arg[i].get_size <= dma_len)
- && dma_len <= (eaa->arg[i].get_size + offset + CACHE_LINE_SIZE - 1));
- }
-
- // add to dma get list
- // FIXME (someday) the dma list is where the JS_BAD_EAH limitation comes from
-
- while (dma_len != 0){
- int n = MIN(dma_len, MFC_MAX_DMA_SIZE);
- dma_get_list[gli].size = n;
- dma_get_list[gli].eal = mfc_ea2l(ea_base);
- dma_len -= n;
- ea_base += n;
- gli++;
- }
- }
-
- else if (eaa->arg[i].direction == GCJD_DMA_PUT){
- //
- // This case is a trickier than the PUT case since we can't
- // write outside of the bounds of the user provided buffer.
- // We still align the buffers to 128-bytes for good performance
- // in the middle portion of the xfers.
- //
- ea_base = ROUND_DN(eaa->arg[i].ea_addr, (gc_eaddr_t) CACHE_LINE_SIZE);
- offset = eaa->arg[i].ea_addr & (CACHE_LINE_SIZE-1);
-
- uint32_t ls_alloc_len =
- ROUND_UP(eaa->arg[i].put_size + offset, CACHE_LINE_SIZE);
-
- total_put_alloc += ls_alloc_len;
-
- if (total_put_alloc > GC_SPU_BUFSIZE){
- jd->status = JS_ARGS_TOO_LONG;
- goto wrap_up;
- }
-
- ls_base = put_t;
- put_t += ls_alloc_len;
- eaa->arg[i].ls_addr = ls_base + offset;
-
- if (1){
- assert((mfc_ea2l(eaa->arg[i].ea_addr) & 0x7f)
- == ((intptr_t)eaa->arg[i].ls_addr & 0x7f));
- assert((ea_base & 0x7f) == 0);
- assert(((intptr_t)ls_base & 0x7f) == 0);
- }
- }
-
- else
- assert(0);
- }
-
- // fire off the dma to fetch the args and wait for it to complete
- mfc_getl(get_base, common_ea, dma_get_list, gli*sizeof(dma_get_list[0]), get_tag, 0, 0);
- mfc_write_tag_mask(1 << get_tag); // the tag we're interested in
- mfc_read_tag_status_all(); // wait for DMA to complete
-
- // do the work
- (*gc_proc_def[jd->proc_id].proc)(&jd->input, &jd->output, &jd->eaa);
-
-
- // Do we have any "put" args? If so copy them out
- if (jd->sys.direction_union & GCJD_DMA_PUT){
-
- // Do the copy out using single DMA xfers. The LS ranges
- // aren't generally contiguous.
-
- bool started_dma = false;
-
- for (unsigned int i = 0; i < eaa->nargs; i++){
- if (eaa->arg[i].direction == GCJD_DMA_PUT && eaa->arg[i].put_size != 0){
-
- started_dma = true;
-
- gc_eaddr_t ea;
- unsigned char *ls;
- unsigned int len;
-
- ea = eaa->arg[i].ea_addr;
- ls = (unsigned char *) eaa->arg[i].ls_addr;
- len = eaa->arg[i].put_size;
-
- if (len < 16)
- handle_slow_and_tedious_dma(ea, ls, len, put_tag);
-
- else {
- if ((ea & 0xf) != 0){
-
- // printf("1: ea = 0x%x len = %5d\n", (int) ea, len);
-
- // handle the "pre-multiple-of-16" portion
- // do 1, 2, 4, or 8 byte xfers as required
-
- if (ea & 0x1){ // do a 1-byte xfer
- mfc_put(ls, ea, 1, put_tag, 0, 0);
- ea += 1;
- ls += 1;
- len -= 1;
- }
- if (ea & 0x2){ // do a 2-byte xfer
- mfc_put(ls, ea, 2, put_tag, 0, 0);
- ea += 2;
- ls += 2;
- len -= 2;
- }
- if (ea & 0x4){ // do a 4-byte xfer
- mfc_put(ls, ea, 4, put_tag, 0, 0);
- ea += 4;
- ls += 4;
- len -= 4;
- }
- if (ea & 0x8){ // do an 8-byte xfer
- mfc_put(ls, ea, 8, put_tag, 0, 0);
- ea += 8;
- ls += 8;
- len -= 8;
- }
- }
-
- if (1){
- // printf("2: ea = 0x%x len = %5d\n", (int) ea, len);
- assert((ea & 0xf) == 0);
- assert((((intptr_t) ls) & 0xf) == 0);
- }
-
- // handle the "multiple-of-16" portion
-
- int aligned_len = ROUND_DN(len, 16);
- len = len & (16 - 1);
-
- while (aligned_len != 0){
- int dma_len = MIN(aligned_len, MFC_MAX_DMA_SIZE);
- mfc_put(ls, ea, dma_len, put_tag, 0, 0);
- ea += dma_len;
- ls += dma_len;
- aligned_len -= dma_len;
- }
-
- if (1){
- // printf("3: ea = 0x%x len = %5d\n", (int)ea, len);
- assert((ea & 0xf) == 0);
- assert((((intptr_t) ls) & 0xf) == 0);
- }
-
- // handle "post-multiple-of-16" portion
-
- if (len != 0){
-
- if (len >= 8){ // do an 8-byte xfer
- mfc_put(ls, ea, 8, put_tag, 0, 0);
- ea += 8;
- ls += 8;
- len -= 8;
- }
- if (len >= 4){ // do a 4-byte xfer
- mfc_put(ls, ea, 4, put_tag, 0, 0);
- ea += 4;
- ls += 4;
- len -= 4;
- }
- if (len >= 2){ // do a 2-byte xfer
- mfc_put(ls, ea, 2, put_tag, 0, 0);
- ea += 2;
- ls += 2;
- len -= 2;
- }
- if (len >= 1){ // do a 1-byte xfer
- mfc_put(ls, ea, 1, put_tag, 0, 0);
- ea += 1;
- ls += 1;
- len -= 1;
- }
- if (1)
- assert(len == 0);
- }
- }
- }
- }
- if (started_dma){
- put_in_progress |= PBI_MASK(pb_idx); // note it's running
- gc_log_write2(GCL_SS_SYS, 0x27, put_in_progress, pb_idx);
- pb_idx ^= 1; // toggle current buffer
- }
- }
- }
- }
-
- wrap_up:; // semicolon creates null statement for C99 compliance
-
- // Copy job descriptor back out to EA.
- // (The dma will be waited on in flush_completion_info)
- int tag = ci_tags + ci_idx; // use the current completion tag
- mfc_put(jd, jd_ea, sizeof(*jd), tag, 0, 0);
-
- // Tell PPE we're done with the job.
- //
- // We queue these up until we run out of room, or until we can send
- // the info to the PPE w/o blocking. The blocking check is in
- // main_loop
-
- comp_info.job_id[comp_info.ncomplete++] = jd->sys.job_id;
-
- if (comp_info.ncomplete == GC_CI_NJOBS){
- gc_log_write0(GCL_SS_SYS, 0x28);
- flush_completion_info();
- }
-}
-
-static void
-main_loop(void)
-{
- // events: 0x1X
-
- static gc_job_desc_t jd; // static gets us proper alignment
- gc_eaddr_t jd_ea;
- int total_jobs = 0;
-
-#if (USE_LLR_LOST_EVENT)
- // setup events
- spu_writech(SPU_WrEventMask, MFC_LLR_LOST_EVENT);
-
- // prime the pump
- while (gc_jd_queue_dequeue(spu_args.queue, &jd_ea, ci_tags + ci_idx, &jd))
- process_job(jd_ea, &jd);
- // we're now holding a lock-line reservation
-#endif
-
- while (1){
-
-#if !CHECK_QUEUE_ON_MSG
-#if (USE_LLR_LOST_EVENT)
-
- if (unlikely(spu_readchcnt(SPU_RdEventStat))){
- //
- // execute standard event handling prologue
- //
- int status = spu_readch(SPU_RdEventStat);
- int mask = spu_readch(SPU_RdEventMask);
- spu_writech(SPU_WrEventMask, mask & ~status); // disable active events
- spu_writech(SPU_WrEventAck, status); // ack active events
-
- // execute per-event actions
-
- if (status & MFC_LLR_LOST_EVENT){
- //
- // We've lost a line reservation. This is most likely caused
- // by somebody doing something to the queue. Go look and see
- // if there's anything for us.
- //
- while (gc_jd_queue_dequeue(spu_args.queue, &jd_ea, ci_tags + ci_idx, &jd) == GCQ_OK)
- process_job(jd_ea, &jd);
- }
-
- //
- // execute standard event handling epilogue
- //
- spu_writech(SPU_WrEventMask, mask); // restore event mask
- }
-
-#else
-
- // try to get a job from the job queue
- if (gc_jd_queue_dequeue(spu_args.queue, &jd_ea, ci_tags + ci_idx, &jd) == GCQ_OK){
- total_jobs++;
- gc_log_write2(GCL_SS_SYS, 0x10, jd.sys.job_id, total_jobs);
-
- process_job(jd_ea, &jd);
-
- gc_log_write2(GCL_SS_SYS, 0x11, jd.sys.job_id, total_jobs);
- backoff_reset();
- }
- else
- backoff_delay();
-
-#endif
-#endif
-
- // any msgs for us?
-
- if (unlikely(spu_readchcnt(SPU_RdInMbox))){
- int msg = spu_readch(SPU_RdInMbox);
- // printf("spu[%d] mbox_msg: 0x%08x\n", spu_args.spu_idx, msg);
-#if CHECK_QUEUE_ON_MSG
- if (MBOX_MSG_OP(msg) == OP_CHECK_QUEUE){
-
- while (1){
- //int delay = (int)(3200.0 * gc_uniform_deviate()); // uniformly in [0, 1.0us]
- //gc_cdelay(delay);
-
- gc_dequeue_status_t s =
- gc_jd_queue_dequeue(spu_args.queue, &jd_ea, ci_tags + ci_idx, &jd);
-
- if (s == GCQ_OK){
- total_jobs++;
- gc_log_write2(GCL_SS_SYS, 0x10, jd.sys.job_id, total_jobs);
-
- process_job(jd_ea, &jd);
-
- gc_log_write2(GCL_SS_SYS, 0x11, jd.sys.job_id, total_jobs);
- }
- else if (s == GCQ_EMPTY){
- break;
- }
- else { // GCQ_LOCKED -- keep trying
- }
- }
- }
- else
-#endif
- if (MBOX_MSG_OP(msg) == OP_EXIT){
- flush_completion_info();
- return;
- }
- else if (MBOX_MSG_OP(msg) == OP_GET_SPU_BUFSIZE){
- spu_writech(SPU_WrOutIntrMbox, MK_MBOX_MSG(OP_SPU_BUFSIZE, GC_SPU_BUFSIZE_BASE));
- }
- }
-
- // If we've got job completion info for the PPE and we can send a
- // message without blocking, do it.
-
- if (comp_info.ncomplete != 0 && spu_readchcnt(OUT_MBOX_CHANNEL) != 0){
- gc_log_write0(GCL_SS_SYS, 0x12);
- flush_completion_info();
- }
- }
-}
-
-
-int
-main(unsigned long long spe_id __attribute__((unused)),
- unsigned long long argp,
- unsigned long long envp __attribute__((unused)))
-{
- gc_sys_tag = mfc_tag_reserve(); // allocate a tag for our misc DMA operations
- get_tag = mfc_tag_reserve();
- ci_tags = mfc_multi_tag_reserve(2);
- put_tags = mfc_multi_tag_reserve(2);
-
- // dma the args in
- mfc_get(&spu_args, argp, sizeof(spu_args), gc_sys_tag, 0, 0);
- mfc_write_tag_mask(1 << gc_sys_tag); // the tag we're interested in
- mfc_read_tag_status_all(); // wait for DMA to complete
-
- // initialize pointer to procedure entry table
- gc_proc_def = (gc_proc_def_t *) spu_args.proc_def_ls_addr;
-
- gc_set_seed(spu_args.spu_idx);
-
- // initialize logging
- _gc_log_init(spu_args.log);
-
- backoff_init(); // initialize backoff parameters
-
- main_loop();
- return 0;
-}
diff --git a/gcell/lib/runtime/spu/gc_random.c b/gcell/lib/runtime/spu/gc_random.c
deleted file mode 100644
index ae2fde875..000000000
--- a/gcell/lib/runtime/spu/gc_random.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#include <gcell/spu/gc_random.h>
-
-static int last_val = 0;
-
-# define M 259200 // values from Numerical Recipes in C, 1988
-# define A 7141
-# define C 54773
-
-void
-gc_set_seed(int seed)
-{
- last_val = ((unsigned int) seed) % M;
-}
-
-/*
- * Return a uniformly distributed value in the range [0, 1.0)
- * (Linear congruential generator. YMMV. Caveat emptor.)
- */
-float
-gc_uniform_deviate(void)
-{
- last_val = (last_val * A + C) % M;
- return (float) last_val * (1.0f / (float) M);
-}
diff --git a/gcell/lib/runtime/spu/gc_spu_config.h b/gcell/lib/runtime/spu/gc_spu_config.h
deleted file mode 100644
index 6320e6dbe..000000000
--- a/gcell/lib/runtime/spu/gc_spu_config.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- c -*- */
-/*
- * Copyright 2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_GCELL_GC_SPU_CONFIG_H
-#define INCLUDED_GCELL_GC_SPU_CONFIG_H
-
-#include <gcell/gc_job_desc.h>
-
-#define CACHE_LINE_SIZE 128 // in bytes
-
-#if 1
-# define GC_SPU_BUFSIZE_BASE (40 * 1024) // must be multiple of CACHE_LINE_SIZE
-#else
-# define GC_SPU_BUFSIZE_BASE (20 * 1024) // must be multiple of CACHE_LINE_SIZE
-#endif
-
-#define GC_SPU_BUFSIZE (GC_SPU_BUFSIZE_BASE + MAX_ARGS_EA * CACHE_LINE_SIZE)
-
-#define NGETBUFS 1 // gets are single buffered
-#define NPUTBUFS 2 // puts are double buffered
-
-#endif /* INCLUDED_GCELL_GC_SPU_CONFIG_H */
diff --git a/gcell/lib/runtime/spu/gc_spu_jd_queue.c b/gcell/lib/runtime/spu/gc_spu_jd_queue.c
deleted file mode 100644
index 91bb5bc7e..000000000
--- a/gcell/lib/runtime/spu/gc_spu_jd_queue.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/spu/gc_jd_queue.h>
-#include <gcell/spu/gc_delay.h>
-#include <gcell/spu/gc_random.h>
-#include "mutex_lock.h"
-#include "mutex_unlock.h"
-
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-
-extern int gc_sys_tag;
-
-// keep track of stats
-int jdq_ok;
-int jdq_empty;
-int jdq_locked;
-
-
-#define INITIAL_BACKOFF 32.0
-#define MAX_BACKOFF 8192.0 /* 2.6us */
-#define RANDOM_WEIGHT 0.2
-
-static float
-next_backoff(float backoff)
-{
- // exponential with random
- float t = backoff * 2.0;
- if (t > MAX_BACKOFF)
- t = MAX_BACKOFF;
-
- float r = (RANDOM_WEIGHT * (2.0 * (gc_uniform_deviate() - 0.5)));
- t = t * (1.0 + r);
-
- return t;
-}
-
-gc_dequeue_status_t
-gc_jd_queue_dequeue(gc_eaddr_t q, gc_eaddr_t *item_ea,
- int jd_tag, gc_job_desc_t *item)
-{
- int status;
- char _tmp[256];
- gc_jd_queue_t *local_q =
- (gc_jd_queue_t *) ALIGN(_tmp, 128); // get cache-aligned buffer
-
- float backoff = next_backoff(INITIAL_BACKOFF);
-
- do {
- // Copy the queue structure in and get a lock line reservation.
- // (The structure is 128-byte aligned and completely fills a cache-line)
-
- mfc_getllar(local_q, q, 0, 0);
- spu_readch(MFC_RdAtomicStat);
-
- if (local_q->mutex != 0){ // somebody else has it locked
- jdq_locked++;
- return GCQ_LOCKED;
- }
-
- if (local_q->head == 0){ // the queue is empty
- jdq_empty++;
- return GCQ_EMPTY;
- }
-
- // Try to acquire the lock
-
- local_q->mutex = 1;
- mfc_putllc(local_q, q, 0, 0);
- status = spu_readch(MFC_RdAtomicStat);
-
- if (status != 0){
- gc_cdelay((int) backoff);
- backoff = next_backoff(backoff);
- }
-
- } while (status != 0);
-
- // we're now holding the lock
-
- // copy in job descriptor at head of queue
- *item_ea = local_q->head;
-
- // We must use the fence with the jd_tag to ensure that any
- // previously initiated put of a job desc is locally ordered before
- // the get of the new one.
- mfc_getf(item, local_q->head, sizeof(gc_job_desc_t), jd_tag, 0, 0);
- mfc_write_tag_mask(1 << jd_tag); // the tag we're interested in
- mfc_read_tag_status_all(); // wait for DMA to complete
-
- local_q->head = item->sys.next;
- item->sys.next = 0;
- if (local_q->head == 0) // now empty?
- local_q->tail = 0;
-
- // Copy the queue struct back out and unlock the mutex in one fell swoop.
- // We use the unconditional put since it's faster and we own the lock.
-
- local_q->mutex = 0;
- mfc_putlluc(local_q, q, 0, 0);
- spu_readch(MFC_RdAtomicStat);
-
- jdq_ok++;
- return GCQ_OK;
-}
diff --git a/gcell/lib/runtime/spu/gcell_runtime_qa.c b/gcell/lib/runtime/spu/gcell_runtime_qa.c
deleted file mode 100644
index 47a4b5b5b..000000000
--- a/gcell/lib/runtime/spu/gcell_runtime_qa.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_declare_proc.h>
-#include <gcell/spu/gc_delay.h>
-#include <string.h>
-
-
-static void
-qa_nop(const gc_job_direct_args_t *input _UNUSED,
- gc_job_direct_args_t *output _UNUSED,
- const gc_job_ea_args_t *eaa _UNUSED)
-{
-}
-
-GC_DECLARE_PROC(qa_nop, "qa_nop");
-
-static int
-sum_shorts(short *p, int nshorts)
-{
- int total = 0;
- for (int i = 0; i < nshorts; i++)
- total += p[i];
-
- return total;
-}
-
-static void
-qa_sum_shorts(const gc_job_direct_args_t *input _UNUSED,
- gc_job_direct_args_t *output,
- const gc_job_ea_args_t *eaa)
-{
- for (unsigned int i = 0; i < eaa->nargs; i++){
- short *p = eaa->arg[i].ls_addr;
- int n = eaa->arg[i].get_size / sizeof(short);
- output->arg[i].s32 = sum_shorts(p, n);
- //printf("qa_sum_shorts(%p, %d) = %d\n", p, n, output->arg[i].s32);
- }
-}
-
-GC_DECLARE_PROC(qa_sum_shorts, "qa_sum_shorts");
-
-static void
-write_seq(unsigned char *p, int nbytes, int counter)
-{
- for (int i = 0; i < nbytes; i++)
- p[i] = counter++;
-}
-
-static void
-qa_put_seq(const gc_job_direct_args_t *input,
- gc_job_direct_args_t *output _UNUSED,
- const gc_job_ea_args_t *eaa)
-{
- int counter = input->arg[0].s32;
-
- for (unsigned int i = 0; i < eaa->nargs; i++){
- unsigned char *p = eaa->arg[i].ls_addr;
- int n = eaa->arg[i].put_size;
- write_seq(p, n, counter);
- counter += n;
- }
-}
-
-GC_DECLARE_PROC(qa_put_seq, "qa_put_seq");
-
-static void
-qa_copy(const gc_job_direct_args_t *input _UNUSED,
- gc_job_direct_args_t *output,
- const gc_job_ea_args_t *eaa)
-{
- if (eaa->nargs != 2
- || eaa->arg[0].direction != GCJD_DMA_PUT
- || eaa->arg[1].direction != GCJD_DMA_GET){
- output->arg[0].s32 = -1;
- return;
- }
-
- output->arg[0].s32 = 0;
- unsigned n = eaa->arg[0].put_size;
- if (eaa->arg[1].get_size < n)
- n = eaa->arg[1].get_size;
-
- memcpy(eaa->arg[0].ls_addr, eaa->arg[1].ls_addr, n);
-}
-
-GC_DECLARE_PROC(qa_copy, "qa_copy");
diff --git a/gcell/lib/runtime/spu/spu_buffers.c b/gcell/lib/runtime/spu/spu_buffers.c
deleted file mode 100644
index 29ae99d9f..000000000
--- a/gcell/lib/runtime/spu/spu_buffers.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "spu_buffers.h"
-#include <gcell/compiler.h>
-
-static unsigned char _getbuf[NGETBUFS][GC_SPU_BUFSIZE] _AL128;
-static unsigned char _putbuf[NPUTBUFS][GC_SPU_BUFSIZE] _AL128;
-
-unsigned char *_gci_getbuf[NGETBUFS] = {
- _getbuf[0]
-};
-
-unsigned char *_gci_putbuf[NPUTBUFS] = {
- _putbuf[0],
- _putbuf[1]
-};
diff --git a/gcell/lib/runtime/spu/spu_buffers.h b/gcell/lib/runtime/spu/spu_buffers.h
deleted file mode 100644
index 24811dc38..000000000
--- a/gcell/lib/runtime/spu/spu_buffers.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_SPU_BUFFERS_H
-#define INCLUDED_SPU_BUFFERS_H
-
-#include "gc_spu_config.h"
-
-//! pointer to input buffer
-extern unsigned char *_gci_getbuf[NGETBUFS];
-
-//! pointers to output buffers
-extern unsigned char *_gci_putbuf[NPUTBUFS];
-
-#endif /* INCLUDED_SPU_BUFFERS_H */
diff --git a/gcell/lib/spu/.gitignore b/gcell/lib/spu/.gitignore
deleted file mode 100644
index 547d22090..000000000
--- a/gcell/lib/spu/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.a
-/*.o
-/gcell_general_qa
-/gcell_runtime_qa
-/gcell_all
diff --git a/gcell/lib/spu/Makefile.am b/gcell/lib/spu/Makefile.am
deleted file mode 100644
index 5afa40e36..000000000
--- a/gcell/lib/spu/Makefile.am
+++ /dev/null
@@ -1,138 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-# We're building a single .a file from files in several
-# subdirectories. We use the "single Makefile, multiple subdirectory"
-# automake alternative. We're doing this because we're faking out
-# automake and getting it to build for 2 architectures at the same
-# time, the PPE (powerpc64) and the SPE. The easiest way to handle
-# the SPE was to just build a static library using automake's built in
-# rules, since trying to get libtool to handle two architectures in
-# the same tree seemed untenable.
-
-include $(top_srcdir)/Makefile.common.spu
-
-IBM_SPU_SYNC_INCLUDES = -I$(top_srcdir)/gcell/ibm/sync/spu_source
-AM_CPPFLAGS = $(GCELL_SPU_INCLUDES) $(IBM_SPU_SYNC_INCLUDES)
-
-libspu_LIBRARIES = libgcell_spu.a
-
-# ----------------------------------------------------------------
-# files in the lib/runtime/spu directory
-
-runtime_srcdir = $(srcdir)/../runtime/spu
-
-runtime_spu_sources = \
- $(runtime_srcdir)/gc_delay.c \
- $(runtime_srcdir)/gc_spu_jd_queue.c \
- $(runtime_srcdir)/spu_buffers.c \
- $(runtime_srcdir)/gc_logging.c \
- $(runtime_srcdir)/gc_main.c \
- $(runtime_srcdir)/gc_random.c
-
-
-runtime_spu_headers =
-
-runtime_spu_noinst_headers = \
- $(runtime_srcdir)/gc_spu_config.h \
- $(runtime_srcdir)/spu_buffers.h
-
-# ----------------------------------------------------------------
-# files in the lib/general/spu directory
-
-general_srcdir = $(srcdir)/../general/spu
-
-general_spu_sources = \
- $(general_srcdir)/fft_1d_r2.c \
- $(general_srcdir)/memset.S
-
-general_spu_headers =
-# These now live in include/gcell/spu
-#general_spu_headers = \
-# $(general_srcdir)/gc_spu_macs.h \
-# $(general_srcdir)/libfft.h
-
-general_spu_noinst_headers =
-# As do these
-#general_spu_noinst_headers = \
-# $(general_srcdir)/fft_1d.h \
-# $(general_srcdir)/fft_1d_r2.h
-
-# The QA code for (usually) non-PPE visible support routines in lib/general/spu
-general_spu_qa_sources = \
- $(general_srcdir)/qa_memset.c
-
-# ----------------------------------------------------------------
-# files in the lib/wrapper/spu directory
-
-wrapper_srcdir = $(srcdir)/../wrapper/spu
-
-wrapper_spu_sources = \
- $(wrapper_srcdir)/gcs_fft_1d_r2.c
-
-wrapper_spu_headers =
-
-wrapper_spu_noinst_headers =
-
-# ----------------------------------------------------------------
-# build the library from the files in the three directories
-
-libgcell_spu_a_SOURCES = \
- $(runtime_spu_sources) \
- $(general_spu_sources) \
- $(wrapper_spu_sources)
-
-gcellspuinclude_HEADERS = \
- $(runtime_spu_headers) \
- $(general_spu_headers) \
- $(wrapper_spu_headers)
-
-noinst_HEADERS = \
- $(runtime_spu_noinst_headers) \
- $(general_spu_noinst_headers) \
- $(wrapper_spu_noinst_headers)
-
-# ----------------------------------------------------------------
-# build some SPU executables
-
-libspu_PROGRAMS = \
- gcell_all
-
-noinst_PROGRAMS = \
- gcell_runtime_qa \
- gcell_general_qa
-
-#
-# All known non-QA gcell procs (at least until they get too big).
-#
-gcell_all_SOURCES = $(wrapper_spu_sources)
-gcell_all_LDADD = libgcell_spu.a
-
-#
-# The QA code required for testing the runtime.
-#
-gcell_runtime_qa_SOURCES = $(runtime_srcdir)/gcell_runtime_qa.c
-gcell_runtime_qa_LDADD = libgcell_spu.a
-
-#
-# The QA code required for testing the SPE support routines in lib/general/spu
-#
-gcell_general_qa_SOURCES = $(general_spu_qa_sources)
-gcell_general_qa_LDADD = libgcell_spu.a
diff --git a/gcell/lib/wrapper/.gitignore b/gcell/lib/wrapper/.gitignore
deleted file mode 100644
index 3531485fb..000000000
--- a/gcell/lib/wrapper/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.a
-/*.o
diff --git a/gcell/lib/wrapper/Makefile.am b/gcell/lib/wrapper/Makefile.am
deleted file mode 100644
index 5ec7e5615..000000000
--- a/gcell/lib/wrapper/Makefile.am
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# Copyright 2008,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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-# $(WITH_INCLUDES) must _always_ be last
-AM_CPPFLAGS = $(DEFINES) $(GCELL_INCLUDES) $(FFTW3F_CPPFLAGS) $(WITH_INCLUDES)
-
-noinst_LTLIBRARIES = libwrapper.la libwrapper-qa.la
-
-#
-# generate libtool.lo's that contain embedded SPU executables
-#
-gcell_all.lo: ../spu/gcell_all
- $(GCELL_EMBEDSPU_LIBTOOL) $< $@
-
-gcell_general_qa.lo: ../spu/gcell_general_qa
- $(GCELL_EMBEDSPU_LIBTOOL) $< $@
-
-
-
-# The primary library
-
-libwrapper_la_SOURCES = \
- gcp_fft_1d_r2.cc
-
-libwrapper_la_LIBADD = \
- gcell_all.lo
-
-
-# The QA library
-
-libwrapper_qa_la_SOURCES = \
- qa_gcell_general.cc \
- qa_gcell_wrapper.cc
-
-# FFTW now depends on gcell, don't create circular dependency :-)
-# qa_gcp_fft_1d_r2.cc
-
-libwrapper_qa_la_LIBADD = \
- gcell_general_qa.lo
-
-# -lfftw3f
-
-# Headers
-
-# Moved to include/gcell
-#gcellinclude_HEADERS = \
-# gcp_fft_1d_r2.h
-
-noinst_HEADERS = \
- qa_gcell_general.h \
- qa_gcell_wrapper.h \
- qa_gcp_fft_1d_r2.h
-
-
-CLEANFILES = gcell_all.lo gcell_general_qa.lo
-
diff --git a/gcell/lib/wrapper/gcp_fft_1d_r2.cc b/gcell/lib/wrapper/gcp_fft_1d_r2.cc
deleted file mode 100644
index 9e7e00f49..000000000
--- a/gcell/lib/wrapper/gcp_fft_1d_r2.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <gcell/gcp_fft_1d_r2.h>
-#include <stdint.h>
-#include <stdexcept>
-#include <math.h>
-
-static void
-init_jd(gc_job_desc *jd,
- gc_proc_id_t proc_id,
- unsigned log2_fft_length,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window)
-{
- jd->proc_id = proc_id;
- jd->input.nargs = 2;
- jd->output.nargs = 0;
- jd->eaa.nargs = 4;
-
- jd->input.arg[0].u32 = log2_fft_length;
- jd->input.arg[1].u32 = shift;
- unsigned int fft_length = 1 << log2_fft_length;
-
- jd->eaa.arg[0].ea_addr = ptr_to_ea(out);
- jd->eaa.arg[0].direction = GCJD_DMA_PUT;
- jd->eaa.arg[0].put_size = sizeof(std::complex<float>) * fft_length;
-
- jd->eaa.arg[1].ea_addr = ptr_to_ea(const_cast<std::complex<float>*>(in));
- jd->eaa.arg[1].direction = GCJD_DMA_GET;
- jd->eaa.arg[1].get_size = sizeof(std::complex<float>) * fft_length;
-
- jd->eaa.arg[2].ea_addr = ptr_to_ea(const_cast<std::complex<float>*>(twiddle));
- jd->eaa.arg[2].direction = GCJD_DMA_GET;
- jd->eaa.arg[2].get_size = sizeof(std::complex<float>) * fft_length / 4;
-
- jd->eaa.arg[3].ea_addr = ptr_to_ea(const_cast<float*>(window));
- jd->eaa.arg[3].direction = GCJD_DMA_GET;
- if (window == 0)
- jd->eaa.arg[3].get_size = 0;
- else
- jd->eaa.arg[3].get_size = sizeof(float) * fft_length;
-}
-
-
-gc_job_desc_sptr
-gcp_fft_1d_r2_submit(gc_job_manager_sptr mgr,
- unsigned int log2_fft_length,
- bool forward,
- bool shift,
- std::complex<float> *out,
- const std::complex<float> *in,
- const std::complex<float> *twiddle,
- const float *window)
-{
- unsigned int fft_length = 1 << log2_fft_length;
- if (fft_length > 4096)
- throw std::invalid_argument("fft_length > 4096");
-
- if ((intptr_t)out & 0xf)
- throw gc_bad_align("out");
- if ((intptr_t)in & 0xf)
- throw gc_bad_align("in");
- if ((intptr_t)twiddle & 0xf)
- throw gc_bad_align("twiddle");
- if ((intptr_t)window & 0xf)
- throw gc_bad_align("window");
-
- std::string proc_name;
- if (forward)
- proc_name = "fwd_fft_1d_r2";
- else
- proc_name = "inv_fft_1d_r2";
-
- gc_proc_id_t fft_id = mgr->lookup_proc(proc_name);
- gc_job_desc_sptr jd = gc_job_manager::alloc_job_desc(mgr);
- init_jd(jd.get(), fft_id, log2_fft_length, shift, out, in, twiddle, window);
- if (!mgr->submit_job(jd.get())){
- gc_job_status_t s = jd->status;
- throw gc_bad_submit(proc_name, s);
- }
- return jd;
-}
-
-void
-gcp_fft_1d_r2_twiddle(unsigned int log2_fft_length, std::complex<float> *twiddle)
-{
- unsigned int n = 1 << log2_fft_length;
-
- twiddle[0].real() = 1.0;
- twiddle[0].imag() = 0.0;
- for (unsigned i=1; i < n/4; i++){
- twiddle[i].real() = cos(i * 2*M_PI/n);
- twiddle[n/4 - i].imag() = -twiddle[i].real();
- }
-}
diff --git a/gcell/lib/wrapper/qa_gcell_general.cc b/gcell/lib/wrapper/qa_gcell_general.cc
deleted file mode 100644
index af9719812..000000000
--- a/gcell/lib/wrapper/qa_gcell_general.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "qa_gcell_general.h"
-#include <cppunit/TestAssert.h>
-
-#include <stdio.h>
-#include <stdlib.h> // random, posix_memalign
-#include <algorithm>
-#include <string.h>
-#include <gcell/gc_job_manager.h>
-
-
-// handle to embedded SPU executable
-extern spe_program_handle_t gcell_general_qa_spx;
-
-gc_job_desc_sptr
-gcp_qa_general_submit(gc_job_manager_sptr mgr, const std::string &proc_name)
-{
- gc_proc_id_t proc_id = mgr->lookup_proc(proc_name);
- gc_job_desc_sptr jd = gc_job_manager::alloc_job_desc(mgr);
-
- jd->proc_id = proc_id;
- jd->input.nargs = 0;
- jd->output.nargs = 1;
- jd->eaa.nargs = 0;
-
- if (!mgr->submit_job(jd.get())){
- gc_job_status_t s = jd->status;
- throw gc_bad_submit(proc_name, s);
- }
- return jd;
-}
-
-
-bool
-qa_gcell_general::generic_test_body(const std::string &proc_name)
-{
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_general_qa_spx);
- opts.nspes = 1;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
- gc_job_desc_sptr jd = gcp_qa_general_submit(mgr, proc_name);
- if (!mgr->wait_job(jd.get())){
- fprintf(stderr, "wait_job for %s failed: %s\n",
- proc_name.c_str(),
- gc_job_status_string(jd->status).c_str());
- CPPUNIT_ASSERT(0);
- }
-
- return jd->output.arg[0].u32; // bool result from SPE code
-}
-
-/*
- * ------------------------------------------------------------------------
- * Add more calls to SPE QA code here...
- * ------------------------------------------------------------------------
- */
-void
-qa_gcell_general::test_memset()
-{
- CPPUNIT_ASSERT(generic_test_body("qa_memset"));
-}
-
diff --git a/gcell/lib/wrapper/qa_gcell_general.h b/gcell/lib/wrapper/qa_gcell_general.h
deleted file mode 100644
index f1e64e717..000000000
--- a/gcell/lib/wrapper/qa_gcell_general.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef INCLUDED_QA_GCELL_GENERAL_H
-#define INCLUDED_QA_GCELL_GENERAL_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestCase.h>
-
-class qa_gcell_general : public CppUnit::TestCase {
-
- CPPUNIT_TEST_SUITE(qa_gcell_general);
- CPPUNIT_TEST(test_memset);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- void test_memset();
-
- bool generic_test_body(const std::string &proc_name);
-};
-
-#endif /* INCLUDED_QA_GCELL_GENERAL_H */
diff --git a/gcell/lib/wrapper/qa_gcell_wrapper.cc b/gcell/lib/wrapper/qa_gcell_wrapper.cc
deleted file mode 100644
index ccfd2fdee..000000000
--- a/gcell/lib/wrapper/qa_gcell_wrapper.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/*
- * This class gathers together all the test cases for the lib/wrapper
- * directory into a single test suite. As you create new test cases,
- * add them here.
- */
-
-#include <qa_gcell_wrapper.h>
-#include <qa_gcell_general.h>
-//#include <qa_gcp_fft_1d_r2.h>
-
-CppUnit::TestSuite *
-qa_gcell_wrapper::suite()
-{
- CppUnit::TestSuite *s = new CppUnit::TestSuite("wrapper");
-
- s->addTest(qa_gcell_general::suite());
- //s->addTest(qa_gcp_fft_1d_r2::suite());
-
- return s;
-}
diff --git a/gcell/lib/wrapper/qa_gcell_wrapper.h b/gcell/lib/wrapper/qa_gcell_wrapper.h
deleted file mode 100644
index cb29db883..000000000
--- a/gcell/lib/wrapper/qa_gcell_wrapper.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_QA_GCELL_WRAPPER_H
-#define INCLUDED_QA_GCELL_WRAPPER_H
-
-#include <cppunit/TestSuite.h>
-
-//! collect all the tests for the wrapper directory
-
-class qa_gcell_wrapper {
-public:
- //! return suite of tests
- static CppUnit::TestSuite *suite();
-};
-
-
-#endif /* INCLUDED_QA_GCELL_WRAPPER_H */
diff --git a/gcell/lib/wrapper/qa_gcp_fft_1d_r2.cc b/gcell/lib/wrapper/qa_gcp_fft_1d_r2.cc
deleted file mode 100644
index 742c624dc..000000000
--- a/gcell/lib/wrapper/qa_gcp_fft_1d_r2.cc
+++ /dev/null
@@ -1,208 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include "qa_gcp_fft_1d_r2.h"
-#include <cppunit/TestAssert.h>
-#include <gcell/gcp_fft_1d_r2.h>
-#include <fftw3.h>
-#include <stdio.h>
-#include <stdlib.h> // random, posix_memalign
-#include <algorithm>
-#include <string.h>
-
-typedef boost::shared_ptr<void> void_sptr;
-
-// handle to embedded SPU executable
-extern spe_program_handle_t gcell_all_spx;
-
-/*
- * Return pointer to cache-aligned chunk of storage of size size bytes.
- * Throw if can't allocate memory. The storage should be freed
- * with "free" when done. The memory is initialized to zero.
- */
-static void *
-aligned_alloc(size_t size, size_t alignment = 128)
-{
- void *p = 0;
- if (posix_memalign(&p, alignment, size) != 0){
- perror("posix_memalign");
- throw std::runtime_error("memory");
- }
- memset(p, 0, size); // zero the memory
- return p;
-}
-
-class free_deleter {
-public:
- void operator()(void *p) {
- free(p);
- }
-};
-
-static boost::shared_ptr<void>
-aligned_alloc_sptr(size_t size, size_t alignment = 128)
-{
- return boost::shared_ptr<void>(aligned_alloc(size, alignment), free_deleter());
-}
-
-// test forward FFT
-void
-qa_gcp_fft_1d_r2::t1()
-{
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_all_spx);
- opts.nspes = 1;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
-#if 1
- for (int log2_fft_size = 5; log2_fft_size <= 12; log2_fft_size++){
- test(mgr, log2_fft_size, true);
- }
-#else
- test(mgr, 5, true);
-#endif
-}
-
-// test inverse FFT
-void
-qa_gcp_fft_1d_r2::t2()
-{
- gc_jm_options opts;
- opts.program_handle = gc_program_handle_from_address(&gcell_all_spx);
- opts.nspes = 1;
- gc_job_manager_sptr mgr = gc_make_job_manager(&opts);
-
-#if 1
- for (int log2_fft_size = 5; log2_fft_size <= 12; log2_fft_size++){
- test(mgr, log2_fft_size, false);
- }
-#else
- test(mgr, 5, false);
-#endif
-}
-
-void
-qa_gcp_fft_1d_r2::t3()
-{
- // FIXME Test fwd and inv with windowing option
-}
-
-void
-qa_gcp_fft_1d_r2::t4()
-{
- // FIXME Test fwd and inv with shift option
-}
-
-static inline float
-abs_diff(std::complex<float> x, std::complex<float> y)
-{
- return std::max(std::abs(x.real()-y.real()),
- std::abs(x.imag()-y.imag()));
-}
-
-static float
-float_abs_rel_error(float ref, float actual)
-{
- float delta = ref - actual;
- if (std::abs(ref) < 1e-18)
- ref = 1e-18;
- return std::abs(delta/ref);
-}
-
-static float
-abs_rel_error(std::complex<float> ref, std::complex<float> actual)
-{
- return std::max(float_abs_rel_error(ref.real(), actual.real()),
- float_abs_rel_error(ref.imag(), actual.imag()));
-}
-
-void
-qa_gcp_fft_1d_r2::test(gc_job_manager_sptr mgr, int log2_fft_size, bool forward)
-{
- int fft_size = 1 << log2_fft_size;
-
- // allocate aligned buffers with boost shared_ptr's
- void_sptr fftw_in_void = aligned_alloc_sptr(fft_size * sizeof(std::complex<float>), 128);
- void_sptr fftw_out_void = aligned_alloc_sptr(fft_size * sizeof(std::complex<float>), 128);
- void_sptr cell_in_void = aligned_alloc_sptr(fft_size * sizeof(std::complex<float>), 128);
- void_sptr cell_out_void = aligned_alloc_sptr(fft_size * sizeof(std::complex<float>), 128);
- void_sptr cell_twiddle_void = aligned_alloc_sptr(fft_size/4 * sizeof(std::complex<float>), 128);
-
- // cast them to the type we really want
- std::complex<float> *fftw_in = (std::complex<float> *) fftw_in_void.get();
- std::complex<float> *fftw_out = (std::complex<float> *) fftw_out_void.get();
- std::complex<float> *cell_in = (std::complex<float> *) cell_in_void.get();
- std::complex<float> *cell_out = (std::complex<float> *) cell_out_void.get();
- std::complex<float> *cell_twiddle = (std::complex<float> *) cell_twiddle_void.get();
-
- gcp_fft_1d_r2_twiddle(log2_fft_size, cell_twiddle);
-
- srandom(1); // we want reproducibility
-
- // initialize the input buffers
- for (int i = 0; i < fft_size; i++){
- std::complex<float> t((float) (random() & 0xfffff), (float) (random() & 0xfffff));
- fftw_in[i] = t;
- cell_in[i] = t;
- }
-
- // ------------------------------------------------------------------------
- // compute the reference answer
- fftwf_plan plan = fftwf_plan_dft_1d (fft_size,
- reinterpret_cast<fftwf_complex *>(fftw_in),
- reinterpret_cast<fftwf_complex *>(fftw_out),
- forward ? FFTW_FORWARD : FFTW_BACKWARD,
- FFTW_ESTIMATE);
- if (plan == 0){
- fprintf(stderr, "qa_gcp_fft_1d_r2: error creating FFTW plan\n");
- throw std::runtime_error ("fftwf_plan_dft_r2c_1d failed");
- }
-
- fftwf_execute(plan);
- fftwf_destroy_plan(plan);
-
- // ------------------------------------------------------------------------
- // compute the answer on the cell
- gc_job_desc_sptr jd = gcp_fft_1d_r2_submit(mgr, log2_fft_size, forward, false,
- cell_out, cell_in, cell_twiddle, 0);
- if (!mgr->wait_job(jd.get())){
- fprintf(stderr, "wait_job failed: %s\n", gc_job_status_string(jd->status).c_str());
- CPPUNIT_ASSERT(0);
- }
-
- // ------------------------------------------------------------------------
- // compute the maximum of the relative error
- float max_rel = 0.0;
- for (int i = 0; i < fft_size; i++){
- max_rel = std::max(max_rel, abs_rel_error(fftw_out[i], cell_out[i]));
- if (0)
- printf("(%16.3f, %16.3fj) (%16.3f, %16.3fj) (%16.3f, %16.3fj)\n",
- fftw_out[i].real(), fftw_out[i].imag(),
- cell_out[i].real(), cell_out[i].imag(),
- fftw_out[i].real() - cell_out[i].real(),
- fftw_out[i].imag() - cell_out[i].imag());
- }
-
- fprintf(stdout, "%s fft_size = %4d max_rel_error = %e\n",
- forward ? "fwd" : "rev", fft_size, max_rel);
-
- CPPUNIT_ASSERT(max_rel <= 5e-3);
-}
diff --git a/gcell/lib/wrapper/qa_gcp_fft_1d_r2.h b/gcell/lib/wrapper/qa_gcp_fft_1d_r2.h
deleted file mode 100644
index 339ddd25a..000000000
--- a/gcell/lib/wrapper/qa_gcp_fft_1d_r2.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_QA_GCP_FFT_1D_R2_H
-#define INCLUDED_QA_GCP_FFT_1D_R2_H
-
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/TestCase.h>
-#include <gcell/gc_job_manager.h>
-
-class qa_gcp_fft_1d_r2 : public CppUnit::TestCase {
-
- CPPUNIT_TEST_SUITE(qa_gcp_fft_1d_r2);
- CPPUNIT_TEST(t1);
- CPPUNIT_TEST(t2);
- CPPUNIT_TEST(t3);
- CPPUNIT_TEST(t4);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- void t1();
- void t2();
- void t3();
- void t4();
-
- void test(gc_job_manager_sptr mgr, int log2_fft_size, bool forward);
-};
-
-
-
-#endif /* INCLUDED_QA_GCP_FFT_1D_R2_H */
diff --git a/gcell/lib/wrapper/spu/.gitignore b/gcell/lib/wrapper/spu/.gitignore
deleted file mode 100644
index 3531485fb..000000000
--- a/gcell/lib/wrapper/spu/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.a
-/*.o
diff --git a/gcell/lib/wrapper/spu/gcs_fft_1d_r2.c b/gcell/lib/wrapper/spu/gcs_fft_1d_r2.c
deleted file mode 100644
index 582757ab0..000000000
--- a/gcell/lib/wrapper/spu/gcs_fft_1d_r2.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#include <gcell/gc_declare_proc.h>
-#include <gcell/spu/libfft.h>
-#include <assert.h>
-
-/*
- * v is really vector complex<float>
- */
-static void
-conjugate_vector(vector float *v, int nelements)
-{
- vector float k = {1, -1, 1, -1};
- int i;
- for (i = 0; i < nelements; i++)
- v[i] *= k;
-}
-
-static void
-gcs_fwd_fft_1d_r2(const gc_job_direct_args_t *input,
- gc_job_direct_args_t *output __attribute__((unused)),
- const gc_job_ea_args_t *eaa)
-{
- vector float *out = (vector float *) eaa->arg[0].ls_addr; // complex
- vector float *in = (vector float *) eaa->arg[1].ls_addr; // complex
- vector float *twiddle = (vector float *) eaa->arg[2].ls_addr; // complex
- vector float *window = (vector float *) eaa->arg[3].ls_addr; // float
-
- int log2_fft_length = input->arg[0].u32;
- int shift = input->arg[1].u32; // non-zero if we should apply fftshift
-
- if (eaa->arg[3].get_size){ // apply window
- // FIXME pointwise multiply in *= window
- assert(0);
- }
-
- fft_1d_r2(out, in, twiddle, log2_fft_length);
-
- if (shift){
- // FIXME apply "fftshift" to output data in-place
- assert(0);
- }
-}
-
-GC_DECLARE_PROC(gcs_fwd_fft_1d_r2, "fwd_fft_1d_r2");
-
-static void
-gcs_inv_fft_1d_r2(const gc_job_direct_args_t *input,
- gc_job_direct_args_t *output __attribute__((unused)),
- const gc_job_ea_args_t *eaa)
-{
- vector float *out = (vector float *) eaa->arg[0].ls_addr; // complex
- vector float *in = (vector float *) eaa->arg[1].ls_addr; // complex
- vector float *twiddle = (vector float *) eaa->arg[2].ls_addr; // complex
- vector float *window = (vector float *) eaa->arg[3].ls_addr; // float
-
- int log2_fft_length = input->arg[0].u32;
- int shift = input->arg[1].u32; // non-zero if we should apply fftshift
-
- if (eaa->arg[3].get_size){ // apply window
- // FIXME pointwise multiply in *= window
- assert(0);
- }
-
- if (shift){
- // FIXME apply "fftshift" to input data in-place
- assert(0);
- }
-
- conjugate_vector(in, 1 << (log2_fft_length - 1));
- fft_1d_r2(out, in, twiddle, log2_fft_length);
- conjugate_vector(out, 1 << (log2_fft_length - 1));
-}
-
-GC_DECLARE_PROC(gcs_inv_fft_1d_r2, "inv_fft_1d_r2");
diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test
index 4dd0bc187..fe1d9421d 100644
--- a/gnuradio-core/src/guile/tests/filter_ctors.test
+++ b/gnuradio-core/src/guile/tests/filter_ctors.test
@@ -36,9 +36,6 @@
;; gr_adaptive_fir_ccf(char *name, int decimation, const std::vector<float> &taps);
;; (pass-if (true? (gr:adaptive-fir-ccf "foo" 0 #(1.0 2.0 3.0 4.0))))
-;;; ./filter/gr_cma_equalizer_cc.h
-(pass-if (true? (gr:cma-equalizer-cc 0 0 0)))
-
;;; ./filter/gr_fft_filter_ccc.h
(pass-if (true? (gr:fft-filter-ccc 0 #(1+3i 23+5i))))
diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test
index 244249dd8..a0e39855c 100644
--- a/gnuradio-core/src/guile/tests/general_ctors.test
+++ b/gnuradio-core/src/guile/tests/general_ctors.test
@@ -71,9 +71,6 @@
;;; ./general/gr_bin_statistics_f.h WONTFIX: requires gr_feval_dd & swig directors
;;;(pass-if (true? (gr:bin-statistics-f 1 (gr:msg-queue) 0 0 0)))
-;;; ./general/gr_binary_slicer_fb.h
-(pass-if (true? (gr:binary-slicer-fb)))
-
;;; ./general/gr_bytes_to_syms.h
(pass-if (true? (gr:bytes-to-syms)))
@@ -86,14 +83,6 @@
;;; ./general/gr_check_lfsr_32k_s.h
(pass-if (true? (gr:check-lfsr-32k-s)))
-;;; ./general/gr_clock_recovery_mm_cc.h
-(pass-if (true? (gr:clock-recovery-mm-cc 1 1 1 1 1)))
-(pass-if-throw "confirm throw gr:clock-recovery-mm-cc" #t (true? (gr:clock-recovery-mm-cc -1 1 1 1 1)))
-
-;;; ./general/gr_clock_recovery_mm_ff.h
-(pass-if (true? (gr:clock-recovery-mm-ff 1 1 1 1 1)))
-(pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff -1 1 1 1 1)))
-
;;; ./general/gr_complex_to_interleaved_short.h
(pass-if (true? (gr:complex-to-interleaved-short)))
@@ -108,22 +97,9 @@
;;; ./general/gr_conjugate_cc.h
(pass-if (true? (gr:conjugate-cc)))
-;;; ./general/gr_constellation_decoder_cb.h
-(pass-if (true? (gr:constellation-decoder-cb #(2+3i 23+5i) #(0 1))))
-
;;; ./general/gr_copy.h
(pass-if (true? (gr:copy 1)))
-;;; ./general/gr_correlate_access_code_bb.h
-(pass-if (true? (gr:correlate-access-code-bb "foo" 0)))
-(pass-if-throw "confirm throw correlate-access-code-bb" #t
- (true? (gr:correlate-access-code-bb
- "00000000000000000000000000000000000000000000000000000000000000000" 0)))
-
-;;; ./general/gr_costas_loop_cc.h
-(pass-if (true? (gr:costas-loop-cc 0 0 0 0 2)))
-(pass-if-throw "confirm throw gr:costas-loop-cc" #t (true? (gr:costas-loop-cc 0 0 0 0 3)))
-
;;; ./general/gr_cpfsk_bc.h
(pass-if (true? (gr:cpfsk-bc 1 1 1)))
@@ -171,9 +147,6 @@
(pass-if (true? (gr:fft-vfc 4 #t #(1.0 2.0 3.0 4.0))))
(pass-if-throw "confirm throw gr:fft-vfc" #t (true? (gr:fft-vfc 4 #f #(1.0 2.0 3.0 4.0))))
-;;; ./general/gr_fll_band_edge_cc.h
-(pass-if (true? (gr:fll-band-edge-cc 0 0 0 0 0)))
-
;; ;;; ./general/gr_float_to_char.h
(pass-if (true? (gr:float-to-char)))
@@ -221,18 +194,9 @@
;;; ./general/gr_lfsr_32k_source_s.h
(pass-if (true? (gr:lfsr-32k-source-s)))
-;;; ./general/gr_lms_dfe_cc.h
-(pass-if (true? (gr:lms-dfe-ff 1 1 1 1)))
-
-;;; ./general/gr_lms_dfe_ff.h
-(pass-if (true? (gr:lms-dfe-ff 1 1 1 1)))
-
;;; ./general/gr_map_bb.h
(pass-if (true? (gr:map-bb #(1 2))))
-;;; ./general/gr_mpsk_receiver_cc.h
-(pass-if (true? (gr:mpsk-receiver-cc 1 1 1 1 1 1 1 1 1 1 1)))
-
;;; ./general/gr_nlog10_ff.h
(pass-if (true? (gr:nlog10-ff 1 1 1)))
@@ -280,13 +244,13 @@
(pass-if (true? (gr:phase-modulator-fc 0)))
;;; ./general/gr_pll_carriertracking_cc.h
-(pass-if (true? (gr:pll-carriertracking-cc 0 0 0 0)))
+(pass-if (true? (gr:pll-carriertracking-cc 0 0 0)))
;;; ./general/gr_pll_freqdet_cf.h
-(pass-if (true? (gr:pll-freqdet-cf 0 0 0 0)))
+(pass-if (true? (gr:pll-freqdet-cf 0 0 0)))
;;; ./general/gr_pll_refout_cc.h
-(pass-if (true? (gr:pll-refout-cc 0 0 0 0)))
+(pass-if (true? (gr:pll-refout-cc 0 0 0)))
;;; ./general/gr_pn_correlator_cc.h
(pass-if (true? (gr:pn-correlator-cc 1 1 1)))
diff --git a/gnuradio-core/src/lib/Makefile.am b/gnuradio-core/src/lib/Makefile.am
index db2482479..fc1b7917b 100644
--- a/gnuradio-core/src/lib/Makefile.am
+++ b/gnuradio-core/src/lib/Makefile.am
@@ -23,7 +23,7 @@ include $(top_srcdir)/Makefile.common
## Process this file with automake to produce Makefile.in
# We've got to build . before swig
-SUBDIRS = missing runtime filter viterbi general gengen g72x reed-solomon io hier . swig
+SUBDIRS = missing runtime filter viterbi general gengen reed-solomon io hier . swig
AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES)
@@ -42,7 +42,6 @@ libgnuradio_core_qa_la_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 \
libgnuradio_core_la_LIBADD = \
filter/libfilter.la \
- g72x/libccitt.la \
viterbi/libviterbi.la \
general/libgeneral.la \
gengen/libgengen.la \
diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am
index 0314079a2..c314431bf 100644
--- a/gnuradio-core/src/lib/filter/Makefile.am
+++ b/gnuradio-core/src/lib/filter/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2001,2002,2004,2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
+# Copyright 2001,2002,2004-2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -188,8 +188,8 @@ EXTRA_DIST += \
# work around automake deficiency
libfilter_la_common_SOURCES = \
$(GENERATED_CC) \
+ gr_adaptive_fir_ccc.cc \
gr_adaptive_fir_ccf.cc \
- gr_cma_equalizer_cc.cc \
gri_fft_filter_fff_generic.cc \
gri_fft_filter_ccc_generic.cc \
gr_fft_filter_ccc.cc \
@@ -215,6 +215,7 @@ libfilter_la_common_SOURCES = \
gr_pfb_decimator_ccf.cc \
gr_pfb_interpolator_ccf.cc \
gr_pfb_arb_resampler_ccf.cc \
+ gr_pfb_arb_resampler_fff.cc \
gr_pfb_clock_sync_ccf.cc \
gr_pfb_clock_sync_fff.cc \
gr_dc_blocker_cc.cc \
@@ -272,9 +273,9 @@ grinclude_HEADERS = \
ccomplex_dotprod_x86.h \
float_dotprod_generic.h \
float_dotprod_x86.h \
+ gr_adaptive_fir_ccc.h \
gr_adaptive_fir_ccf.h \
gr_altivec.h \
- gr_cma_equalizer_cc.h \
gr_cpu.h \
gri_fft_filter_fff_generic.h \
gri_fft_filter_ccc_generic.h \
@@ -307,6 +308,7 @@ grinclude_HEADERS = \
gr_pfb_decimator_ccf.h \
gr_pfb_interpolator_ccf.h \
gr_pfb_arb_resampler_ccf.h \
+ gr_pfb_arb_resampler_fff.h \
gr_pfb_clock_sync_ccf.h \
gr_pfb_clock_sync_fff.h \
gr_dc_blocker_cc.h \
@@ -357,8 +359,8 @@ noinst_HEADERS = \
swiginclude_HEADERS = \
filter.i \
filter_generated.i \
+ gr_adaptive_fir_ccc.i \
gr_adaptive_fir_ccf.i \
- gr_cma_equalizer_cc.i \
gr_fft_filter_ccc.i \
gr_fft_filter_fff.i \
gr_filter_delay_fc.i \
@@ -374,6 +376,7 @@ swiginclude_HEADERS = \
gr_pfb_decimator_ccf.i \
gr_pfb_interpolator_ccf.i \
gr_pfb_arb_resampler_ccf.i \
+ gr_pfb_arb_resampler_fff.i \
gr_pfb_clock_sync_ccf.i \
gr_pfb_clock_sync_fff.i \
gr_dc_blocker_cc.i \
diff --git a/gnuradio-core/src/lib/filter/filter.i b/gnuradio-core/src/lib/filter/filter.i
index 58bb4f0d5..8c3bb9eb6 100644
--- a/gnuradio-core/src/lib/filter/filter.i
+++ b/gnuradio-core/src/lib/filter/filter.i
@@ -31,12 +31,12 @@
#include <gr_fractional_interpolator_ff.h>
#include <gr_fractional_interpolator_cc.h>
#include <gr_goertzel_fc.h>
-#include <gr_cma_equalizer_cc.h>
#include <gr_pfb_channelizer_ccf.h>
#include <gr_pfb_synthesis_filterbank_ccf.h>
#include <gr_pfb_decimator_ccf.h>
#include <gr_pfb_interpolator_ccf.h>
#include <gr_pfb_arb_resampler_ccf.h>
+#include <gr_pfb_arb_resampler_fff.h>
#include <gr_pfb_clock_sync_ccf.h>
#include <gr_pfb_clock_sync_fff.h>
#include <gr_dc_blocker_cc.h>
@@ -53,12 +53,12 @@
%include "gr_fractional_interpolator_ff.i"
%include "gr_fractional_interpolator_cc.i"
%include "gr_goertzel_fc.i"
-%include "gr_cma_equalizer_cc.i"
%include "gr_pfb_channelizer_ccf.i"
%include "gr_pfb_synthesis_filterbank_ccf.i"
%include "gr_pfb_decimator_ccf.i"
%include "gr_pfb_interpolator_ccf.i"
%include "gr_pfb_arb_resampler_ccf.i"
+%include "gr_pfb_arb_resampler_fff.i"
%include "gr_pfb_decimator_ccf.i"
%include "gr_pfb_interpolator_ccf.i"
%include "gr_pfb_arb_resampler_ccf.i"
diff --git a/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.cc b/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.cc
new file mode 100644
index 000000000..3fed74641
--- /dev/null
+++ b/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.cc
@@ -0,0 +1,88 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_adaptive_fir_ccc.h>
+#include <gr_io_signature.h>
+
+gr_adaptive_fir_ccc::gr_adaptive_fir_ccc(const char *name, int decimation,
+ const std::vector<gr_complex> &taps)
+ : gr_sync_decimator (name,
+ gr_make_io_signature (1, 1, sizeof(gr_complex)),
+ gr_make_io_signature (1, 1, sizeof(gr_complex)),
+ decimation),
+ d_updated(false), d_taps(taps)
+{
+ set_history(d_taps.size());
+}
+
+void
+gr_adaptive_fir_ccc::set_taps(const std::vector<gr_complex> &taps)
+{
+ d_new_taps = taps;
+ d_updated = true;
+}
+
+gr_complex
+gr_adaptive_fir_ccc::filter(gr_complex *x)
+{
+ // Generic dot product of d_taps[] and in[]
+ gr_complex acc(0.0, 0.0);
+ int l = d_taps.size();
+ for (int k = 0; k < l; k++)
+ acc += d_taps[l-k-1] * x[k];
+ return acc;
+}
+
+int
+gr_adaptive_fir_ccc::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ gr_complex *in = (gr_complex *)input_items[0];
+ gr_complex *out = (gr_complex *)output_items[0];
+
+ if (d_updated) {
+ d_taps = d_new_taps;
+ set_history(d_taps.size());
+ d_updated = false;
+ return 0; // history requirements may have changed.
+ }
+
+ int j = 0, k, l = d_taps.size();
+ for (int i = 0; i < noutput_items; i++) {
+ out[i] = filter(&in[j]);
+
+ // Adjust taps
+ d_error = error(out[i]);
+ for (k = 0; k < l; k++) {
+ update_tap(d_taps[l-k-1], in[j+k]);
+ }
+
+ j += decimation();
+ }
+
+ return noutput_items;
+}
diff --git a/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.h b/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.h
new file mode 100644
index 000000000..8678255b7
--- /dev/null
+++ b/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.h
@@ -0,0 +1,61 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_GR_ADAPTIVE_FIR_CCC_H
+#define INCLUDED_GR_ADAPTIVE_FIR_CCC_H
+
+#include <gr_sync_decimator.h>
+
+/*!
+ * \brief Adaptive FIR filter with gr_complex input, gr_complex output and float taps
+ * \ingroup filter_blk
+ */
+class gr_adaptive_fir_ccc : public gr_sync_decimator
+{
+private:
+ std::vector<gr_complex> d_new_taps;
+ bool d_updated;
+
+protected:
+ gr_complex d_error;
+ std::vector<gr_complex> d_taps;
+
+ // Override to calculate error signal per output
+ virtual gr_complex error(const gr_complex &out) = 0;
+
+ // Override to calculate new weight from old, corresponding input
+ virtual void update_tap(gr_complex &tap, const gr_complex &in) = 0;
+
+ gr_complex filter(gr_complex *x);
+
+ gr_adaptive_fir_ccc(const char *name, int decimation,
+ const std::vector<gr_complex> &taps);
+
+public:
+ void set_taps(const std::vector<gr_complex> &taps);
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif
diff --git a/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.i b/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.i
new file mode 100644
index 000000000..7e9a3fac3
--- /dev/null
+++ b/gnuradio-core/src/lib/filter/gr_adaptive_fir_ccc.i
@@ -0,0 +1,31 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+class gr_adaptive_fir_ccc : public gr_sync_decimator
+{
+protected:
+ gr_adaptive_fir_ccc(char *name, int decimation,
+ const std::vector<gr_complex> &taps);
+
+public:
+ void set_taps(const std::vector<gr_complex> &taps);
+};
diff --git a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.h b/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.h
deleted file mode 100644
index c78047c16..000000000
--- a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 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_GR_CMA_EQUALIZER_CC_H
-#define INCLUDED_GR_CMA_EQUALIZER_CC_H
-
-#include <gr_adaptive_fir_ccf.h>
-
-class gr_cma_equalizer_cc;
-typedef boost::shared_ptr<gr_cma_equalizer_cc> gr_cma_equalizer_cc_sptr;
-
-gr_cma_equalizer_cc_sptr
-gr_make_cma_equalizer_cc(int num_taps, float modulus, float mu);
-
-/*!
- * \brief Implements constant modulus adaptive filter on complex stream
- * \ingroup eq_blk
- */
-class gr_cma_equalizer_cc : public gr_adaptive_fir_ccf
-{
-private:
- float d_modulus;
- float d_mu;
-
- friend gr_cma_equalizer_cc_sptr gr_make_cma_equalizer_cc(int num_taps, float modulus, float mu);
- gr_cma_equalizer_cc(int num_taps, float modulus, float mu);
-
-protected:
-
- virtual float error(const gr_complex &out)
- {
- return (d_modulus - norm(out));
- }
-
- virtual void update_tap(float &tap, const gr_complex &in)
- {
- tap += d_mu*d_error*abs(in);
- }
-
-public:
-};
-
-#endif
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h
index 2c36c95f9..806c33d92 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.h
@@ -41,6 +41,7 @@ class gr_fir_ccf;
* gr_complex input, gr_complex output and float taps
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*
* This block takes in a signal stream and performs arbitrary
* resampling. The resampling rate can be any real
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.cc b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.cc
new file mode 100644
index 000000000..9035e67f4
--- /dev/null
+++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.cc
@@ -0,0 +1,209 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009-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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_pfb_arb_resampler_fff.h>
+#include <gr_fir_fff.h>
+#include <gr_fir_util.h>
+#include <gr_io_signature.h>
+#include <cstdio>
+
+gr_pfb_arb_resampler_fff_sptr gr_make_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size)
+{
+ return gnuradio::get_initial_sptr(new gr_pfb_arb_resampler_fff (rate, taps,
+ filter_size));
+}
+
+
+gr_pfb_arb_resampler_fff::gr_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size)
+ : gr_block ("pfb_arb_resampler_fff",
+ gr_make_io_signature (1, 1, sizeof(float)),
+ gr_make_io_signature (1, 1, sizeof(float))),
+ d_updated (false)
+{
+ d_acc = 0; // start accumulator at 0
+
+ /* The number of filters is specified by the user as the filter size;
+ this is also the interpolation rate of the filter. We use it and the
+ rate provided to determine the decimation rate. This acts as a
+ rational resampler. The flt_rate is calculated as the residual
+ between the integer decimation rate and the real decimation rate and
+ will be used to determine to interpolation point of the resampling
+ process.
+ */
+ d_int_rate = filter_size;
+ set_rate(rate);
+
+ // Store the last filter between calls to work
+ d_last_filter = 0;
+
+ d_start_index = 0;
+
+ d_filters = std::vector<gr_fir_fff*>(d_int_rate);
+ d_diff_filters = std::vector<gr_fir_fff*>(d_int_rate);
+
+ // Create an FIR filter for each channel and zero out the taps
+ std::vector<float> vtaps(0, d_int_rate);
+ for(unsigned int i = 0; i < d_int_rate; i++) {
+ d_filters[i] = gr_fir_util::create_gr_fir_fff(vtaps);
+ d_diff_filters[i] = gr_fir_util::create_gr_fir_fff(vtaps);
+ }
+
+ // Now, actually set the filters' taps
+ std::vector<float> dtaps;
+ create_diff_taps(taps, dtaps);
+ create_taps(taps, d_taps, d_filters);
+ create_taps(dtaps, d_dtaps, d_diff_filters);
+}
+
+gr_pfb_arb_resampler_fff::~gr_pfb_arb_resampler_fff ()
+{
+ for(unsigned int i = 0; i < d_int_rate; i++) {
+ delete d_filters[i];
+ }
+}
+
+void
+gr_pfb_arb_resampler_fff::create_taps (const std::vector<float> &newtaps,
+ std::vector< std::vector<float> > &ourtaps,
+ std::vector<gr_fir_fff*> &ourfilter)
+{
+ unsigned int ntaps = newtaps.size();
+ d_taps_per_filter = (unsigned int)ceil((double)ntaps/(double)d_int_rate);
+
+ // Create d_numchan vectors to store each channel's taps
+ ourtaps.resize(d_int_rate);
+
+ // Make a vector of the taps plus fill it out with 0's to fill
+ // each polyphase filter with exactly d_taps_per_filter
+ std::vector<float> tmp_taps;
+ tmp_taps = newtaps;
+ while((float)(tmp_taps.size()) < d_int_rate*d_taps_per_filter) {
+ tmp_taps.push_back(0.0);
+ }
+
+ // Partition the filter
+ for(unsigned int i = 0; i < d_int_rate; i++) {
+ // Each channel uses all d_taps_per_filter with 0's if not enough taps to fill out
+ ourtaps[d_int_rate-1-i] = std::vector<float>(d_taps_per_filter, 0);
+ for(unsigned int j = 0; j < d_taps_per_filter; j++) {
+ ourtaps[d_int_rate - 1 - i][j] = tmp_taps[i + j*d_int_rate];
+ }
+
+ // Build a filter for each channel and add it's taps to it
+ ourfilter[i]->set_taps(ourtaps[d_int_rate-1-i]);
+ }
+
+ // Set the history to ensure enough input items for each filter
+ set_history (d_taps_per_filter + 1);
+
+ d_updated = true;
+}
+
+void
+gr_pfb_arb_resampler_fff::create_diff_taps(const std::vector<float> &newtaps,
+ std::vector<float> &difftaps)
+{
+ // Calculate the differential taps (derivative filter) by taking the difference
+ // between two taps. Duplicate the last one to make both filters the same length.
+ float tap;
+ difftaps.clear();
+ for(unsigned int i = 0; i < newtaps.size()-1; i++) {
+ tap = newtaps[i+1] - newtaps[i];
+ difftaps.push_back(tap);
+ }
+ difftaps.push_back(tap);
+}
+
+void
+gr_pfb_arb_resampler_fff::print_taps()
+{
+ unsigned int i, j;
+ for(i = 0; i < d_int_rate; i++) {
+ printf("filter[%d]: [", i);
+ for(j = 0; j < d_taps_per_filter; j++) {
+ printf(" %.4e", d_taps[i][j]);
+ }
+ printf("]\n");
+ }
+}
+
+int
+gr_pfb_arb_resampler_fff::general_work (int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ float *in = (float *) input_items[0];
+ float *out = (float *) output_items[0];
+
+ if (d_updated) {
+ d_updated = false;
+ return 0; // history requirements may have changed.
+ }
+
+ int i = 0, count = d_start_index;
+ unsigned int j;
+ float o0, o1;
+
+ // Restore the last filter position
+ j = d_last_filter;
+
+ // produce output as long as we can and there are enough input samples
+ int max_input = ninput_items[0]-(int)d_taps_per_filter;
+ while((i < noutput_items) && (count < max_input)) {
+ // start j by wrapping around mod the number of channels
+ while((j < d_int_rate) && (i < noutput_items)) {
+ // Take the current filter and derivative filter output
+ o0 = d_filters[j]->filter(&in[count]);
+ o1 = d_diff_filters[j]->filter(&in[count]);
+
+ out[i] = o0 + o1*d_acc; // linearly interpolate between samples
+ i++;
+
+ // Adjust accumulator and index into filterbank
+ d_acc += d_flt_rate;
+ j += d_dec_rate + (int)floor(d_acc);
+ d_acc = fmodf(d_acc, 1.0);
+ }
+ if(i < noutput_items) { // keep state for next entry
+ float ss = (int)(j / d_int_rate); // number of items to skip ahead by
+ count += ss; // we have fully consumed another input
+ j = j % d_int_rate; // roll filter around
+ }
+ }
+
+ // Store the current filter position and start of next sample
+ d_last_filter = j;
+ d_start_index = std::max(0, count - ninput_items[0]);
+
+ // consume all we've processed but no more than we can
+ consume_each(std::min(count, ninput_items[0]));
+ return i;
+}
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.h b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.h
new file mode 100644
index 000000000..69331a2c6
--- /dev/null
+++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.h
@@ -0,0 +1,177 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009-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.
+ */
+
+
+#ifndef INCLUDED_GR_PFB_ARB_RESAMPLER_FFF_H
+#define INCLUDED_GR_PFB_ARB_RESAMPLER_FFF_H
+
+#include <gr_block.h>
+
+class gr_pfb_arb_resampler_fff;
+typedef boost::shared_ptr<gr_pfb_arb_resampler_fff> gr_pfb_arb_resampler_fff_sptr;
+gr_pfb_arb_resampler_fff_sptr gr_make_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size=32);
+
+class gr_fir_fff;
+
+/*!
+ * \class gr_pfb_arb_resampler_fff
+ *
+ * \brief Polyphase filterbank arbitrary resampler with
+ * float input, float output and float taps
+ *
+ * \ingroup filter_blk
+ * \ingroup pfb_blk
+ *
+ * This block takes in a signal stream and performs arbitrary
+ * resampling. The resampling rate can be any real
+ * number <EM>r</EM>. The resampling is done by constructing
+ * <EM>N</EM> filters where <EM>N</EM> is the interpolation rate. We
+ * then calculate <EM>D</EM> where <EM>D = floor(N/r)</EM>.
+ *
+ * Using <EM>N</EM> and <EM>D</EM>, we can perform rational resampling
+ * where <EM>N/D</EM> is a rational number close to the input rate
+ * <EM>r</EM> where we have <EM>N</EM> filters and we cycle through
+ * them as a polyphase filterbank with a stride of <EM>D</EM> so that
+ * <EM>i+1 = (i + D) % N</EM>.
+ *
+ * To get the arbitrary rate, we want to interpolate between two
+ * points. For each value out, we take an output from the current
+ * filter, <EM>i</EM>, and the next filter <EM>i+1</EM> and then
+ * linearly interpolate between the two based on the real resampling
+ * rate we want.
+ *
+ * The linear interpolation only provides us with an approximation to
+ * the real sampling rate specified. The error is a quantization error
+ * between the two filters we used as our interpolation points. To
+ * this end, the number of filters, <EM>N</EM>, used determines the
+ * quantization error; the larger <EM>N</EM>, the smaller the
+ * noise. You can design for a specified noise floor by setting the
+ * filter size (parameters <EM>filter_size</EM>). The size defaults to
+ * 32 filters, which is about as good as most implementations need.
+ *
+ * The trick with designing this filter is in how to specify the taps
+ * of the prototype filter. Like the PFB interpolator, the taps are
+ * specified using the interpolated filter rate. In this case, that
+ * rate is the input sample rate multiplied by the number of filters
+ * in the filterbank, which is also the interpolation rate. All other
+ * values should be relative to this rate.
+ *
+ * For example, for a 32-filter arbitrary resampler and using the
+ * GNU Radio's firdes utility to build the filter, we build a low-pass
+ * filter with a sampling rate of <EM>fs</EM>, a 3-dB bandwidth of
+ * <EM>BW</EM> and a transition bandwidth of <EM>TB</EM>. We can also
+ * specify the out-of-band attenuation to use, <EM>ATT</EM>, and the
+ * filter window function (a Blackman-harris window in this case). The
+ * first input is the gain of the filter, which we specify here as the
+ * interpolation rate (<EM>32</EM>).
+ *
+ * <B><EM>self._taps = gr.firdes.low_pass_2(32, 32*fs, BW, TB,
+ * attenuation_dB=ATT, window=gr.firdes.WIN_BLACKMAN_hARRIS)</EM></B>
+ *
+ * The theory behind this block can be found in Chapter 7.5 of
+ * the following book.
+ *
+ * <B><EM>f. harris, "Multirate Signal Processing for Communication
+ * Systems", Upper Saddle River, NJ: Prentice Hall, Inc. 2004.</EM></B>
+ */
+
+class gr_pfb_arb_resampler_fff : public gr_block
+{
+ private:
+ /*!
+ * Build the polyphase filterbank arbitray resampler.
+ * \param rate (float) Specifies the resampling rate to use
+ * \param taps (vector/list of floats) The prototype filter to populate the filterbank. The taps
+ * should be generated at the filter_size sampling rate.
+ * \param filter_size (unsigned int) The number of filters in the filter bank. This is directly
+ related to quantization noise introduced during the resampling.
+ Defaults to 32 filters.
+ */
+ friend gr_pfb_arb_resampler_fff_sptr gr_make_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size);
+
+ std::vector<gr_fir_fff*> d_filters;
+ std::vector<gr_fir_fff*> d_diff_filters;
+ std::vector< std::vector<float> > d_taps;
+ std::vector< std::vector<float> > d_dtaps;
+ unsigned int d_int_rate; // the number of filters (interpolation rate)
+ unsigned int d_dec_rate; // the stride through the filters (decimation rate)
+ float d_flt_rate; // residual rate for the linear interpolation
+ float d_acc;
+ unsigned int d_last_filter;
+ int d_start_index;
+ unsigned int d_taps_per_filter;
+ bool d_updated;
+
+ /*!
+ * Build the polyphase filterbank arbitray resampler.
+ * \param rate (float) Specifies the resampling rate to use
+ * \param taps (vector/list of floats) The prototype filter to populate the filterbank. The taps
+ * should be generated at the filter_size sampling rate.
+ * \param filter_size (unsigned int) The number of filters in the filter bank. This is directly
+ related to quantization noise introduced during the resampling.
+ Defaults to 32 filters.
+ */
+ gr_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size);
+
+ void create_diff_taps(const std::vector<float> &newtaps,
+ std::vector<float> &difftaps);
+
+ /*!
+ * Resets the filterbank's filter taps with the new prototype filter
+ * \param newtaps (vector of floats) The prototype filter to populate the filterbank.
+ * The taps should be generated at the interpolated sampling rate.
+ * \param ourtaps (vector of floats) Reference to our internal member of holding the taps.
+ * \param ourfilter (vector of filters) Reference to our internal filter to set the taps for.
+ */
+ void create_taps (const std::vector<float> &newtaps,
+ std::vector< std::vector<float> > &ourtaps,
+ std::vector<gr_fir_fff*> &ourfilter);
+
+
+public:
+ ~gr_pfb_arb_resampler_fff ();
+
+ // FIXME: See about a set_taps function during runtime.
+
+ /*!
+ * Print all of the filterbank taps to screen.
+ */
+ void print_taps();
+ void set_rate (float rate) {
+ d_dec_rate = (unsigned int)floor(d_int_rate/rate);
+ d_flt_rate = (d_int_rate/rate) - d_dec_rate;
+ set_relative_rate(rate);
+ }
+
+ int general_work (int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif
diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.i
index c9c792c8a..8c1db22c3 100644
--- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.i
+++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_fff.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,22 +20,23 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,fll_band_edge_cc);
+GR_SWIG_BLOCK_MAGIC(gr,pfb_arb_resampler_fff);
-gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float samps_per_sym, float rolloff,
- int filter_size, float alpha, float beta);
+gr_pfb_arb_resampler_fff_sptr gr_make_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size=32);
-class gr_fll_band_edge_cc : public gr_sync_block
+class gr_pfb_arb_resampler_fff : public gr_block
{
private:
- gr_fll_band_edge_cc (float samps_per_sym, float rolloff,
- int filter_size, float alpha, float beta);
+ gr_pfb_arb_resampler_fff (float rate,
+ const std::vector<float> &taps,
+ unsigned int filter_size);
public:
- ~gr_fll_band_edge_cc ();
+ ~gr_pfb_arb_resampler_fff ();
- void set_alpha (float alpha);
- void set_beta (float beta);
- void design_filter(float samps_per_sym, float rolloff, int filter_size);
+ //void set_taps (const std::vector<float> &taps);
void print_taps();
+ void set_rate (float rate);
};
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
index 751673bc7..68476ed3c 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_channelizer_ccf.h
@@ -43,6 +43,7 @@ class gri_fft_complex;
* gr_complex input, gr_complex output and float taps
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*
* This block takes in complex inputs and channelizes it to <EM>M</EM>
* channels of equal bandwidth. Each of the resulting channels is
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
index 937899c0d..633c5be07 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2009,2010 Free Software Foundation, Inc.
+ * Copyright 2009-2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -33,39 +33,47 @@
#include <gr_io_signature.h>
#include <gr_math.h>
-gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain,
+gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size,
float init_phase,
- float max_rate_deviation)
+ float max_rate_deviation,
+ int osps)
{
- return gnuradio::get_initial_sptr(new gr_pfb_clock_sync_ccf (sps, gain, taps,
- filter_size,
- init_phase,
- max_rate_deviation));
+ return gnuradio::get_initial_sptr(new gr_pfb_clock_sync_ccf (sps, loop_bw, taps,
+ filter_size,
+ init_phase,
+ max_rate_deviation,
+ osps));
}
static int ios[] = {sizeof(gr_complex), sizeof(float), sizeof(float), sizeof(float)};
static std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int));
-gr_pfb_clock_sync_ccf::gr_pfb_clock_sync_ccf (double sps, float gain,
+gr_pfb_clock_sync_ccf::gr_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size,
float init_phase,
- float max_rate_deviation)
+ float max_rate_deviation,
+ int osps)
: gr_block ("pfb_clock_sync_ccf",
gr_make_io_signature (1, 1, sizeof(gr_complex)),
gr_make_io_signaturev (1, 4, iosig)),
d_updated (false), d_nfilters(filter_size),
- d_max_dev(max_rate_deviation)
+ d_max_dev(max_rate_deviation),
+ d_osps(osps), d_error(0)
{
d_nfilters = filter_size;
d_sps = floor(sps);
+ // Set the damping factor for a critically damped system
+ d_damping = sqrtf(2.0f)/2.0f;
+
+ // Set the bandwidth, which will then call update_gains()
+ set_loop_bandwidth(loop_bw);
+
// Store the last filter between calls to work
// The accumulator keeps track of overflow to increment the stride correctly.
// set it here to the fractional difference based on the initial phaes
- set_alpha(gain);
- set_beta(0.25*gain*gain);
d_k = init_phase;
d_rate = (sps-floor(sps))*(double)d_nfilters;
d_rate_i = (int)floor(d_rate);
@@ -103,6 +111,100 @@ gr_pfb_clock_sync_ccf::check_topology(int ninputs, int noutputs)
return noutputs == 1 || noutputs == 4;
}
+
+
+/*******************************************************************
+ SET FUNCTIONS
+*******************************************************************/
+
+
+void
+gr_pfb_clock_sync_ccf::set_loop_bandwidth(float bw)
+{
+ if(bw < 0) {
+ throw std::out_of_range ("gr_pfb_clock_sync_cc: invalid bandwidth. Must be >= 0.");
+ }
+
+ d_loop_bw = bw;
+ update_gains();
+}
+
+void
+gr_pfb_clock_sync_ccf::set_damping_factor(float df)
+{
+ if(df < 0 || df > 1.0) {
+ throw std::out_of_range ("gr_pfb_clock_sync_cc: invalid damping factor. Must be in [0,1].");
+ }
+
+ d_damping = df;
+ update_gains();
+}
+
+void
+gr_pfb_clock_sync_ccf::set_alpha(float alpha)
+{
+ if(alpha < 0 || alpha > 1.0) {
+ throw std::out_of_range ("gr_pfb_clock_sync_cc: invalid alpha. Must be in [0,1].");
+ }
+ d_alpha = alpha;
+}
+
+void
+gr_pfb_clock_sync_ccf::set_beta(float beta)
+{
+ if(beta < 0 || beta > 1.0) {
+ throw std::out_of_range ("gr_pfb_clock_sync_cc: invalid beta. Must be in [0,1].");
+ }
+ d_beta = beta;
+}
+
+/*******************************************************************
+ GET FUNCTIONS
+*******************************************************************/
+
+
+float
+gr_pfb_clock_sync_ccf::get_loop_bandwidth() const
+{
+ return d_loop_bw;
+}
+
+float
+gr_pfb_clock_sync_ccf::get_damping_factor() const
+{
+ return d_damping;
+}
+
+float
+gr_pfb_clock_sync_ccf::get_alpha() const
+{
+ return d_alpha;
+}
+
+float
+gr_pfb_clock_sync_ccf::get_beta() const
+{
+ return d_beta;
+}
+
+float
+gr_pfb_clock_sync_ccf::get_clock_rate() const
+{
+ return d_rate_f;
+}
+
+/*******************************************************************
+*******************************************************************/
+
+void
+gr_pfb_clock_sync_ccf::update_gains()
+{
+ float denom = (1.0 + 2.0*d_damping*d_loop_bw + d_loop_bw*d_loop_bw);
+ d_alpha = (4*d_damping*d_loop_bw) / denom;
+ d_beta = (4*d_loop_bw*d_loop_bw) / denom;
+}
+
+
void
gr_pfb_clock_sync_ccf::set_taps (const std::vector<float> &newtaps,
std::vector< std::vector<float> > &ourtaps,
@@ -127,13 +229,16 @@ gr_pfb_clock_sync_ccf::set_taps (const std::vector<float> &newtaps,
// Partition the filter
for(i = 0; i < d_nfilters; i++) {
// Each channel uses all d_taps_per_filter with 0's if not enough taps to fill out
- ourtaps[d_nfilters-1-i] = std::vector<float>(d_taps_per_filter, 0);
+ //ourtaps[d_nfilters-1-i] = std::vector<float>(d_taps_per_filter, 0);
+ ourtaps[i] = std::vector<float>(d_taps_per_filter, 0);
for(j = 0; j < d_taps_per_filter; j++) {
- ourtaps[d_nfilters - 1 - i][j] = tmp_taps[i + j*d_nfilters];
+ //ourtaps[d_nfilters - 1 - i][j] = tmp_taps[i + j*d_nfilters];
+ ourtaps[i][j] = tmp_taps[i + j*d_nfilters];
}
// Build a filter for each channel and add it's taps to it
- ourfilter[i]->set_taps(ourtaps[d_nfilters-1-i]);
+ //ourfilter[i]->set_taps(ourtaps[d_nfilters-1-i]);
+ ourfilter[i]->set_taps(ourtaps[i]);
}
// Set the history to ensure enough input items for each filter
@@ -146,58 +251,84 @@ void
gr_pfb_clock_sync_ccf::create_diff_taps(const std::vector<float> &newtaps,
std::vector<float> &difftaps)
{
- float maxtap = 1e-20;
- difftaps.clear();
- difftaps.push_back(0); //newtaps[0]);
- for(unsigned int i = 1; i < newtaps.size()-1; i++) {
- float tap = newtaps[i+1] - newtaps[i-1];
- difftaps.push_back(tap);
- if(tap > maxtap) {
- maxtap = tap;
+ std::vector<float> diff_filter(3);
+ diff_filter[0] = -1;
+ diff_filter[1] = 0;
+ diff_filter[2] = 1;
+
+ float pwr = 0;
+ difftaps.push_back(0);
+ for(unsigned int i = 0; i < newtaps.size()-2; i++) {
+ float tap = 0;
+ for(int j = 0; j < 3; j++) {
+ tap += diff_filter[j]*newtaps[i+j];
+ pwr += fabsf(tap);
}
+ difftaps.push_back(tap);
}
- difftaps.push_back(0);//-newtaps[newtaps.size()-1]);
+ difftaps.push_back(0);
- // Scale the differential taps; helps scale error term to better update state
- // FIXME: should this be scaled this way or use the same gain as the taps?
for(unsigned int i = 0; i < difftaps.size(); i++) {
- difftaps[i] /= maxtap;
+ difftaps[i] *= pwr;
}
}
-void
-gr_pfb_clock_sync_ccf::print_taps()
+std::string
+gr_pfb_clock_sync_ccf::get_taps_as_string()
{
int i, j;
- printf("[ ");
+ std::stringstream str;
+ str.precision(4);
+ str.setf(std::ios::scientific);
+
+ str << "[ ";
for(i = 0; i < d_nfilters; i++) {
- printf("[%.4e, ", d_taps[i][0]);
+ str << "[" << d_taps[i][0] << ", ";
for(j = 1; j < d_taps_per_filter-1; j++) {
- printf("%.4e,", d_taps[i][j]);
+ str << d_taps[i][j] << ", ";
}
- printf("%.4e],", d_taps[i][j]);
+ str << d_taps[i][j] << "],";
}
- printf(" ]\n");
+ str << " ]" << std::endl;
+
+ return str.str();
}
-void
-gr_pfb_clock_sync_ccf::print_diff_taps()
+std::string
+gr_pfb_clock_sync_ccf::get_diff_taps_as_string()
{
int i, j;
- printf("[ ");
+ std::stringstream str;
+ str.precision(4);
+ str.setf(std::ios::scientific);
+
+ str << "[ ";
for(i = 0; i < d_nfilters; i++) {
- printf("[%.4e, ", d_dtaps[i][0]);
+ str << "[" << d_dtaps[i][0] << ", ";
for(j = 1; j < d_taps_per_filter-1; j++) {
- printf("%.4e,", d_dtaps[i][j]);
+ str << d_dtaps[i][j] << ", ";
}
- printf("%.4e],", d_dtaps[i][j]);
+ str << d_dtaps[i][j] << "],";
}
- printf(" ]\n");
+ str << " ]" << std::endl;
+
+ return str.str();
}
+std::vector< std::vector<float> >
+gr_pfb_clock_sync_ccf::get_taps()
+{
+ return d_taps;
+}
+
+std::vector< std::vector<float> >
+gr_pfb_clock_sync_ccf::get_diff_taps()
+{
+ return d_dtaps;
+}
std::vector<float>
-gr_pfb_clock_sync_ccf::channel_taps(int channel)
+gr_pfb_clock_sync_ccf::get_channel_taps(int channel)
{
std::vector<float> taps;
for(int i = 0; i < d_taps_per_filter; i++) {
@@ -207,7 +338,7 @@ gr_pfb_clock_sync_ccf::channel_taps(int channel)
}
std::vector<float>
-gr_pfb_clock_sync_ccf::diff_channel_taps(int channel)
+gr_pfb_clock_sync_ccf::get_diff_channel_taps(int channel)
{
std::vector<float> taps;
for(int i = 0; i < d_taps_per_filter; i++) {
@@ -226,7 +357,7 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items,
gr_complex *in = (gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
- float *err = 0, *outrate = 0, *outk = 0;
+ float *err = NULL, *outrate = NULL, *outk = NULL;
if(output_items.size() == 4) {
err = (float *) output_items[1];
outrate = (float*)output_items[2];
@@ -239,50 +370,56 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items,
}
// We need this many to process one output
- int nrequired = ninput_items[0] - d_taps_per_filter;
+ int nrequired = ninput_items[0] - d_taps_per_filter - d_osps;
int i = 0, count = 0;
- float error, error_r, error_i;
+ float error_r, error_i;
// produce output as long as we can and there are enough input samples
- while((i < noutput_items) && (count < nrequired)) {
- d_filtnum = (int)floor(d_k);
-
- // Keep the current filter number in [0, d_nfilters]
- // If we've run beyond the last filter, wrap around and go to next sample
- // If we've go below 0, wrap around and go to previous sample
- while(d_filtnum >= d_nfilters) {
- d_k -= d_nfilters;
- d_filtnum -= d_nfilters;
- count += 1;
- }
- while(d_filtnum < 0) {
- d_k += d_nfilters;
- d_filtnum += d_nfilters;
- count -= 1;
+ while((i < noutput_items-d_osps) && (count < nrequired)) {
+ for(int k = 0; k < d_osps; k++) {
+ d_filtnum = (int)floor(d_k);
+
+ // Keep the current filter number in [0, d_nfilters]
+ // If we've run beyond the last filter, wrap around and go to next sample
+ // If we've go below 0, wrap around and go to previous sample
+ while(d_filtnum >= d_nfilters) {
+ d_k -= d_nfilters;
+ d_filtnum -= d_nfilters;
+ count += 1;
+ }
+ while(d_filtnum < 0) {
+ d_k += d_nfilters;
+ d_filtnum += d_nfilters;
+ count -= 1;
+ }
+
+ out[i+k] = d_filters[d_filtnum]->filter(&in[count+k]);
+ d_k = d_k + d_rate_i + d_rate_f; // update phase
+
+ if(output_items.size() == 4) {
+ err[i] = d_error;
+ outrate[i] = d_rate_f;
+ outk[i] = d_k;
+ }
}
- out[i] = d_filters[d_filtnum]->filter(&in[count]);
+ // Update the phase and rate estimates for this symbol
gr_complex diff = d_diff_filters[d_filtnum]->filter(&in[count]);
- error_r = out[i].real() * diff.real();
- error_i = out[i].imag() * diff.imag();
- error = (error_i + error_r) / 2.0; // average error from I&Q channel
-
- // Run the control loop to update the current phase (k) and tracking rate
- d_k = d_k + d_alpha*error + d_rate_i + d_rate_f;
- d_rate_f = d_rate_f + d_beta*error;
+ error_r = out[i].real() * diff.real();
+ error_i = out[i].imag() * diff.imag();
+ d_error = (error_i + error_r) / 2.0; // average error from I&Q channel
+
+ // Run the control loop to update the current phase (k) and
+ // tracking rate estimates based on the error value
+ d_rate_f = d_rate_f + d_beta*d_error;
+ d_k = d_k + d_alpha*d_error;
// Keep our rate within a good range
d_rate_f = gr_branchless_clip(d_rate_f, d_max_dev);
- i++;
+ i+=d_osps;
count += (int)floor(d_sps);
-
- if(output_items.size() == 4) {
- err[i] = error;
- outrate[i] = d_rate_f;
- outk[i] = d_k;
- }
}
consume_each(count);
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
index 684ac85ce..674dee181 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.h
@@ -28,11 +28,12 @@
class gr_pfb_clock_sync_ccf;
typedef boost::shared_ptr<gr_pfb_clock_sync_ccf> gr_pfb_clock_sync_ccf_sptr;
-gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain,
+gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size=32,
float init_phase=0,
- float max_rate_deviation=1.5);
+ float max_rate_deviation=1.5,
+ int osps=1);
class gr_fir_ccf;
@@ -42,71 +43,85 @@ class gr_fir_ccf;
* \brief Timing synchronizer using polyphase filterbanks
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*
- * This block performs timing synchronization for PAM signals by minimizing the
- * derivative of the filtered signal, which in turn maximizes the SNR and
- * minimizes ISI.
+ * This block performs timing synchronization for PAM signals by
+ * minimizing the derivative of the filtered signal, which in turn
+ * maximizes the SNR and minimizes ISI.
*
- * This approach works by setting up two filterbanks; one filterbanke contains the
- * signal's pulse shaping matched filter (such as a root raised cosine filter),
- * where each branch of the filterbank contains a different phase of the filter.
- * The second filterbank contains the derivatives of the filters in the first
- * filterbank. Thinking of this in the time domain, the first filterbank contains
- * filters that have a sinc shape to them. We want to align the output signal to
- * be sampled at exactly the peak of the sinc shape. The derivative of the sinc
- * contains a zero at the maximum point of the sinc (sinc(0) = 1, sinc(0)' = 0).
- * Furthermore, the region around the zero point is relatively linear. We make
- * use of this fact to generate the error signal.
+ * This approach works by setting up two filterbanks; one filterbank
+ * contains the signal's pulse shaping matched filter (such as a root
+ * raised cosine filter), where each branch of the filterbank contains
+ * a different phase of the filter. The second filterbank contains
+ * the derivatives of the filters in the first filterbank. Thinking of
+ * this in the time domain, the first filterbank contains filters that
+ * have a sinc shape to them. We want to align the output signal to be
+ * sampled at exactly the peak of the sinc shape. The derivative of
+ * the sinc contains a zero at the maximum point of the sinc (sinc(0)
+ * = 1, sinc(0)' = 0). Furthermore, the region around the zero point
+ * is relatively linear. We make use of this fact to generate the
+ * error signal.
*
- * If the signal out of the derivative filters is d_i[n] for the ith filter, and
- * the output of the matched filter is x_i[n], we calculate the error as:
- * e[n] = (Re{x_i[n]} * Re{d_i[n]} + Im{x_i[n]} * Im{d_i[n]}) / 2.0
- * This equation averages the error in the real and imaginary parts. There are two
- * reasons we multiply by the signal itself. First, if the symbol could be positive
- * or negative going, but we want the error term to always tell us to go in the
- * same direction depending on which side of the zero point we are on. The sign of
- * x_i[n] adjusts the error term to do this. Second, the magnitude of x_i[n] scales
- * the error term depending on the symbol's amplitude, so larger signals give us
- * a stronger error term because we have more confidence in that symbol's value.
- * Using the magnitude of x_i[n] instead of just the sign is especially good for
- * signals with low SNR.
+ * If the signal out of the derivative filters is d_i[n] for the ith
+ * filter, and the output of the matched filter is x_i[n], we
+ * calculate the error as: e[n] = (Re{x_i[n]} * Re{d_i[n]} +
+ * Im{x_i[n]} * Im{d_i[n]}) / 2.0 This equation averages the error in
+ * the real and imaginary parts. There are two reasons we multiply by
+ * the signal itself. First, if the symbol could be positive or
+ * negative going, but we want the error term to always tell us to go
+ * in the same direction depending on which side of the zero point we
+ * are on. The sign of x_i[n] adjusts the error term to do
+ * this. Second, the magnitude of x_i[n] scales the error term
+ * depending on the symbol's amplitude, so larger signals give us a
+ * stronger error term because we have more confidence in that
+ * symbol's value. Using the magnitude of x_i[n] instead of just the
+ * sign is especially good for signals with low SNR.
*
- * The error signal, e[n], gives us a value proportional to how far away from the zero
- * point we are in the derivative signal. We want to drive this value to zero, so we
- * set up a second order loop. We have two variables for this loop; d_k is the filter
- * number in the filterbank we are on and d_rate is the rate which we travel through
- * the filters in the steady state. That is, due to the natural clock differences between
- * the transmitter and receiver, d_rate represents that difference and would traverse
- * the filter phase paths to keep the receiver locked. Thinking of this as a second-order
- * PLL, the d_rate is the frequency and d_k is the phase. So we update d_rate and d_k
- * using the standard loop equations based on two error signals, d_alpha and d_beta.
- * We have these two values set based on each other for a critically damped system, so in
- * the block constructor, we just ask for "gain," which is d_alpha while d_beta is
- * equal to (gain^2)/4.
+ * The error signal, e[n], gives us a value proportional to how far
+ * away from the zero point we are in the derivative signal. We want
+ * to drive this value to zero, so we set up a second order loop. We
+ * have two variables for this loop; d_k is the filter number in the
+ * filterbank we are on and d_rate is the rate which we travel through
+ * the filters in the steady state. That is, due to the natural clock
+ * differences between the transmitter and receiver, d_rate represents
+ * that difference and would traverse the filter phase paths to keep
+ * the receiver locked. Thinking of this as a second-order PLL, the
+ * d_rate is the frequency and d_k is the phase. So we update d_rate
+ * and d_k using the standard loop equations based on two error
+ * signals, d_alpha and d_beta. We have these two values set based on
+ * each other for a critically damped system, so in the block
+ * constructor, we just ask for "gain," which is d_alpha while d_beta
+ * is equal to (gain^2)/4.
*
- * The clock sync block needs to know the number of samples per symbol (sps), because it
- * only returns a single point representing the sample. The sps can be any positive real
- * number and does not need to be an integer. The filter taps must also be specified. The
- * taps are generated by first conceiving of the prototype filter that would be the signal's
- * matched filter. Then interpolate this by the number of filters in the filterbank. These
- * are then distributed among all of the filters. So if the prototype filter was to have
- * 45 taps in it, then each path of the filterbank will also have 45 taps. This is easily
- * done by building the filter with the sample rate multiplied by the number of filters
- * to use.
+ * The clock sync block needs to know the number of samples per symbol
+ * (sps), because it only returns a single point representing the
+ * symbol. The sps can be any positive real number and does not need
+ * to be an integer. The filter taps must also be specified. The taps
+ * are generated by first conceiving of the prototype filter that
+ * would be the signal's matched filter. Then interpolate this by the
+ * number of filters in the filterbank. These are then distributed
+ * among all of the filters. So if the prototype filter was to have 45
+ * taps in it, then each path of the filterbank will also have 45
+ * taps. This is easily done by building the filter with the sample
+ * rate multiplied by the number of filters to use.
*
- * The number of filters can also be set and defaults to 32. With 32 filters, you get a
- * good enough resolution in the phase to produce very small, almost unnoticeable, ISI.
- * Going to 64 filters can reduce this more, but after that there is very little gained
- * for the extra complexity.
+ * The number of filters can also be set and defaults to 32. With 32
+ * filters, you get a good enough resolution in the phase to produce
+ * very small, almost unnoticeable, ISI. Going to 64 filters can
+ * reduce this more, but after that there is very little gained for
+ * the extra complexity.
*
- * The initial phase is another settable parameter and refers to the filter path the
- * algorithm initially looks at (i.e., d_k starts at init_phase). This value defaults
- * to zero, but it might be useful to start at a different phase offset, such as the mid-
- * point of the filters.
+ * The initial phase is another settable parameter and refers to the
+ * filter path the algorithm initially looks at (i.e., d_k starts at
+ * init_phase). This value defaults to zero, but it might be useful to
+ * start at a different phase offset, such as the mid- point of the
+ * filters.
*
- * The final parameter is the max_rate_devitation, which defaults to 1.5. This is how far
- * we allow d_rate to swing, positive or negative, from 0. Constraining the rate can help
- * keep the algorithm from walking too far away to lock during times when there is no signal.
+ * The final parameter is the max_rate_devitation, which defaults to
+ * 1.5. This is how far we allow d_rate to swing, positive or
+ * negative, from 0. Constraining the rate can help keep the algorithm
+ * from walking too far away to lock during times when there is no
+ * signal.
*
*/
@@ -116,52 +131,70 @@ class gr_pfb_clock_sync_ccf : public gr_block
/*!
* Build the polyphase filterbank timing synchronizer.
* \param sps (double) The number of samples per symbol in the incoming signal
- * \param gain (float) The alpha gain of the control loop; beta = (gain^2)/4 by default.
+ * \param loop_bw (float) The bandwidth of the control loop; set's alpha and beta.
* \param taps (vector<int>) The filter taps.
* \param filter_size (uint) The number of filters in the filterbank (default = 32).
* \param init_phase (float) The initial phase to look at, or which filter to start
* with (default = 0).
* \param max_rate_deviation (float) Distance from 0 d_rate can get (default = 1.5).
+ * \param osps (int) The number of output samples per symbol (default=1).
*
*/
- friend gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain,
+ friend gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size,
float init_phase,
- float max_rate_deviation);
-
- bool d_updated;
- double d_sps;
- double d_sample_num;
- float d_alpha;
- float d_beta;
- int d_nfilters;
- std::vector<gr_fir_ccf*> d_filters;
- std::vector<gr_fir_ccf*> d_diff_filters;
+ float max_rate_deviation,
+ int osps);
+
+ bool d_updated;
+ double d_sps;
+ double d_sample_num;
+ float d_loop_bw;
+ float d_damping;
+ float d_alpha;
+ float d_beta;
+
+ int d_nfilters;
+ int d_taps_per_filter;
+ std::vector<gr_fir_ccf*> d_filters;
+ std::vector<gr_fir_ccf*> d_diff_filters;
std::vector< std::vector<float> > d_taps;
std::vector< std::vector<float> > d_dtaps;
- float d_k;
- float d_rate;
- float d_rate_i;
- float d_rate_f;
- float d_max_dev;
- int d_filtnum;
- int d_taps_per_filter;
+
+ float d_k;
+ float d_rate;
+ float d_rate_i;
+ float d_rate_f;
+ float d_max_dev;
+ int d_filtnum;
+ int d_osps;
+ float d_error;
/*!
* Build the polyphase filterbank timing synchronizer.
*/
- gr_pfb_clock_sync_ccf (double sps, float gain,
+ gr_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size,
float init_phase,
- float max_rate_deviation);
+ float max_rate_deviation,
+ int osps);
void create_diff_taps(const std::vector<float> &newtaps,
std::vector<float> &difftaps);
public:
~gr_pfb_clock_sync_ccf ();
+
+ /*! \brief update the system gains from omega and eta
+ *
+ * This function updates the system gains based on the loop
+ * bandwidth and damping factor of the system.
+ * These two factors can be set separately through their own
+ * set functions.
+ */
+ void update_gains();
/*!
* Resets the filterbank's filter taps with the new prototype filter
@@ -171,40 +204,97 @@ public:
std::vector<gr_fir_ccf*> &ourfilter);
/*!
- * Returns the taps of the matched filter
+ * Returns all of the taps of the matched filter
*/
- std::vector<float> channel_taps(int channel);
+ std::vector< std::vector<float> > get_taps();
/*!
- * Returns the taps in the derivative filter
+ * Returns all of the taps of the derivative filter
*/
- std::vector<float> diff_channel_taps(int channel);
+ std::vector< std::vector<float> > get_diff_taps();
/*!
- * Print all of the filterbank taps to screen.
+ * Returns the taps of the matched filter for a particular channel
*/
- void print_taps();
+ std::vector<float> get_channel_taps(int channel);
/*!
- * Print all of the filterbank taps of the derivative filter to screen.
+ * Returns the taps in the derivative filter for a particular channel
*/
- void print_diff_taps();
+ std::vector<float> get_diff_channel_taps(int channel);
/*!
- * Set the gain value alpha for the control loop
- */
- void set_alpha(float alpha)
- {
- d_alpha = alpha;
- }
+ * Return the taps as a formatted string for printing
+ */
+ std::string get_taps_as_string();
/*!
- * Set the gain value beta for the control loop
- */
- void set_beta(float beta)
- {
- d_beta = beta;
- }
+ * Return the derivative filter taps as a formatted string for printing
+ */
+ std::string get_diff_taps_as_string();
+
+
+ /*******************************************************************
+ SET FUNCTIONS
+ *******************************************************************/
+
+
+ /*!
+ * \brief Set the loop bandwidth
+ *
+ * Set the loop filter's bandwidth to \p bw. This should be between
+ * 2*pi/200 and 2*pi/100 (in rads/samp). It must also be a positive
+ * number.
+ *
+ * When a new damping factor is set, the gains, alpha and beta, of the loop
+ * are recalculated by a call to update_gains().
+ *
+ * \param bw (float) new bandwidth
+ *
+ */
+ void set_loop_bandwidth(float bw);
+
+ /*!
+ * \brief Set the loop damping factor
+ *
+ * Set the loop filter's damping factor to \p df. The damping factor
+ * should be sqrt(2)/2.0 for critically damped systems.
+ * Set it to anything else only if you know what you are doing. It must
+ * be a number between 0 and 1.
+ *
+ * When a new damping factor is set, the gains, alpha and beta, of the loop
+ * are recalculated by a call to update_gains().
+ *
+ * \param df (float) new damping factor
+ *
+ */
+ void set_damping_factor(float df);
+
+ /*!
+ * \brief Set the loop gain alpha
+ *
+ * Set's the loop filter's alpha gain parameter.
+ *
+ * This value should really only be set by adjusting the loop bandwidth
+ * and damping factor.
+ *
+ * \param alpha (float) new alpha gain
+ *
+ */
+ void set_alpha(float alpha);
+
+ /*!
+ * \brief Set the loop gain beta
+ *
+ * Set's the loop filter's beta gain parameter.
+ *
+ * This value should really only be set by adjusting the loop bandwidth
+ * and damping factor.
+ *
+ * \param beta (float) new beta gain
+ *
+ */
+ void set_beta(float beta);
/*!
* Set the maximum deviation from 0 d_rate can have
@@ -214,6 +304,38 @@ public:
d_max_dev = m;
}
+ /*******************************************************************
+ GET FUNCTIONS
+ *******************************************************************/
+
+ /*!
+ * \brief Returns the loop bandwidth
+ */
+ float get_loop_bandwidth() const;
+
+ /*!
+ * \brief Returns the loop damping factor
+ */
+ float get_damping_factor() const;
+
+ /*!
+ * \brief Returns the loop gain alpha
+ */
+ float get_alpha() const;
+
+ /*!
+ * \brief Returns the loop gain beta
+ */
+ float get_beta() const;
+
+ /*!
+ * \brief Returns the current clock rate
+ */
+ float get_clock_rate() const;
+
+ /*******************************************************************
+ *******************************************************************/
+
bool check_topology(int ninputs, int noutputs);
int general_work (int noutput_items,
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.i b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.i
index 197984287..92ad1661a 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.i
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_ccf.i
@@ -22,20 +22,22 @@
GR_SWIG_BLOCK_MAGIC(gr,pfb_clock_sync_ccf);
-gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain,
+gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size=32,
float init_phase=0,
- float max_rate_deviation=1.5);
+ float max_rate_deviation=1.5,
+ int osps=1);
class gr_pfb_clock_sync_ccf : public gr_block
{
private:
- gr_pfb_clock_sync_ccf (double sps, float gain,
+ gr_pfb_clock_sync_ccf (double sps, float loop_bw,
const std::vector<float> &taps,
unsigned int filter_size,
float init_phase,
- float max_rate_deviation);
+ float max_rate_deviation,
+ int osps);
public:
~gr_pfb_clock_sync_ccf ();
@@ -44,11 +46,22 @@ class gr_pfb_clock_sync_ccf : public gr_block
std::vector< std::vector<float> > &ourtaps,
std::vector<gr_fir_ccf*> &ourfilter);
- std::vector<float> channel_taps(int channel);
- std::vector<float> diff_channel_taps(int channel);
- void print_taps();
- void print_diff_taps();
+ std::vector< std::vector<float> > get_taps();
+ std::vector< std::vector<float> > get_diff_taps();
+ std::vector<float> get_channel_taps(int channel);
+ std::vector<float> get_diff_channel_taps(int channel);
+ std::string get_taps_as_string();
+ std::string get_diff_taps_as_string();
+
+ void set_loop_bandwidth(float bw);
+ void set_damping_factor(float df);
void set_alpha(float alpha);
void set_beta(float beta);
void set_max_rate_deviation(float m);
+
+ float get_loop_bandwidth() const;
+ float get_damping_factor() const;
+ float get_alpha() const;
+ float get_beta() const;
+ float get_clock_rate() const;
};
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h
index fa1279a7c..d7c646801 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_clock_sync_fff.h
@@ -42,71 +42,85 @@ class gr_fir_fff;
* \brief Timing synchronizer using polyphase filterbanks
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*
- * This block performs timing synchronization for PAM signals by minimizing the
- * derivative of the filtered signal, which in turn maximizes the SNR and
- * minimizes ISI.
+ * This block performs timing synchronization for PAM signals by
+ * minimizing the derivative of the filtered signal, which in turn
+ * maximizes the SNR and minimizes ISI.
*
- * This approach works by setting up two filterbanks; one filterbanke contains the
- * signal's pulse shaping matched filter (such as a root raised cosine filter),
- * where each branch of the filterbank contains a different phase of the filter.
- * The second filterbank contains the derivatives of the filters in the first
- * filterbank. Thinking of this in the time domain, the first filterbank contains
- * filters that have a sinc shape to them. We want to align the output signal to
- * be sampled at exactly the peak of the sinc shape. The derivative of the sinc
- * contains a zero at the maximum point of the sinc (sinc(0) = 1, sinc(0)' = 0).
- * Furthermore, the region around the zero point is relatively linear. We make
- * use of this fact to generate the error signal.
+ * This approach works by setting up two filterbanks; one filterbanke
+ * contains the signal's pulse shaping matched filter (such as a root
+ * raised cosine filter), where each branch of the filterbank contains
+ * a different phase of the filter. The second filterbank contains
+ * the derivatives of the filters in the first filterbank. Thinking of
+ * this in the time domain, the first filterbank contains filters that
+ * have a sinc shape to them. We want to align the output signal to be
+ * sampled at exactly the peak of the sinc shape. The derivative of
+ * the sinc contains a zero at the maximum point of the sinc (sinc(0)
+ * = 1, sinc(0)' = 0). Furthermore, the region around the zero point
+ * is relatively linear. We make use of this fact to generate the
+ * error signal.
*
- * If the signal out of the derivative filters is d_i[n] for the ith filter, and
- * the output of the matched filter is x_i[n], we calculate the error as:
- * e[n] = (Re{x_i[n]} * Re{d_i[n]} + Im{x_i[n]} * Im{d_i[n]}) / 2.0
- * This equation averages the error in the real and imaginary parts. There are two
- * reasons we multiply by the signal itself. First, if the symbol could be positive
- * or negative going, but we want the error term to always tell us to go in the
- * same direction depending on which side of the zero point we are on. The sign of
- * x_i[n] adjusts the error term to do this. Second, the magnitude of x_i[n] scales
- * the error term depending on the symbol's amplitude, so larger signals give us
- * a stronger error term because we have more confidence in that symbol's value.
- * Using the magnitude of x_i[n] instead of just the sign is especially good for
- * signals with low SNR.
+ * If the signal out of the derivative filters is d_i[n] for the ith
+ * filter, and the output of the matched filter is x_i[n], we
+ * calculate the error as: e[n] = (Re{x_i[n]} * Re{d_i[n]} +
+ * Im{x_i[n]} * Im{d_i[n]}) / 2.0 This equation averages the error in
+ * the real and imaginary parts. There are two reasons we multiply by
+ * the signal itself. First, if the symbol could be positive or
+ * negative going, but we want the error term to always tell us to go
+ * in the same direction depending on which side of the zero point we
+ * are on. The sign of x_i[n] adjusts the error term to do
+ * this. Second, the magnitude of x_i[n] scales the error term
+ * depending on the symbol's amplitude, so larger signals give us a
+ * stronger error term because we have more confidence in that
+ * symbol's value. Using the magnitude of x_i[n] instead of just the
+ * sign is especially good for signals with low SNR.
*
- * The error signal, e[n], gives us a value proportional to how far away from the zero
- * point we are in the derivative signal. We want to drive this value to zero, so we
- * set up a second order loop. We have two variables for this loop; d_k is the filter
- * number in the filterbank we are on and d_rate is the rate which we travel through
- * the filters in the steady state. That is, due to the natural clock differences between
- * the transmitter and receiver, d_rate represents that difference and would traverse
- * the filter phase paths to keep the receiver locked. Thinking of this as a second-order
- * PLL, the d_rate is the frequency and d_k is the phase. So we update d_rate and d_k
- * using the standard loop equations based on two error signals, d_alpha and d_beta.
- * We have these two values set based on each other for a critically damped system, so in
- * the block constructor, we just ask for "gain," which is d_alpha while d_beta is
- * equal to (gain^2)/4.
+ * The error signal, e[n], gives us a value proportional to how far
+ * away from the zero point we are in the derivative signal. We want
+ * to drive this value to zero, so we set up a second order loop. We
+ * have two variables for this loop; d_k is the filter number in the
+ * filterbank we are on and d_rate is the rate which we travel through
+ * the filters in the steady state. That is, due to the natural clock
+ * differences between the transmitter and receiver, d_rate represents
+ * that difference and would traverse the filter phase paths to keep
+ * the receiver locked. Thinking of this as a second-order PLL, the
+ * d_rate is the frequency and d_k is the phase. So we update d_rate
+ * and d_k using the standard loop equations based on two error
+ * signals, d_alpha and d_beta. We have these two values set based on
+ * each other for a critically damped system, so in the block
+ * constructor, we just ask for "gain," which is d_alpha while d_beta
+ * is equal to (gain^2)/4.
*
- * The clock sync block needs to know the number of samples per second (sps), because it
- * only returns a single point representing the sample. The sps can be any positive real
- * number and does not need to be an integer. The filter taps must also be specified. The
- * taps are generated by first conceiving of the prototype filter that would be the signal's
- * matched filter. Then interpolate this by the number of filters in the filterbank. These
- * are then distributed among all of the filters. So if the prototype filter was to have
- * 45 taps in it, then each path of the filterbank will also have 45 taps. This is easily
- * done by building the filter with the sample rate multiplied by the number of filters
- * to use.
+ * The clock sync block needs to know the number of samples per second
+ * (sps), because it only returns a single point representing the
+ * sample. The sps can be any positive real number and does not need
+ * to be an integer. The filter taps must also be specified. The taps
+ * are generated by first conceiving of the prototype filter that
+ * would be the signal's matched filter. Then interpolate this by the
+ * number of filters in the filterbank. These are then distributed
+ * among all of the filters. So if the prototype filter was to have 45
+ * taps in it, then each path of the filterbank will also have 45
+ * taps. This is easily done by building the filter with the sample
+ * rate multiplied by the number of filters to use.
*
- * The number of filters can also be set and defaults to 32. With 32 filters, you get a
- * good enough resolution in the phase to produce very small, almost unnoticeable, ISI.
- * Going to 64 filters can reduce this more, but after that there is very little gained
- * for the extra complexity.
+ * The number of filters can also be set and defaults to 32. With 32
+ * filters, you get a good enough resolution in the phase to produce
+ * very small, almost unnoticeable, ISI. Going to 64 filters can
+ * reduce this more, but after that there is very little gained for
+ * the extra complexity.
*
- * The initial phase is another settable parameter and refers to the filter path the
- * algorithm initially looks at (i.e., d_k starts at init_phase). This value defaults
- * to zero, but it might be useful to start at a different phase offset, such as the mid-
- * point of the filters.
+ * The initial phase is another settable parameter and refers to the
+ * filter path the algorithm initially looks at (i.e., d_k starts at
+ * init_phase). This value defaults to zero, but it might be useful to
+ * start at a different phase offset, such as the mid- point of the
+ * filters.
*
- * The final parameter is the max_rate_devitation, which defaults to 1.5. This is how far
- * we allow d_rate to swing, positive or negative, from 0. Constraining the rate can help
- * keep the algorithm from walking too far away to lock during times when there is no signal.
+ * The final parameter is the max_rate_devitation, which defaults to
+ * 1.5. This is how far we allow d_rate to swing, positive or
+ * negative, from 0. Constraining the rate can help keep the algorithm
+ * from walking too far away to lock during times when there is no
+ * signal.
*
*/
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
index 200adee3d..6b75c5859 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_decimator_ccf.h
@@ -41,6 +41,7 @@ class gri_fft_complex;
* input, gr_complex output and float taps
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*
* This block takes in a signal stream and performs interger down-
* sampling (decimation) with a polyphase filterbank. The first input
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.h
index d2efc591a..3dc52938e 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_interpolator_ccf.h
@@ -39,6 +39,7 @@ class gr_fir_ccf;
* gr_complex output and float taps
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*
* This block takes in a signal stream and performs interger up-
* sampling (interpolation) with a polyphase filterbank. The first
diff --git a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h
index f5b1cbb94..7e3700921 100644
--- a/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h
+++ b/gnuradio-core/src/lib/filter/gr_pfb_synthesis_filterbank_ccf.h
@@ -42,6 +42,7 @@ class gri_fft_complex;
* gr_complex input, gr_complex output and float taps
*
* \ingroup filter_blk
+ * \ingroup pfb_blk
*/
class gr_pfb_synthesis_filterbank_ccf : public gr_sync_interpolator
diff --git a/gnuradio-core/src/lib/g72x/.gitignore b/gnuradio-core/src/lib/g72x/.gitignore
deleted file mode 100644
index a02b6ff73..000000000
--- a/gnuradio-core/src/lib/g72x/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am
index 15272dd5c..e389e05e1 100644
--- a/gnuradio-core/src/lib/general/Makefile.am
+++ b/gnuradio-core/src/lib/general/Makefile.am
@@ -44,24 +44,18 @@ libgeneral_la_SOURCES = \
gr_agc2_ff.cc \
gr_align_on_samplenumbers_ss.cc \
gr_bin_statistics_f.cc \
- gr_binary_slicer_fb.cc \
gr_bytes_to_syms.cc \
gr_char_to_float.cc \
gr_check_counting_s.cc \
gr_check_lfsr_32k_s.cc \
gr_circular_file.cc \
- gr_clock_recovery_mm_cc.cc \
- gr_clock_recovery_mm_ff.cc \
gr_complex_to_interleaved_short.cc \
gr_complex_to_xxx.cc \
gr_conjugate_cc.cc \
gr_copy.cc \
- gr_constellation_decoder_cb.cc \
- gr_correlate_access_code_bb.cc \
- gr_costas_loop_cc.cc \
gr_count_bits.cc \
gr_cpfsk_bc.cc \
- gr_crc32.cc \
+ gr_cpm.cc \
gr_ctcss_squelch_ff.cc \
gr_decode_ccsds_27_fb.cc \
gr_deinterleave.cc \
@@ -79,7 +73,6 @@ libgeneral_la_SOURCES = \
gr_fft_vcc_fftw.cc \
gr_fft_vfc.cc \
gr_firdes.cc \
- gr_fll_band_edge_cc.cc \
gr_float_to_char.cc \
gr_float_to_complex.cc \
gr_float_to_short.cc \
@@ -97,11 +90,8 @@ libgeneral_la_SOURCES = \
gr_keep_one_in_n.cc \
gr_kludge_copy.cc \
gr_lfsr_32k_source_s.cc \
- gr_lms_dfe_cc.cc \
- gr_lms_dfe_ff.cc \
gr_map_bb.cc \
gr_misc.cc \
- gr_mpsk_receiver_cc.cc \
gr_nlog10_ff.cc \
gr_nop.cc \
gr_null_sink.cc \
@@ -164,6 +154,7 @@ libgeneral_la_SOURCES = \
gr_wvps_ff.cc \
gri_add_const_ss_generic.cc \
gri_char_to_float.cc \
+ gri_control_loop.cc \
gri_debugger_hook.cc \
gri_fft.cc \
gri_float_to_char.cc \
@@ -187,6 +178,7 @@ libgeneral_la_SOURCES = \
libgeneral_qa_la_SOURCES = \
qa_general.cc \
qa_gr_circular_file.cc \
+ qa_gr_cpm.cc \
qa_gr_firdes.cc \
qa_gr_fxpt.cc \
qa_gr_fxpt_nco.cc \
@@ -203,24 +195,18 @@ grinclude_HEADERS = \
gr_agc2_ff.h \
gr_align_on_samplenumbers_ss.h \
gr_bin_statistics_f.h \
- gr_binary_slicer_fb.h \
gr_bytes_to_syms.h \
gr_char_to_float.h \
gr_check_counting_s.h \
gr_check_lfsr_32k_s.h \
gr_circular_file.h \
- gr_clock_recovery_mm_cc.h \
- gr_clock_recovery_mm_ff.h \
gr_complex_to_interleaved_short.h \
gr_complex_to_xxx.h \
gr_conjugate_cc.h \
- gr_constellation_decoder_cb.h \
gr_copy.h \
- gr_correlate_access_code_bb.h \
- gr_costas_loop_cc.h \
gr_count_bits.h \
gr_cpfsk_bc.h \
- gr_crc32.h \
+ gr_cpm.h \
gr_ctcss_squelch_ff.h \
gr_decode_ccsds_27_fb.h \
gr_diff_decoder_bb.h \
@@ -238,7 +224,6 @@ grinclude_HEADERS = \
gr_fft_vcc_fftw.h \
gr_fft_vfc.h \
gr_firdes.h \
- gr_fll_band_edge_cc.h \
gr_float_to_char.h \
gr_float_to_complex.h \
gr_float_to_short.h \
@@ -258,13 +243,10 @@ grinclude_HEADERS = \
gr_keep_one_in_n.h \
gr_kludge_copy.h \
gr_lfsr_32k_source_s.h \
- gr_lms_dfe_cc.h \
- gr_lms_dfe_ff.h \
gr_log2_const.h \
gr_map_bb.h \
gr_math.h \
gr_misc.h \
- gr_mpsk_receiver_cc.h \
gr_nco.h \
gr_nlog10_ff.h \
gr_nop.h \
@@ -335,6 +317,7 @@ grinclude_HEADERS = \
gri_agc2_cc.h \
gri_agc2_ff.h \
gri_char_to_float.h \
+ gri_control_loop.h \
gri_debugger_hook.h \
gri_fft.h \
gri_float_to_char.h \
@@ -362,6 +345,7 @@ grinclude_HEADERS = \
noinst_HEADERS = \
qa_general.h \
qa_gr_circular_file.h \
+ qa_gr_cpm.h \
qa_gr_firdes.h \
qa_gr_fxpt.h \
qa_gr_fxpt_nco.h \
@@ -380,22 +364,16 @@ swiginclude_HEADERS = \
gr_agc2_ff.i \
gr_align_on_samplenumbers_ss.i \
gr_bin_statistics_f.i \
- gr_binary_slicer_fb.i \
gr_bytes_to_syms.i \
gr_char_to_float.i \
gr_check_counting_s.i \
gr_check_lfsr_32k_s.i \
- gr_clock_recovery_mm_cc.i \
- gr_clock_recovery_mm_ff.i \
gr_complex_to_interleaved_short.i \
gr_complex_to_xxx.i \
gr_conjugate_cc.i \
- gr_constellation_decoder_cb.i \
gr_copy.i \
- gr_correlate_access_code_bb.i \
- gr_costas_loop_cc.i \
gr_cpfsk_bc.i \
- gr_crc32.i \
+ gr_cpm.i \
gr_ctcss_squelch_ff.i \
gr_decode_ccsds_27_fb.i \
gr_diff_decoder_bb.i \
@@ -411,7 +389,6 @@ swiginclude_HEADERS = \
gr_fft_vcc.i \
gr_fft_vfc.i \
gr_firdes.i \
- gr_fll_band_edge_cc.i \
gr_float_to_char.i \
gr_float_to_complex.i \
gr_float_to_short.i \
@@ -429,10 +406,7 @@ swiginclude_HEADERS = \
gr_keep_one_in_n.i \
gr_kludge_copy.i \
gr_lfsr_32k_source_s.i \
- gr_lms_dfe_cc.i \
- gr_lms_dfe_ff.i \
gr_map_bb.i \
- gr_mpsk_receiver_cc.i \
gr_nlog10_ff.i \
gr_nop.i \
gr_null_sink.i \
@@ -495,6 +469,7 @@ swiginclude_HEADERS = \
gri_agc_ff.i \
gri_agc2_cc.i \
gri_agc2_ff.i \
+ gri_control_loop.i \
gr_descrambler_bb.i \
gr_scrambler_bb.i \
gr_probe_mpsk_snr_c.i \
diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i
index fd158cd1f..107f5c9ea 100644
--- a/gnuradio-core/src/lib/general/general.i
+++ b/gnuradio-core/src/lib/general/general.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
+ * Copyright 2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -22,6 +22,7 @@
%{
+#include <gri_control_loop.h>
#include <gr_nop.h>
#include <gr_null_sink.h>
#include <gr_null_source.h>
@@ -69,7 +70,6 @@
#include <gr_nlog10_ff.h>
#include <gr_fake_channel_coder_pp.h>
#include <gr_throttle.h>
-#include <gr_mpsk_receiver_cc.h>
#include <gr_stream_mux.h>
#include <gr_stream_to_streams.h>
#include <gr_streams_to_stream.h>
@@ -77,13 +77,8 @@
#include <gr_vector_to_streams.h>
#include <gr_conjugate_cc.h>
#include <gr_vco_f.h>
-#include <gr_crc32.h>
#include <gr_threshold_ff.h>
-#include <gr_clock_recovery_mm_ff.h>
-#include <gr_clock_recovery_mm_cc.h>
#include <gr_packet_sink.h>
-#include <gr_lms_dfe_cc.h>
-#include <gr_lms_dfe_ff.h>
#include <gr_dpll_bb.h>
#include <gr_fmdet_cf.h>
#include <gr_pll_freqdet_cf.h>
@@ -98,10 +93,10 @@
#include <gr_ofdm_cyclic_prefixer.h>
#include <gr_ofdm_mapper_bcv.h>
#include <gr_ofdm_frame_sink.h>
+ //#include <gr_ofdm_frame_sink2.h>
#include <gr_ofdm_insert_preamble.h>
#include <gr_ofdm_sampler.h>
#include <gr_regenerate_bb.h>
-#include <gr_costas_loop_cc.h>
#include <gr_pa_2x2_phase_combiner.h>
#include <gr_kludge_copy.h>
#include <gr_prefs.h>
@@ -109,10 +104,7 @@
#include <gr_test_types.h>
#include <gr_test.h>
#include <gr_unpack_k_bits_bb.h>
-#include <gr_correlate_access_code_bb.h>
#include <gr_diff_phasor_cc.h>
-#include <gr_constellation_decoder_cb.h>
-#include <gr_binary_slicer_fb.h>
#include <gr_diff_encoder_bb.h>
#include <gr_diff_decoder_bb.h>
#include <gr_framer_sink_1.h>
@@ -140,15 +132,16 @@
#include <gr_wavelet_ff.h>
#include <gr_wvps_ff.h>
#include <gr_copy.h>
-#include <gr_fll_band_edge_cc.h>
#include <gr_additive_scrambler_bb.h>
#include <complex_vec_test.h>
#include <gr_annotator_alltoall.h>
#include <gr_annotator_1to1.h>
#include <gr_burst_tagger.h>
+#include <gr_cpm.h>
#include <gr_correlate_access_code_tag_bb.h>
%}
+%include "gri_control_loop.i"
%include "gr_nop.i"
%include "gr_null_sink.i"
%include "gr_null_source.i"
@@ -196,7 +189,6 @@
%include "gr_nlog10_ff.i"
%include "gr_fake_channel_coder_pp.i"
%include "gr_throttle.i"
-%include "gr_mpsk_receiver_cc.i"
%include "gr_stream_mux.i"
%include "gr_stream_to_streams.i"
%include "gr_streams_to_stream.i"
@@ -204,13 +196,8 @@
%include "gr_vector_to_streams.i"
%include "gr_conjugate_cc.i"
%include "gr_vco_f.i"
-%include "gr_crc32.i"
%include "gr_threshold_ff.i"
-%include "gr_clock_recovery_mm_ff.i"
-%include "gr_clock_recovery_mm_cc.i"
%include "gr_packet_sink.i"
-%include "gr_lms_dfe_cc.i"
-%include "gr_lms_dfe_ff.i"
%include "gr_dpll_bb.i"
%include "gr_fmdet_cf.i"
%include "gr_pll_freqdet_cf.i"
@@ -225,10 +212,10 @@
%include "gr_ofdm_cyclic_prefixer.i"
%include "gr_ofdm_mapper_bcv.i"
%include "gr_ofdm_frame_sink.i"
+ //%include "gr_ofdm_frame_sink2.i"
%include "gr_ofdm_insert_preamble.i"
%include "gr_ofdm_sampler.i"
%include "gr_regenerate_bb.i"
-%include "gr_costas_loop_cc.i"
%include "gr_pa_2x2_phase_combiner.i"
%include "gr_kludge_copy.i"
%include "gr_prefs.i"
@@ -236,10 +223,7 @@
%include "gr_test_types.h"
%include "gr_test.i"
%include "gr_unpack_k_bits_bb.i"
-%include "gr_correlate_access_code_bb.i"
%include "gr_diff_phasor_cc.i"
-%include "gr_constellation_decoder_cb.i"
-%include "gr_binary_slicer_fb.i"
%include "gr_diff_encoder_bb.i"
%include "gr_diff_decoder_bb.i"
%include "gr_framer_sink_1.i"
@@ -267,10 +251,10 @@
%include "gr_wavelet_ff.i"
%include "gr_wvps_ff.i"
%include "gr_copy.i"
-%include "gr_fll_band_edge_cc.i"
%include "gr_additive_scrambler_bb.i"
%include "complex_vec_test.i"
%include "gr_annotator_alltoall.i"
%include "gr_annotator_1to1.i"
%include "gr_burst_tagger.i"
+%include "gr_cpm.i"
%include "gr_correlate_access_code_tag_bb.i"
diff --git a/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.cc b/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.cc
deleted file mode 100644
index 5b87f1430..000000000
--- a/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.cc
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 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 <gr_constellation_decoder_cb.h>
-#include <gr_io_signature.h>
-#include <stdexcept>
-
-#include <cstdio>
-#include <iostream>
-using std::cout;
-using std::endl;
-
-static const bool compute_EVM = false;
-
-gr_constellation_decoder_cb_sptr
-gr_make_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out)
-{
- return gr_constellation_decoder_cb_sptr
- (new gr_constellation_decoder_cb(sym_position, sym_value_out));
-}
-
-gr_constellation_decoder_cb::
-gr_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out)
- : gr_sync_block ("constellation_decoder_cb",
- gr_make_io_signature (1, 1, sizeof (gr_complex)),
- gr_make_io_signature (1, 1, sizeof (unsigned char)))
-{
- if (!set_constellation(sym_position,sym_value_out))
- throw std::invalid_argument("constellation_decoder_cb");
-}
-
-
-gr_constellation_decoder_cb::~gr_constellation_decoder_cb(){}
-
-
-bool
-gr_constellation_decoder_cb::set_constellation(const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out)
-{
- if (sym_position.size() != sym_value_out.size())
- return false;
-
- if (sym_position.size()<1)
- return false;
-
- d_sym_position = sym_position;
- d_sym_value_out = sym_value_out;
- return true;
-}
-
-
-int
-gr_constellation_decoder_cb::work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- gr_complex const *in = (const gr_complex *) input_items[0];
- unsigned char *out = (unsigned char *) output_items[0];
- unsigned int table_size = d_sym_value_out.size();
- unsigned int min_index = 0;
- float min_euclid_dist = 0;
- float euclid_dist = 0;
- double total_error = 0;
-
- for(int i = 0; i < noutput_items; i++){
- min_euclid_dist = norm(in[i] - d_sym_position[0]);
- min_index = 0;
- for (unsigned int j = 1; j < table_size; j++){
- euclid_dist = norm(in[i] - d_sym_position[j]);
- if (euclid_dist < min_euclid_dist){
- min_euclid_dist = euclid_dist;
- min_index = j;
- }
- }
-
- out[i] = d_sym_value_out[min_index];
-
- if (compute_EVM)
- total_error += sqrtf(min_euclid_dist);
- }
-
- if (compute_EVM){
- double mean = total_error / noutput_items;
- double rms = sqrt(mean * mean);
- fprintf(stderr, "EVM = %8.4f\n", rms);
- }
-
- return noutput_items;
-}
diff --git a/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.h b/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.h
deleted file mode 100644
index fd7079c12..000000000
--- a/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 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_GR_CONSTELLATION_DECODER_CB_H
-#define INCLUDED_GR_CONSTELLATION_DECODER_CB_H
-
-#include <gr_sync_block.h>
-#include <vector>
-
-class gr_constellation_decoder_cb;
-typedef boost::shared_ptr<gr_constellation_decoder_cb> gr_constellation_decoder_cb_sptr;
-
-gr_constellation_decoder_cb_sptr
- gr_make_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out);
-
-/*!
- * \brief Constellation Decoder
- * \ingroup coding_blk
- *
- */
-class gr_constellation_decoder_cb : public gr_sync_block
-{
-
- private:
- std::vector<gr_complex> d_sym_position;
- std::vector<unsigned char> d_sym_value_out;
-
- friend gr_constellation_decoder_cb_sptr
- gr_make_constellation_decoder_cb (const std::vector<gr_complex> &sym_position, const std::vector<unsigned char> &sym_value_out);
-
- gr_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out); //constructor
-
- public:
- bool set_constellation(const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out);
-
- ~gr_constellation_decoder_cb(); //destructor
-
- int work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif
diff --git a/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.i b/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.i
deleted file mode 100644
index 8d9c9b56e..000000000
--- a/gnuradio-core/src/lib/general/gr_constellation_decoder_cb.i
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006 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.
- */
-
-GR_SWIG_BLOCK_MAGIC(gr,constellation_decoder_cb)
-
-gr_constellation_decoder_cb_sptr
- gr_make_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out);
-
-class gr_constellation_decoder_cb : public gr_sync_block
-{
- private:
- gr_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out);
-
- friend gr_constellation_decoder_cb_sptr
- gr_make_constellation_decoder_cb (const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out);
-
- public:
- int set_constellation(const std::vector<gr_complex> &sym_position,
- const std::vector<unsigned char> &sym_value_out);
- ~gr_constellation_decoder_cb();
-};
diff --git a/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc b/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc
deleted file mode 100644
index f3bfd0951..000000000
--- a/gnuradio-core/src/lib/general/gr_costas_loop_cc.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2006,2010 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 <gr_costas_loop_cc.h>
-#include <gr_io_signature.h>
-#include <gr_expj.h>
-#include <gr_sincos.h>
-#include <math.h>
-
-#define M_TWOPI (2*M_PI)
-
-gr_costas_loop_cc_sptr
-gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument)
-{
- return gnuradio::get_initial_sptr(new gr_costas_loop_cc (alpha, beta,
- max_freq, min_freq,
- order));
-}
-
-gr_costas_loop_cc::gr_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument)
- : gr_sync_block ("costas_loop_cc",
- gr_make_io_signature (1, 1, sizeof (gr_complex)),
- gr_make_io_signature (1, 2, sizeof (gr_complex))),
- d_alpha(alpha), d_beta(beta),
- d_max_freq(max_freq), d_min_freq(min_freq),
- d_phase(0), d_freq((max_freq+min_freq)/2),
- d_order(order), d_phase_detector(0)
-{
- switch(d_order) {
- case 2:
- d_phase_detector = &gr_costas_loop_cc::phase_detector_2;
- break;
-
- case 4:
- d_phase_detector = &gr_costas_loop_cc::phase_detector_4;
- break;
-
- default:
- throw std::invalid_argument("order must be 2 or 4");
- break;
- }
-}
-
-
-float
-gr_costas_loop_cc::phase_detector_4(gr_complex sample) const
-{
-
- return ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() -
- (sample.imag()>0 ? 1.0 : -1.0) * sample.real());
-}
-
-float
-gr_costas_loop_cc::phase_detector_2(gr_complex sample) const
-{
- return (sample.real()*sample.imag());
-}
-
-void
-gr_costas_loop_cc::set_alpha(float alpha)
-{
- d_alpha = alpha;
-}
-
-void
-gr_costas_loop_cc::set_beta(float beta)
-{
- d_beta = beta;
-}
-
-int
-gr_costas_loop_cc::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- const gr_complex *iptr = (gr_complex *) input_items[0];
- gr_complex *optr = (gr_complex *) output_items[0];
- gr_complex *foptr = (gr_complex *) output_items[1];
-
- bool write_foptr = output_items.size() >= 2;
-
- float error;
- gr_complex nco_out;
-
- if (write_foptr) {
-
- for (int i = 0; i < noutput_items; i++){
- nco_out = gr_expj(-d_phase);
- optr[i] = iptr[i] * nco_out;
-
- error = (*this.*d_phase_detector)(optr[i]);
- if (error > 1)
- error = 1;
- else if (error < -1)
- error = -1;
-
- d_freq = d_freq + d_beta * error;
- d_phase = d_phase + d_freq + d_alpha * error;
-
- while(d_phase>M_TWOPI)
- d_phase -= M_TWOPI;
- while(d_phase<-M_TWOPI)
- d_phase += M_TWOPI;
-
- if (d_freq > d_max_freq)
- d_freq = d_max_freq;
- else if (d_freq < d_min_freq)
- d_freq = d_min_freq;
-
- foptr[i] = gr_complex(d_freq,0);
- }
- } else {
- for (int i = 0; i < noutput_items; i++){
- nco_out = gr_expj(-d_phase);
- optr[i] = iptr[i] * nco_out;
-
- error = (*this.*d_phase_detector)(optr[i]);
- if (error > 1)
- error = 1;
- else if (error < -1)
- error = -1;
-
- d_freq = d_freq + d_beta * error;
- d_phase = d_phase + d_freq + d_alpha * error;
-
- while(d_phase>M_TWOPI)
- d_phase -= M_TWOPI;
- while(d_phase<-M_TWOPI)
- d_phase += M_TWOPI;
-
- if (d_freq > d_max_freq)
- d_freq = d_max_freq;
- else if (d_freq < d_min_freq)
- d_freq = d_min_freq;
-
- }
- }
- return noutput_items;
-}
diff --git a/gnuradio-core/src/lib/general/gr_cpm.cc b/gnuradio-core/src/lib/general/gr_cpm.cc
new file mode 100644
index 000000000..a00526b52
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_cpm.cc
@@ -0,0 +1,214 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * 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.
+ */
+
+// Calculate the taps for the CPM phase responses
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <cmath>
+#include <cfloat>
+#include <gr_cpm.h>
+
+#ifndef M_TWOPI
+# define M_TWOPI (2*M_PI)
+#endif
+
+//! Normalised sinc function, sinc(x)=sin(pi*x)/pi*x
+inline double
+sinc(double x)
+{
+ if (x == 0) {
+ return 1.0;
+ }
+
+ return sin(M_PI * x) / (M_PI * x);
+}
+
+
+//! Taps for L-RC CPM (Raised cosine of length L symbols)
+std::vector<float>
+generate_cpm_lrc_taps(unsigned samples_per_sym, unsigned L)
+{
+ std::vector<float> taps(samples_per_sym * L, 1.0/L/samples_per_sym);
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ taps[i] *= 1 - cos(M_TWOPI * i / L / samples_per_sym);
+ }
+
+ return taps;
+}
+
+
+/*! Taps for L-SRC CPM (Spectral raised cosine of length L symbols).
+ *
+ * L-SRC has a time-continuous phase response function of
+ *
+ * g(t) = 1/LT * sinc(2t/LT) * cos(beta * 2pi t / LT) / (1 - (4beta / LT * t)^2)
+ *
+ * which is the Fourier transform of a cos-rolloff function with rolloff
+ * beta, and looks like a sinc-function, multiplied with a rolloff term.
+ * We return the main lobe of the sinc, i.e., everything between the
+ * zero crossings.
+ * The time-discrete IR is thus
+ *
+ * g(k) = 1/Ls * sinc(2k/Ls) * cos(beta * pi k / Ls) / (1 - (4beta / Ls * k)^2)
+ * where k = 0...Ls-1
+ * and s = samples per symbol.
+ */
+std::vector<float>
+generate_cpm_lsrc_taps(unsigned samples_per_sym, unsigned L, double beta)
+{
+ double Ls = (double) L * samples_per_sym;
+ std::vector<double> taps_d(L * samples_per_sym, 0.0);
+ std::vector<float> taps(L * samples_per_sym, 0.0);
+
+ double sum = 0;
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ double k = i - Ls/2; // Causal to acausal
+
+ taps_d[i] = 1.0 / Ls * sinc(2.0 * k / Ls);
+
+ // For k = +/-Ls/4*beta, the rolloff term's cos-function becomes zero
+ // and the whole thing converges to PI/4 (to prove this, use de
+ // l'hopital's rule).
+ if (fabs(fabs(k) - Ls/4/beta) < 2*DBL_EPSILON) {
+ taps_d[i] *= M_PI_4;
+ } else {
+ double tmp = 4.0 * beta * k / Ls;
+ taps_d[i] *= cos(beta * M_TWOPI * k / Ls) / (1 - tmp * tmp);
+ }
+ sum += taps_d[i];
+ }
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ taps[i] = (float) taps_d[i] / sum;
+ }
+
+ return taps;
+}
+
+
+//! Taps for L-REC CPM (Rectangular pulse shape of length L symbols)
+std::vector<float>
+generate_cpm_lrec_taps(unsigned samples_per_sym, unsigned L)
+{
+ return std::vector<float>(samples_per_sym * L, 1.0/L/samples_per_sym);
+}
+
+
+//! Helper function for TFM
+double tfm_g0(double k, double sps)
+{
+ if (fabs(k) < 2 * DBL_EPSILON) {
+ return 1.145393004159143; // 1 + pi^2/48 / sqrt(2)
+ }
+
+ const double pi2_24 = 0.411233516712057; // pi^2/24
+ double f = M_PI * k / sps;
+ return sinc(k/sps) - pi2_24 * (2 * sin(f) - 2*f*cos(f) - f*f*sin(f)) / (f*f*f);
+}
+
+
+//! Taps for TFM CPM (Tamed frequency modulation)
+//
+// See [2, Chapter 2.7.2].
+//
+// [2]: Anderson, Aulin and Sundberg; Digital Phase Modulation
+std::vector<float>
+generate_cpm_tfm_taps(unsigned sps, unsigned L)
+{
+ unsigned causal_shift = sps * L / 2;
+ std::vector<double> taps_d(sps * L, 0.0);
+ std::vector<float> taps(sps * L, 0.0);
+
+ double sum = 0;
+ for (unsigned i = 0; i < sps * L; i++) {
+ double k = (double)(((int)i) - ((int)causal_shift)); // Causal to acausal
+
+ taps_d[i] = tfm_g0(k - sps, sps) +
+ 2 * tfm_g0(k, sps) +
+ tfm_g0(k + sps, sps);
+ sum += taps_d[i];
+ }
+ for (unsigned i = 0; i < sps * L; i++) {
+ taps[i] = (float) taps_d[i] / sum;
+ }
+
+ return taps;
+}
+
+
+//! Taps for Gaussian CPM. Phase response is truncated after \p L symbols.
+// \p bt sets the 3dB-time-bandwidth product.
+//
+// Note: for h = 0.5, this is the phase response for GMSK.
+//
+// This C99-compatible formula for the taps is taken straight
+// from [1, Chapter 9.2.3].
+// A version in Q-notation can be found in [2, Chapter 2.7.2].
+//
+// [1]: Karl-Dirk Kammeyer; Nachrichtenübertragung, 4th Edition.
+// [2]: Anderson, Aulin and Sundberg; Digital Phase Modulation
+//
+std::vector<float>
+generate_cpm_gaussian_taps(unsigned samples_per_sym, unsigned L, double bt)
+{
+ double Ls = (double) L * samples_per_sym;
+ std::vector<double> taps_d(L * samples_per_sym, 0.0);
+ std::vector<float> taps(L * samples_per_sym, 0.0);
+
+ // alpha = sqrt(2/ln(2)) * pi * BT
+ double alpha = 5.336446256636997 * bt;
+ for (unsigned i = 0; i < samples_per_sym * L; i++) {
+ double k = i - Ls/2; // Causal to acausal
+ taps_d[i] = (erf(alpha * (k / samples_per_sym + 0.5)) -
+ erf(alpha * (k / samples_per_sym - 0.5)))
+ * 0.5 / samples_per_sym;
+ taps[i] = (float) taps_d[i];
+ }
+
+ return taps;
+}
+
+
+std::vector<float>
+gr_cpm::phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta)
+{
+ switch (type) {
+ case LRC:
+ return generate_cpm_lrc_taps(samples_per_sym, L);
+
+ case LSRC:
+ return generate_cpm_lsrc_taps(samples_per_sym, L, beta);
+
+ case LREC:
+ return generate_cpm_lrec_taps(samples_per_sym, L);
+
+ case TFM:
+ return generate_cpm_tfm_taps(samples_per_sym, L);
+
+ case GAUSSIAN:
+ return generate_cpm_gaussian_taps(samples_per_sym, L, beta);
+
+ default:
+ return generate_cpm_lrec_taps(samples_per_sym, 1);
+ }
+}
+
diff --git a/gnuradio-core/src/lib/general/gr_cpm.h b/gnuradio-core/src/lib/general/gr_cpm.h
new file mode 100644
index 000000000..cae6fe313
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_cpm.h
@@ -0,0 +1,80 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * 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_GR_CPM_H
+#define INCLUDED_GR_CPM_H
+
+#include <vector>
+
+class gr_cpm
+{
+ public:
+ enum cpm_type {
+ LRC,
+ LSRC,
+ LREC,
+ TFM,
+ GAUSSIAN,
+ GENERIC = 999
+ };
+
+ /*! \brief Return the taps for an interpolating FIR filter (gr_interp_fir_filter_fff).
+ *
+ * These taps represent the phase response \f$g(k)\f$ for use in a CPM modulator,
+ * see also gr_cpmmod_bc.
+ *
+ * \param type The CPM type (Rectangular, Raised Cosine, Spectral Raised Cosine,
+ * Tamed FM or Gaussian).
+ * \param samples_per_sym Samples per symbol.
+ * \param L The length of the phase response in symbols.
+ * \param beta For Spectral Raised Cosine, this is the rolloff factor. For Gaussian
+ * phase responses, this the 3dB-time-bandwidth product. For all other
+ * cases, it is ignored.
+ *
+ * Output: returns a vector of length \a K = \p samples_per_sym x \p L.
+ * This can be used directly in an interpolating FIR filter such as
+ * gr_interp_fir_filter_fff with interpolation factor \p samples_per_sym.
+ *
+ * All phase responses are normalised s.t. \f$ \sum_{k=0}^{K-1} g(k) = 1\f$; this will cause
+ * a maximum phase change of \f$ h \cdot \pi\f$ between two symbols, where \a h is the
+ * modulation index.
+ *
+ * The following phase responses can be generated:
+ * - LREC: Rectangular phase response.
+ * - LRC: Raised cosine phase response, looks like 1 - cos(x).
+ * - LSRC: Spectral raised cosine. This requires a rolloff factor beta.
+ * The phase response is the Fourier transform of raised cosine
+ * function.
+ * - TFM: Tamed frequency modulation. This scheme minimizes phase change for
+ * rapidly varying input symbols.
+ * - GAUSSIAN: A Gaussian phase response. For a modulation index h = 1/2, this
+ * results in GMSK.
+ *
+ * A short description of all these phase responses can be found in [1].
+ *
+ * [1]: Anderson, Aulin and Sundberg; Digital Phase Modulation
+ */
+ static std::vector<float>
+ phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3);
+};
+
+#endif /* INCLUDED_GR_CPM_H */
+
diff --git a/gnuradio-core/src/lib/general/gr_cpm.i b/gnuradio-core/src/lib/general/gr_cpm.i
new file mode 100644
index 000000000..f01aba34e
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_cpm.i
@@ -0,0 +1,40 @@
+/* -*- C++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+%rename(cpm) gr_cpm;
+
+class gr_cpm
+{
+ public:
+ enum cpm_type {
+ LRC,
+ LSRC,
+ LREC,
+ TFM,
+ GAUSSIAN,
+ GENERIC = 999
+ };
+
+ static std::vector<float>
+ phase_response(cpm_type type, unsigned samples_per_sym, unsigned L, double beta=0.3);
+};
+
diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc
deleted file mode 100644
index c32398e6d..000000000
--- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.cc
+++ /dev/null
@@ -1,214 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2009,2010 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 <gr_fll_band_edge_cc.h>
-#include <gr_fir_ccc.h>
-#include <gr_fir_util.h>
-#include <gri_fft.h>
-#include <gr_io_signature.h>
-#include <gr_expj.h>
-#include <gr_math.h>
-#include <cstdio>
-
-#define M_TWOPI (2*M_PI)
-
-float sinc(float x)
-{
- if(x == 0)
- return 1;
- else
- return sin(M_PI*x)/(M_PI*x);
-}
-
-
-
-gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float samps_per_sym, float rolloff,
- int filter_size, float gain_alpha, float gain_beta)
-{
- return gnuradio::get_initial_sptr(new gr_fll_band_edge_cc (samps_per_sym, rolloff,
- filter_size, gain_alpha, gain_beta));
-}
-
-
-static int ios[] = {sizeof(gr_complex), sizeof(float), sizeof(float), sizeof(gr_complex)};
-static std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int));
-gr_fll_band_edge_cc::gr_fll_band_edge_cc (float samps_per_sym, float rolloff,
- int filter_size, float alpha, float beta)
- : gr_sync_block ("fll_band_edge_cc",
- gr_make_io_signature (1, 1, sizeof(gr_complex)),
- gr_make_io_signaturev (1, 4, iosig)),
- d_alpha(alpha), d_beta(beta), d_updated (false)
-{
- // base this on the number of samples per symbol
- d_max_freq = M_TWOPI * (2.0/samps_per_sym);
- d_min_freq = -M_TWOPI * (2.0/samps_per_sym);
-
- d_freq = 0;
- d_phase = 0;
-
- set_alpha(alpha);
-
- design_filter(samps_per_sym, rolloff, filter_size);
-}
-
-gr_fll_band_edge_cc::~gr_fll_band_edge_cc ()
-{
- delete d_filter_lower;
- delete d_filter_upper;
-}
-
-void
-gr_fll_band_edge_cc::set_alpha(float alpha)
-{
- //float eta = sqrt(2.0)/2.0;
- //float theta = alpha;
- //d_alpha = (4*eta*theta) / (1.0 + 2.0*eta*theta + theta*theta);
- //d_beta = (4*theta*theta) / (1.0 + 2.0*eta*theta + theta*theta);
- d_alpha = alpha;
-}
-
-void
-gr_fll_band_edge_cc::design_filter(float samps_per_sym, float rolloff, int filter_size)
-{
- int M = rint(filter_size / samps_per_sym);
- float power = 0;
- std::vector<float> bb_taps;
- for(int i = 0; i < filter_size; i++) {
- float k = -M + i*2.0/samps_per_sym;
- float tap = sinc(rolloff*k - 0.5) + sinc(rolloff*k + 0.5);
- power += tap;
-
- bb_taps.push_back(tap);
- }
-
- int N = (bb_taps.size() - 1.0)/2.0;
- std::vector<gr_complex> taps_lower;
- std::vector<gr_complex> taps_upper;
- for(unsigned int i = 0; i < bb_taps.size(); i++) {
- float tap = bb_taps[i] / power;
-
- float k = (-N + (int)i)/(2.0*samps_per_sym);
-
- gr_complex t1 = tap * gr_expj(-2*M_PI*(1+rolloff)*k);
- gr_complex t2 = tap * gr_expj(2*M_PI*(1+rolloff)*k);
-
- taps_lower.push_back(t1);
- taps_upper.push_back(t2);
- }
-
- std::vector<gr_complex> vtaps(0, taps_lower.size());
- d_filter_upper = gr_fir_util::create_gr_fir_ccc(vtaps);
- d_filter_lower = gr_fir_util::create_gr_fir_ccc(vtaps);
-
- d_filter_lower->set_taps(taps_lower);
- d_filter_upper->set_taps(taps_upper);
-
- d_updated = true;
-
- // Set the history to ensure enough input items for each filter
- set_history(filter_size+1);
-
-}
-
-void
-gr_fll_band_edge_cc::print_taps()
-{
- unsigned int i;
- std::vector<gr_complex> taps_upper = d_filter_upper->get_taps();
- std::vector<gr_complex> taps_lower = d_filter_lower->get_taps();
-
- printf("Upper Band-edge: [");
- for(i = 0; i < taps_upper.size(); i++) {
- printf(" %.4e + %.4ej,", taps_upper[i].real(), taps_upper[i].imag());
- }
- printf("]\n\n");
-
- printf("Lower Band-edge: [");
- for(i = 0; i < taps_lower.size(); i++) {
- printf(" %.4e + %.4ej,", taps_lower[i].real(), taps_lower[i].imag());
- }
- printf("]\n\n");
-}
-
-int
-gr_fll_band_edge_cc::work (int noutput_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];
-
- float *frq = NULL;
- float *phs = NULL;
- gr_complex *err = NULL;
- if(output_items.size() > 2) {
- frq = (float *) output_items[1];
- phs = (float *) output_items[2];
- err = (gr_complex *) output_items[3];
- }
-
- if (d_updated) {
- d_updated = false;
- return 0; // history requirements may have changed.
- }
-
- int i;
- gr_complex nco_out;
- gr_complex out_upper, out_lower;
- float error;
- float avg_k = 0.1;
- for(i = 0; i < noutput_items; i++) {
- nco_out = gr_expj(d_phase);
- out[i] = in[i] * nco_out;
-
- out_upper = (d_filter_upper->filter(&out[i]));
- out_lower = (d_filter_lower->filter(&out[i]));
- error = -real((out_upper + out_lower) * conj(out_upper - out_lower));
- d_error = avg_k*error + avg_k*d_error; // average error
-
- d_freq = d_freq + d_beta * d_error;
- d_phase = d_phase + d_freq + d_alpha * d_error;
-
- if(d_phase > M_PI)
- d_phase -= M_TWOPI;
- else if(d_phase < -M_PI)
- d_phase += M_TWOPI;
-
- if (d_freq > d_max_freq)
- d_freq = d_max_freq;
- else if (d_freq < d_min_freq)
- d_freq = d_min_freq;
-
- if(output_items.size() > 2) {
- frq[i] = d_freq;
- phs[i] = d_phase;
- err[i] = d_error;
- }
- }
-
-
- return noutput_items;
-}
diff --git a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h b/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h
deleted file mode 100644
index db060793e..000000000
--- a/gnuradio-core/src/lib/general/gr_fll_band_edge_cc.h
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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.
- */
-
-
-#ifndef INCLUDED_GR_FLL_BAND_EDGE_CC_H
-#define INCLUDED_GR_FLL_BAND_EDGE_CC_H
-
-#include <gr_sync_block.h>
-
-class gr_fll_band_edge_cc;
-typedef boost::shared_ptr<gr_fll_band_edge_cc> gr_fll_band_edge_cc_sptr;
-gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float samps_per_sym, float rolloff,
- int filter_size, float alpha, float beta);
-
-class gr_fir_ccc;
-class gri_fft_complex;
-
-/*!
- * \class gr_fll_band_edge_cc
- * \brief Frequency Lock Loop using band-edge filters
- *
- * \ingroup general
- *
- * The frequency lock loop derives a band-edge filter that covers the upper and lower bandwidths
- * of a digitally-modulated signal. The bandwidth range is determined by the excess bandwidth
- * (e.g., rolloff factor) of the modulated signal. The placement in frequency of the band-edges
- * is determined by the oversampling ratio (number of samples per symbol) and the excess bandwidth.
- * The size of the filters should be fairly large so as to average over a number of symbols.
- *
- * The FLL works by filtering the upper and lower band edges into x_u(t) and x_l(t), respectively.
- * These are combined to form cc(t) = x_u(t) + x_l(t) and ss(t) = x_u(t) - x_l(t). Combining
- * these to form the signal e(t) = Re{cc(t) \\times ss(t)^*} (where ^* is the complex conjugate)
- * provides an error signal at the DC term that is directly proportional to the carrier frequency.
- * We then make a second-order loop using the error signal that is the running average of e(t).
- *
- * In theory, the band-edge filter is the derivative of the matched filter in frequency,
- * (H_be(f) = \\frac{H(f)}{df}. In practice, this comes down to a quarter sine wave at the point
- * of the matched filter's rolloff (if it's a raised-cosine, the derivative of a cosine is a sine).
- * Extend this sine by another quarter wave to make a half wave around the band-edges is equivalent
- * in time to the sum of two sinc functions. The baseband filter fot the band edges is therefore
- * derived from this sum of sincs. The band edge filters are then just the baseband signal
- * modulated to the correct place in frequency. All of these calculations are done in the
- * 'design_filter' function.
- *
- * Note: We use FIR filters here because the filters have to have a flat phase response over the
- * entire frequency range to allow their comparisons to be valid.
- */
-
-class gr_fll_band_edge_cc : public gr_sync_block
-{
- private:
- /*!
- * Build the FLL
- * \param samps_per_sym (float) Number of samples per symbol of signal
- * \param rolloff (float) Rolloff factor of signal
- * \param filter_size (int) Size (in taps) of the filter
- * \param alpha (float) Loop gain 1
- * \param beta (float) Loop gain 2
- */
- friend gr_fll_band_edge_cc_sptr gr_make_fll_band_edge_cc (float samps_per_sym, float rolloff,
- int filter_size, float alpha, float beta);
-
- float d_alpha;
- float d_beta;
- float d_max_freq;
- float d_min_freq;
-
- gr_fir_ccc* d_filter_upper;
- gr_fir_ccc* d_filter_lower;
- bool d_updated;
- float d_error;
- float d_freq;
- float d_phase;
-
- /*!
- * Build the FLL
- * \param samps_per_sym (float) number of samples per symbol
- * \param rolloff (float) Rolloff (excess bandwidth) of signal filter
- * \param filter_size (int) number of filter taps to generate
- * \param alpha (float) Alpha gain in the control loop
- * \param beta (float) Beta gain in the control loop
- */
- gr_fll_band_edge_cc(float samps_per_sym, float rolloff,
- int filter_size, float alpha, float beta);
-
-public:
- ~gr_fll_band_edge_cc ();
-
- /*!
- * Design the band-edge filter based on the number of samples per symbol,
- * filter rolloff factor, and the filter size
- * \param samps_per_sym (float) Number of samples per symbol of signal
- * \param rolloff (float) Rolloff factor of signal
- * \param filter_size (int) Size (in taps) of the filter
- */
- void design_filter(float samps_per_sym, float rolloff, int filter_size);
-
- /*!
- * Set the alpha gainvalue
- * \param alpha (float) new gain value
- */
- void set_alpha(float alpha);
-
- /*!
- * Set the beta gain value
- * \param beta (float) new gain value
- */
- void set_beta(float beta) { d_beta = beta; }
-
- /*!
- * Print the taps to screen.
- */
- void print_taps();
-
- int work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif
diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h
index 55f8412ce..385f447b7 100644
--- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h
+++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.h
@@ -48,7 +48,7 @@ class gr_frequency_modulator_fc : public gr_sync_block
public:
void set_sensitivity(float sens) { d_sensitivity = sens; }
- float get_sensitivity() { return d_sensitivity; }
+ float sensitivity() const { return d_sensitivity; }
int work (int noutput_items,
gr_vector_const_void_star &input_items,
diff --git a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i
index 04d9a41ba..7dfb82f1f 100644
--- a/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i
+++ b/gnuradio-core/src/lib/general/gr_frequency_modulator_fc.i
@@ -30,5 +30,5 @@ class gr_frequency_modulator_fc : public gr_sync_block
gr_frequency_modulator_fc (double sensitivity);
public:
void set_sensitivity(float sens) { d_sensitivity = sens; }
- float get_sensitivity() { return d_sensitivity; }
+ float sensitivity() const { return d_sensitivity; }
};
diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc b/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc
deleted file mode 100644
index 8659386d5..000000000
--- a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.cc
+++ /dev/null
@@ -1,148 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2005,2010 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 <gr_lms_dfe_cc.h>
-#include <gr_io_signature.h>
-#include <gr_misc.h>
-#include <iostream>
-
-gr_complex
-gr_lms_dfe_cc::slicer_0deg (gr_complex sample)
-{
- gr_complex out;
- if(fabs(real(sample))>fabs(imag(sample))) {
- if(real(sample) > 0)
- out = gr_complex(1,0);
- else
- out = gr_complex(-1,0);
- }
- else {
- if(imag(sample) > 0)
- out = gr_complex(0,1);
- else
- out = gr_complex(0,-1);
- }
- return out;
-}
-
-gr_complex
-gr_lms_dfe_cc::slicer_45deg (gr_complex sample)
-{
- gr_complex out;
- if(real(sample) > 0)
- out = gr_complex(1,0);
- else
- out = gr_complex(-1,0);
- if(imag(sample) > 0)
- out += gr_complex(0,1);
- else
- out += gr_complex(0,-1);
- return out;
-}
-
-gr_lms_dfe_cc_sptr
-gr_make_lms_dfe_cc (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps)
-{
- return gnuradio::get_initial_sptr(new gr_lms_dfe_cc (lambda_ff, lambda_fb,
- num_fftaps, num_fbtaps));
-}
-
-gr_lms_dfe_cc::gr_lms_dfe_cc (float lambda_ff, float lambda_fb ,
- unsigned int num_fftaps, unsigned int num_fbtaps)
- : gr_sync_block ("lms_dfe_cc",
- gr_make_io_signature (1, 1, sizeof (gr_complex)),
- gr_make_io_signature (1, 1, sizeof (gr_complex))),
- d_lambda_ff (lambda_ff), d_lambda_fb (lambda_fb),
- d_ff_delayline(gr_rounduppow2(num_fftaps)),
- d_fb_delayline(gr_rounduppow2(num_fbtaps)),
- d_ff_taps(num_fftaps),d_fb_taps(num_fbtaps),
- d_ff_index(0), d_fb_index(0)
-{
- gr_zero_vector(d_ff_taps);
- d_ff_taps [d_ff_taps.size()/2] = 1;
-
- gr_zero_vector(d_fb_taps);
- gr_zero_vector(d_ff_delayline);
- gr_zero_vector(d_fb_delayline);
-}
-
-int
-gr_lms_dfe_cc::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- const gr_complex *iptr = (const gr_complex *) input_items[0];
- gr_complex *optr = (gr_complex *) output_items[0];
-
- gr_complex acc, decision, error;
- unsigned int i;
-
- unsigned int ff_mask = d_ff_delayline.size() - 1; // size is power of 2
- unsigned int fb_mask = d_fb_delayline.size() - 1;
-
- int size = noutput_items;
- while (size-- > 0){
- acc = 0;
- d_ff_delayline[d_ff_index] = *iptr++;
-
- // Compute output
- for (i=0; i < d_ff_taps.size(); i++)
- acc += conj(d_ff_delayline[(i+d_ff_index) & ff_mask]) * d_ff_taps[i];
-
- for (i=0; i < d_fb_taps.size(); i++)
- acc -= conj(d_fb_delayline[(i+d_fb_index) & fb_mask]) * d_fb_taps[i];
-
- decision = slicer_45deg(acc);
- error = decision - acc;
-
- // Update taps
- for (i=0; i < d_ff_taps.size(); i++)
- d_ff_taps[i] += d_lambda_ff * conj(error) * d_ff_delayline[(i+d_ff_index) & ff_mask];
-
- for (i=0; i < d_fb_taps.size(); i++)
- d_fb_taps[i] -= d_lambda_fb * conj(error) * d_fb_delayline[(i+d_fb_index) & fb_mask];
-
- d_fb_index = (d_fb_index - 1) & fb_mask; // Decrement index
- d_ff_index = (d_ff_index - 1) & ff_mask; // Decrement index
-
- d_fb_delayline[d_fb_index] = decision; // Save decision in feedback
-
- *optr++ = acc; // Output decision
- }
-
- if (0){
- std::cout << "FF Taps\t";
- for(i=0;i<d_ff_taps.size();i++)
- std::cout << d_ff_taps[i] << "\t";
- std::cout << std::endl << "FB Taps\t";
- for(i=0;i<d_fb_taps.size();i++)
- std::cout << d_fb_taps[i] << "\t";
- std::cout << std::endl;
- }
-
- return noutput_items;
-}
diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.h b/gnuradio-core/src/lib/general/gr_lms_dfe_cc.h
deleted file mode 100644
index 7b3a2c84e..000000000
--- a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2005 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_GR_LMS_DFE_CC_H
-#define INCLUDED_GR_LMS_DFE_CC_H
-
-#include <gr_sync_block.h>
-
-class gr_lms_dfe_cc;
-typedef boost::shared_ptr<gr_lms_dfe_cc> gr_lms_dfe_cc_sptr;
-
-gr_lms_dfe_cc_sptr gr_make_lms_dfe_cc (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
-
-/*!
- * \brief Least-Mean-Square Decision Feedback Equalizer (complex in/out)
- * \ingroup eq_blk
- */
-class gr_lms_dfe_cc : public gr_sync_block
-{
- friend gr_lms_dfe_cc_sptr gr_make_lms_dfe_cc (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
-
- float d_lambda_ff;
- float d_lambda_fb;
- std::vector<gr_complex> d_ff_delayline;
- std::vector<gr_complex> d_fb_delayline;
- std::vector<gr_complex> d_ff_taps;
- std::vector<gr_complex> d_fb_taps;
- unsigned int d_ff_index;
- unsigned int d_fb_index;
-
- gr_lms_dfe_cc (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
- gr_complex slicer_0deg(gr_complex baud);
- gr_complex slicer_45deg(gr_complex baud);
-
- public:
-
- int work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif
diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc b/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc
deleted file mode 100644
index 8a5e22c2f..000000000
--- a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2005,2010 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 <gr_lms_dfe_ff.h>
-#include <gr_io_signature.h>
-#include <gr_misc.h>
-#include <iostream>
-
-float
-slice(float val)
-{
- if (val>0)
- return 1;
- else
- return -1;
-}
-
-gr_lms_dfe_ff_sptr
-gr_make_lms_dfe_ff (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps)
-{
- return gnuradio::get_initial_sptr(new gr_lms_dfe_ff (lambda_ff,lambda_fb,num_fftaps,num_fbtaps));
-}
-
-gr_lms_dfe_ff::gr_lms_dfe_ff (float lambda_ff, float lambda_fb ,
- unsigned int num_fftaps, unsigned int num_fbtaps)
- : gr_sync_block ("lms_dfe_ff",
- gr_make_io_signature (1, 1, sizeof (float)),
- gr_make_io_signature (1, 1, sizeof (float))),
- d_lambda_ff (lambda_ff), d_lambda_fb (lambda_fb),
- d_ff_delayline(gr_rounduppow2(num_fftaps)),
- d_fb_delayline(gr_rounduppow2(num_fbtaps)),
- d_ff_taps(num_fftaps), d_fb_taps(num_fbtaps),
- d_ff_index(0), d_fb_index(0)
-{
- gr_zero_vector(d_ff_taps);
- d_ff_taps [d_ff_taps.size()/2] = 1;
-
- gr_zero_vector(d_fb_taps);
- gr_zero_vector(d_ff_delayline);
- gr_zero_vector(d_fb_delayline);
-}
-
-int
-gr_lms_dfe_ff::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
- const float *iptr = (const float *) input_items[0];
- float *optr = (float *) output_items[0];
-
- float acc, decision, error;
- unsigned int i;
-
- unsigned int ff_mask = d_ff_delayline.size() - 1; // size is power of 2
- unsigned int fb_mask = d_fb_delayline.size() - 1;
-
- int size = noutput_items;
- while(size-- > 0) {
- acc = 0;
- d_ff_delayline[d_ff_index] = *iptr++;
-
- // Compute output
- for (i=0; i < d_ff_taps.size(); i++)
- acc += d_ff_delayline[(i+d_ff_index) & ff_mask] * d_ff_taps[i];
-
- for (i=0; i < d_fb_taps.size(); i++)
- acc -= d_fb_delayline[(i+d_fb_index) & fb_mask] * d_fb_taps[i];
-
- decision = slice(acc);
- error = decision - acc;
-
- // Update taps
- for (i=0; i < d_ff_taps.size(); i++)
- d_ff_taps[i] += d_lambda_ff * error * d_ff_delayline[(i+d_ff_index) & ff_mask];
-
- for (i=0; i < d_fb_taps.size(); i++)
- d_fb_taps[i] -= d_lambda_fb * error * d_fb_delayline[(i+d_fb_index) & fb_mask];
-
- d_fb_index = (d_fb_index - 1) & fb_mask; // Decrement index
- d_ff_index = (d_ff_index - 1) & ff_mask; // Decrement index
-
- d_fb_delayline[d_fb_index] = decision; // Save decision in feedback
-
- *optr++ = acc; // Output decision
- }
-
- if (0){
- std::cout << "FF Taps\t";
- for(i=0;i<d_ff_taps.size();i++)
- std::cout << d_ff_taps[i] << "\t";
- std::cout << std::endl << "FB Taps\t";
- for(i=0;i<d_fb_taps.size();i++)
- std::cout << d_fb_taps[i] << "\t";
- std::cout << std::endl;
- }
-
- return noutput_items;
-}
diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.h b/gnuradio-core/src/lib/general/gr_lms_dfe_ff.h
deleted file mode 100644
index dd610c470..000000000
--- a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2005 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_GR_LMS_DFE_FF_H
-#define INCLUDED_GR_LMS_DFE_FF_H
-
-#include <gr_sync_block.h>
-
-class gr_lms_dfe_ff;
-typedef boost::shared_ptr<gr_lms_dfe_ff> gr_lms_dfe_ff_sptr;
-
-gr_lms_dfe_ff_sptr gr_make_lms_dfe_ff (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
-
-/*!
- * \brief Least-Mean-Square Decision Feedback Equalizer (float in/out)
- * \ingroup eq_blk
- */
-class gr_lms_dfe_ff : public gr_sync_block
-{
- friend gr_lms_dfe_ff_sptr gr_make_lms_dfe_ff (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
-
- float d_lambda_ff;
- float d_lambda_fb;
- std::vector<float> d_ff_delayline;
- std::vector<float> d_fb_delayline;
- std::vector<float> d_ff_taps;
- std::vector<float> d_fb_taps;
- unsigned int d_ff_index;
- unsigned int d_fb_index;
-
- gr_lms_dfe_ff (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
-
- public:
-
- int work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-#endif
diff --git a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.cc b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.cc
new file mode 100644
index 000000000..40574b4e9
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.cc
@@ -0,0 +1,374 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_ofdm_frame_sink2.h>
+#include <gr_io_signature.h>
+#include <gr_expj.h>
+#include <gr_math.h>
+#include <math.h>
+#include <cstdio>
+#include <stdexcept>
+#include <iostream>
+#include <string.h>
+#include <gr_constellation.h>
+
+#define VERBOSE 0
+
+inline void
+gr_ofdm_frame_sink2::enter_search()
+{
+ if (VERBOSE)
+ fprintf(stderr, "@ enter_search\n");
+
+ d_state = STATE_SYNC_SEARCH;
+
+}
+
+inline void
+gr_ofdm_frame_sink2::enter_have_sync()
+{
+ if (VERBOSE)
+ fprintf(stderr, "@ enter_have_sync\n");
+
+ d_state = STATE_HAVE_SYNC;
+
+ // clear state of demapper
+ d_byte_offset = 0;
+ d_partial_byte = 0;
+
+ d_header = 0;
+ d_headerbytelen_cnt = 0;
+
+ // Resetting PLL
+ d_freq = 0.0;
+ d_phase = 0.0;
+ fill(d_dfe.begin(), d_dfe.end(), gr_complex(1.0,0.0));
+}
+
+inline void
+gr_ofdm_frame_sink2::enter_have_header()
+{
+ d_state = STATE_HAVE_HEADER;
+
+ // header consists of two 16-bit shorts in network byte order
+ // payload length is lower 12 bits
+ // whitener offset is upper 4 bits
+ d_packetlen = (d_header >> 16) & 0x0fff;
+ d_packet_whitener_offset = (d_header >> 28) & 0x000f;
+ d_packetlen_cnt = 0;
+
+ if (VERBOSE)
+ fprintf(stderr, "@ enter_have_header (payload_len = %d) (offset = %d)\n",
+ d_packetlen, d_packet_whitener_offset);
+}
+
+
+unsigned int gr_ofdm_frame_sink2::demapper(const gr_complex *in,
+ unsigned char *out)
+{
+ unsigned int i=0, bytes_produced=0;
+ gr_complex carrier;
+
+ carrier=gr_expj(d_phase);
+
+ gr_complex accum_error = 0.0;
+ //while(i < d_occupied_carriers) {
+ while(i < d_subcarrier_map.size()) {
+ if(d_nresid > 0) {
+ d_partial_byte |= d_resid;
+ d_byte_offset += d_nresid;
+ 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;
+ }
+
+ unsigned char bits = d_constell->decision_maker(&sigrot);
+
+ gr_complex closest_sym = d_constell->points()[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) {
+ d_partial_byte |= bits << (d_byte_offset);
+ d_byte_offset += d_nbits;
+ }
+ else {
+ d_nresid = d_nbits-(8-d_byte_offset);
+ int mask = ((1<<(8-d_byte_offset))-1);
+ d_partial_byte |= (bits & mask) << d_byte_offset;
+ 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",
+ // in[i-1].real(), in[i-1].imag(), bits, d_partial_byte, d_byte_offset, d_resid, d_nresid);
+ }
+
+ if(d_byte_offset == 8) {
+ //printf("demod byte: %x \n\n", d_partial_byte);
+ out[bytes_produced++] = d_partial_byte;
+ d_byte_offset = 0;
+ d_partial_byte = 0;
+ }
+ }
+ //std::cerr << "accum_error " << accum_error << std::endl;
+
+ float angle = arg(accum_error);
+
+ d_freq = d_freq - d_freq_gain*angle;
+ d_phase = d_phase + d_freq - d_phase_gain*angle;
+ if (d_phase >= 2*M_PI) 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;
+}
+
+
+gr_ofdm_frame_sink2_sptr
+gr_make_ofdm_frame_sink2(gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_carriers,
+ float phase_gain, float freq_gain)
+{
+ return gnuradio::get_initial_sptr(new gr_ofdm_frame_sink2(constell,
+ target_queue, occupied_carriers,
+ phase_gain, freq_gain));
+}
+
+
+gr_ofdm_frame_sink2::gr_ofdm_frame_sink2(gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_carriers,
+ float phase_gain, float freq_gain)
+ : gr_sync_block ("ofdm_frame_sink2",
+ gr_make_io_signature2 (2, 2, sizeof(gr_complex)*occupied_carriers, sizeof(char)),
+ gr_make_io_signature (1, 1, sizeof(gr_complex)*occupied_carriers)),
+ d_constell(constell),
+ 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)
+{
+ if (d_constell->dimensionality() != 1)
+ throw std::runtime_error ("This receiver only works with constellations of dimension 1.");
+
+ std::string carriers = "FE7F";
+
+ // A bit hacky to fill out carriers to occupied_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
+ // can be later passed by the user, even though it'd be cleaner to just do this
+ // on the carrier map itself
+ int diff_left=0;
+ int diff_right=0;
+
+ // dictionary to convert from integers to ascii hex representation
+ 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};
+
+ 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);
+ }
+
+ // It seemed like such a good idea at the time...
+ // because we are only dealing with the occupied_carriers
+ // at this point, the diff_left in the following compensates
+ // for any offset from the 0th carrier introduced
+ unsigned int i,j,k;
+ for(i = 0; i < (d_occupied_carriers/4)+diff_left; i++) {
+ char c = carriers[i];
+ for(j = 0; j < 4; j++) {
+ k = (strtol(&c, NULL, 16) >> (3-j)) & 0x1;
+ if(k) {
+ d_subcarrier_map.push_back(4*i + j - diff_left);
+ }
+ }
+ }
+
+ // make sure we stay in the limit currently imposed by the occupied_carriers
+ if(d_subcarrier_map.size() > d_occupied_carriers) {
+ throw std::invalid_argument("gr_ofdm_mapper_bcv: subcarriers allocated exceeds size of occupied carriers");
+ }
+
+ d_bytes_out = new unsigned char[d_occupied_carriers];
+ d_dfe.resize(occupied_carriers);
+ fill(d_dfe.begin(), d_dfe.end(), gr_complex(1.0,0.0));
+
+ d_nbits = d_constell->bits_per_symbol();
+
+ enter_search();
+}
+
+gr_ofdm_frame_sink2::~gr_ofdm_frame_sink2 ()
+{
+ delete [] d_bytes_out;
+}
+
+
+int
+gr_ofdm_frame_sink2::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const gr_complex *in = (const gr_complex *) input_items[0];
+ const char *sig = (const char *) input_items[1];
+ unsigned int j = 0;
+ unsigned int bytes=0;
+
+ // If the output is connected, send it the derotated symbols
+ if(output_items.size() >= 1)
+ d_derotated_output = (gr_complex *)output_items[0];
+ else
+ d_derotated_output = NULL;
+
+ if (VERBOSE)
+ fprintf(stderr,">>> Entering state machine\n");
+
+ switch(d_state) {
+
+ 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
+ // 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");
+ fprintf(stderr,"Header Search bitcnt=%d, header=0x%08x\n",
+ d_headerbytelen_cnt, d_header);
+ }
+
+ j = 0;
+ 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) {
+ gr_message_sptr msg =
+ gr_make_message(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();
+ }
+ }
+ else {
+ enter_search(); // bad header
+ }
+ }
+ }
+ break;
+
+ case STATE_HAVE_HEADER:
+ bytes = demapper(&in[0], d_bytes_out);
+
+ if (VERBOSE) {
+ if(sig[0])
+ 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
+ gr_message_sptr msg =
+ gr_make_message(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
+
+ return 1;
+}
diff --git a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.h b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.h
new file mode 100644
index 000000000..de8c6a37e
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.h
@@ -0,0 +1,120 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,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.
+ */
+
+#ifndef INCLUDED_GR_OFDM_FRAME_SINK2_H
+#define INCLUDED_GR_OFDM_FRAME_SINK2_H
+
+#include <gr_sync_block.h>
+#include <gr_msg_queue.h>
+#include <gr_constellation.h>
+
+class gr_ofdm_frame_sink2;
+typedef boost::shared_ptr<gr_ofdm_frame_sink2> gr_ofdm_frame_sink2_sptr;
+
+gr_ofdm_frame_sink2_sptr
+gr_make_ofdm_frame_sink2 (gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_tones,
+ float phase_gain=0.25, float freq_gain=0.25*0.25/4.0);
+
+/*!
+ * \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 sink_blk
+ * \ingroup ofdm_blk
+ *
+ * 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 gr_ofdm_frame_sink2 : public gr_sync_block
+{
+ friend gr_ofdm_frame_sink2_sptr
+ gr_make_ofdm_frame_sink2 (gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_tones,
+ float phase_gain, float freq_gain);
+
+ private:
+ enum state_t {STATE_SYNC_SEARCH, STATE_HAVE_SYNC, STATE_HAVE_HEADER};
+
+ static const int MAX_PKT_LEN = 4096;
+ static const int HEADERBYTELEN = 4;
+
+ gr_msg_queue_sptr d_target_queue; // where to send the packet when received
+ state_t d_state;
+ unsigned int d_header; // header bits
+ int d_headerbytelen_cnt; // how many so far
+
+ unsigned char *d_bytes_out; // hold the current bytes produced by the demapper
+
+ unsigned int d_occupied_carriers;
+ unsigned int d_byte_offset;
+ unsigned int d_partial_byte;
+
+ unsigned char d_packet[MAX_PKT_LEN]; // assembled payload
+ int d_packetlen; // length of packet
+ int d_packet_whitener_offset; // offset into whitener string to use
+ int d_packetlen_cnt; // how many so far
+
+ gr_complex * d_derotated_output; // Pointer to output stream to send deroated symbols out
+
+ gr_constellation_sptr d_constell;
+ std::vector<gr_complex> d_dfe;
+ unsigned int d_nbits;
+
+ unsigned char d_resid;
+ unsigned int d_nresid;
+ float d_phase;
+ float d_freq;
+ float d_phase_gain;
+ float d_freq_gain;
+ float d_eq_gain;
+
+ std::vector<int> d_subcarrier_map;
+
+ protected:
+ gr_ofdm_frame_sink2(gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_tones,
+ float phase_gain, float freq_gain);
+
+ void enter_search();
+ void enter_have_sync();
+ void enter_have_header();
+
+ bool header_ok()
+ {
+ // confirm that two copies of header info are identical
+ return ((d_header >> 16) ^ (d_header & 0xffff)) == 0;
+ }
+
+ unsigned char slicer(const gr_complex x);
+ unsigned int demapper(const gr_complex *in,
+ unsigned char *out);
+
+ public:
+ ~gr_ofdm_frame_sink2();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_GR_OFDM_FRAME_SINK2_H */
diff --git a/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.i b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.i
new file mode 100644
index 000000000..8fa320089
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gr_ofdm_frame_sink2.i
@@ -0,0 +1,39 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(gr,ofdm_frame_sink2);
+
+gr_ofdm_frame_sink2_sptr
+gr_make_ofdm_frame_sink2(gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_tones,
+ float phase_gain=0.25, float freq_gain=0.25*0.25/4);
+
+class gr_ofdm_frame_sink2 : public gr_sync_block
+{
+ protected:
+ gr_ofdm_frame_sink2(gr_constellation_sptr constell,
+ gr_msg_queue_sptr target_queue, unsigned int occupied_tones,
+ float phase_gain, float freq_gain);
+
+ public:
+ ~gr_ofdm_frame_sink2();
+};
diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
index 1668f71f0..e8ec1e235 100644
--- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
+++ b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2010 Free Software Foundation, Inc.
+ * Copyright 2006,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -30,22 +30,24 @@
#include <math.h>
#include <gr_math.h>
-#define M_TWOPI (2*M_PI)
+#ifndef M_TWOPI
+#define M_TWOPI (2.0f*M_PI)
+#endif
gr_pll_carriertracking_cc_sptr
-gr_make_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq)
+gr_make_pll_carriertracking_cc (float loop_bw, float max_freq, float min_freq)
{
- return gnuradio::get_initial_sptr(new gr_pll_carriertracking_cc (alpha, beta, max_freq, min_freq));
+ return gnuradio::get_initial_sptr(new gr_pll_carriertracking_cc (loop_bw, max_freq, min_freq));
}
-gr_pll_carriertracking_cc::gr_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq)
+gr_pll_carriertracking_cc::gr_pll_carriertracking_cc (float loop_bw,
+ float max_freq,
+ float min_freq)
: gr_sync_block ("pll_carriertracking_cc",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
gr_make_io_signature (1, 1, sizeof (gr_complex))),
- d_alpha(alpha), d_beta(beta),
- d_max_freq(max_freq), d_min_freq(min_freq),
- d_phase(0), d_freq((max_freq+min_freq)/2),
- d_locksig(0),d_lock_threshold(0),d_squelch_enable(false)
+ gri_control_loop(loop_bw, max_freq, min_freq),
+ d_locksig(0), d_lock_threshold(0), d_squelch_enable(false)
{
}
@@ -72,7 +74,7 @@ gr_pll_carriertracking_cc::phase_detector(gr_complex sample,float ref_phase)
bool
gr_pll_carriertracking_cc::lock_detector(void)
{
- return (fabs(d_locksig) > d_lock_threshold);
+ return (fabsf(d_locksig) > d_lock_threshold);
}
bool
@@ -99,19 +101,16 @@ gr_pll_carriertracking_cc::work (int noutput_items,
float t_imag, t_real;
for (int i = 0; i < noutput_items; i++){
- gr_sincosf(d_phase,&t_imag,&t_real);
- optr[i] = iptr[i] * gr_complex(t_real,-t_imag);
+ gr_sincosf(d_phase, &t_imag, &t_real);
+ optr[i] = iptr[i] * gr_complex(t_real, -t_imag);
error = phase_detector(iptr[i],d_phase);
-
- d_freq = d_freq + d_beta * error;
- d_phase = mod_2pi(d_phase + d_freq + d_alpha * error);
-
- if (d_freq > d_max_freq)
- d_freq = d_max_freq;
- else if (d_freq < d_min_freq)
- d_freq = d_min_freq;
- d_locksig = d_locksig * (1.0 - d_alpha) +
+
+ advance_loop(error);
+ phase_wrap();
+ frequency_limit();
+
+ d_locksig = d_locksig * (1.0 - d_alpha) + \
d_alpha*(iptr[i].real() * t_real + iptr[i].imag() * t_imag);
if ((d_squelch_enable) && !lock_detector())
diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h
index 195f06016..bcdf543a4 100644
--- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h
+++ b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,206 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -24,12 +24,14 @@
#define INCLUDED_GR_PLL_CARRIERTRACKING_CC_H
#include <gr_sync_block.h>
+#include <gri_control_loop.h>
class gr_pll_carriertracking_cc;
typedef boost::shared_ptr<gr_pll_carriertracking_cc> gr_pll_carriertracking_cc_sptr;
-gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float alpha, float beta,
- float max_freq, float min_freq);
+gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float loop_bw,
+ float max_freq,
+ float min_freq);
/*!
* \brief Implements a PLL which locks to the input frequency and outputs the
* input signal mixed with that carrier.
@@ -41,19 +43,20 @@ gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float alpha, floa
* the input and outputs that signal, downconverted to DC
*
* All settings max_freq and min_freq are in terms of radians per sample,
- * NOT HERTZ. Alpha is the phase gain (first order, units of radians per radian)
- * and beta is the frequency gain (second order, units of radians per sample per radian)
+ * NOT HERTZ. The loop bandwidth determins the lock range and should be set
+ * around pi/200 -- 2pi/100.
* \sa gr_pll_freqdet_cf, gr_pll_carriertracking_cc
*/
-class gr_pll_carriertracking_cc : public gr_sync_block
+class gr_pll_carriertracking_cc : public gr_sync_block, public gri_control_loop
{
- friend gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float alpha, float beta,
- float max_freq, float min_freq);
+ friend gr_pll_carriertracking_cc_sptr gr_make_pll_carriertracking_cc (float loop_bw,
+ float max_freq,
+ float min_freq);
- float d_alpha,d_beta,d_max_freq,d_min_freq,d_phase,d_freq,d_locksig,d_lock_threshold;
+ float d_locksig,d_lock_threshold;
bool d_squelch_enable;
- gr_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq);
+ gr_pll_carriertracking_cc (float loop_bw, float max_freq, float min_freq);
int work (int noutput_items,
gr_vector_const_void_star &input_items,
diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i
index 3e84fccbe..d309111b2 100644
--- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i
+++ b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -23,13 +23,14 @@
GR_SWIG_BLOCK_MAGIC(gr,pll_carriertracking_cc);
gr_pll_carriertracking_cc_sptr
-gr_make_pll_carriertracking_cc (float alpha, float beta,
- float max_freq, float min_freq);
+gr_make_pll_carriertracking_cc (float loop_bw,
+ float max_freq,
+ float min_freq);
-class gr_pll_carriertracking_cc : public gr_sync_block
+class gr_pll_carriertracking_cc : public gr_sync_block, public gri_control_loop
{
private:
- gr_pll_carriertracking_cc (float alpha, float beta, float max_freq, float min_freq);
+ gr_pll_carriertracking_cc (float loop_bw, float max_freq, float min_freq);
public:
bool lock_detector(void);
bool squelch_enable(bool);
diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
index 997ba4042..aa0d67855 100644
--- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
+++ b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,8 +20,6 @@
* Boston, MA 02110-1301, USA.
*/
-// WARNING: this file is machine generated. Edits will be over written
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -31,21 +29,21 @@
#include <math.h>
#include <gr_math.h>
-#define M_TWOPI (2*M_PI)
+#ifndef M_TWOPI
+#define M_TWOPI (2.0f*M_PI)
+#endif
gr_pll_freqdet_cf_sptr
-gr_make_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq)
+gr_make_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq)
{
- return gnuradio::get_initial_sptr(new gr_pll_freqdet_cf (alpha, beta, max_freq, min_freq));
+ return gnuradio::get_initial_sptr(new gr_pll_freqdet_cf (loop_bw, max_freq, min_freq));
}
-gr_pll_freqdet_cf::gr_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq)
+gr_pll_freqdet_cf::gr_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq)
: gr_sync_block ("pll_freqdet_cf",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
gr_make_io_signature (1, 1, sizeof (float))),
- d_alpha(alpha), d_beta(beta),
- d_max_freq(max_freq), d_min_freq(min_freq),
- d_phase(0), d_freq((max_freq+min_freq)/2)
+ gri_control_loop(loop_bw, max_freq, min_freq)
{
}
@@ -70,8 +68,8 @@ gr_pll_freqdet_cf::phase_detector(gr_complex sample,float ref_phase)
int
gr_pll_freqdet_cf::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const gr_complex *iptr = (gr_complex *) input_items[0];
float *optr = (float *) output_items[0];
@@ -84,13 +82,9 @@ gr_pll_freqdet_cf::work (int noutput_items,
error = phase_detector(*iptr++,d_phase);
- d_freq = d_freq + d_beta * error;
- d_phase = mod_2pi(d_phase + d_freq + d_alpha * error);
-
- if (d_freq > d_max_freq)
- d_freq = d_max_freq;
- else if (d_freq < d_min_freq)
- d_freq = d_min_freq;
+ advance_loop(error);
+ phase_wrap();
+ frequency_limit();
}
return noutput_items;
}
diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h
index 0581c8724..0da9fc5c7 100644
--- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h
+++ b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -24,12 +24,14 @@
#define INCLUDED_GR_PLL_FREQDET_CF_H
#include <gr_sync_block.h>
+#include <gri_control_loop.h>
class gr_pll_freqdet_cf;
typedef boost::shared_ptr<gr_pll_freqdet_cf> gr_pll_freqdet_cf_sptr;
-gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float alpha, float beta,
- float max_freq, float min_freq);
+gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float loop_bw,
+ float max_freq,
+ float min_freq);
/*!
* \brief Implements a PLL which locks to the input frequency and outputs
* an estimate of that frequency. Useful for FM Demod.
@@ -40,24 +42,24 @@ gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float alpha, float beta,
* This PLL locks onto a [possibly noisy] reference carrier on
* the input and outputs an estimate of that frequency in radians per sample.
* All settings max_freq and min_freq are in terms of radians per sample,
- * NOT HERTZ. Alpha is the phase gain (first order, units of radians per radian)
- * and beta is the frequency gain (second order, units of radians per sample per radian)
+ * NOT HERTZ. The loop bandwidth determins the lock range and should be set
+ * around pi/200 -- 2pi/100.
* \sa gr_pll_refout_cc, gr_pll_carriertracking_cc
*/
-class gr_pll_freqdet_cf : public gr_sync_block
+class gr_pll_freqdet_cf : public gr_sync_block, public gri_control_loop
{
- friend gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float alpha, float beta,
- float max_freq, float min_freq);
+ friend gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float loop_bw,
+ float max_freq,
+ float min_freq);
- float d_alpha,d_beta,d_max_freq,d_min_freq,d_phase,d_freq;
- gr_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq);
+ float mod_2pi (float in);
+ gr_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq);
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
private:
- float mod_2pi (float in);
float phase_detector(gr_complex sample,float ref_phase);
};
diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i
index b730f037a..f93e6e37e 100644
--- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i
+++ b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -22,11 +22,12 @@
GR_SWIG_BLOCK_MAGIC(gr,pll_freqdet_cf)
- gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float alpha, float beta,
- float max_freq, float min_freq);
+ gr_pll_freqdet_cf_sptr gr_make_pll_freqdet_cf (float loop_bw,
+ float max_freq,
+ float min_freq);
-class gr_pll_freqdet_cf : public gr_sync_block
+class gr_pll_freqdet_cf : public gr_sync_block, public gri_control_loop
{
private:
- gr_pll_freqdet_cf (float alpha, float beta, float max_freq, float min_freq);
+ gr_pll_freqdet_cf (float loop_bw, float max_freq, float min_freq);
};
diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
index d01f28e45..dfd5079da 100644
--- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
+++ b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,8 +20,6 @@
* Boston, MA 02110-1301, USA.
*/
-// WARNING: this file is machine generated. Edits will be over written
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -32,21 +30,21 @@
#include <math.h>
#include <gr_math.h>
-#define M_TWOPI (2*M_PI)
+#ifndef M_TWOPI
+#define M_TWOPI (2.0f*M_PI)
+#endif
gr_pll_refout_cc_sptr
-gr_make_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq)
+gr_make_pll_refout_cc (float loop_bw, float max_freq, float min_freq)
{
- return gnuradio::get_initial_sptr(new gr_pll_refout_cc (alpha, beta, max_freq, min_freq));
+ return gnuradio::get_initial_sptr(new gr_pll_refout_cc (loop_bw, max_freq, min_freq));
}
-gr_pll_refout_cc::gr_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq)
+gr_pll_refout_cc::gr_pll_refout_cc (float loop_bw, float max_freq, float min_freq)
: gr_sync_block ("pll_refout_cc",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
gr_make_io_signature (1, 1, sizeof (gr_complex))),
- d_alpha(alpha), d_beta(beta),
- d_max_freq(max_freq), d_min_freq(min_freq),
- d_phase(0), d_freq((max_freq+min_freq)/2)
+ gri_control_loop(loop_bw, max_freq, min_freq)
{
}
@@ -87,13 +85,9 @@ gr_pll_refout_cc::work (int noutput_items,
error = phase_detector(*iptr++,d_phase);
- d_freq = d_freq + d_beta * error;
- d_phase = mod_2pi(d_phase + d_freq + d_alpha * error);
-
- if (d_freq > d_max_freq)
- d_freq = d_max_freq;
- else if (d_freq < d_min_freq)
- d_freq = d_min_freq;
+ advance_loop(error);
+ phase_wrap();
+ frequency_limit();
}
return noutput_items;
}
diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.h b/gnuradio-core/src/lib/general/gr_pll_refout_cc.h
index 3263c957f..d3e45882b 100644
--- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.h
+++ b/gnuradio-core/src/lib/general/gr_pll_refout_cc.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,18 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
-
-
#ifndef INCLUDED_GR_PLL_REFOUT_CC_H
#define INCLUDED_GR_PLL_REFOUT_CC_H
#include <gr_sync_block.h>
+#include <gri_control_loop.h>
class gr_pll_refout_cc;
typedef boost::shared_ptr<gr_pll_refout_cc> gr_pll_refout_cc_sptr;
-gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float alpha, float beta,
- float max_freq, float min_freq);
+gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float loop_bw,
+ float max_freq, float min_freq);
/*!
* \brief Implements a PLL which locks to the input frequency and outputs a carrier
* \ingroup sync_blk
@@ -43,24 +42,23 @@ gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float alpha, float beta,
* aligned to it.
*
* All settings max_freq and min_freq are in terms of radians per sample,
- * NOT HERTZ. Alpha is the phase gain (first order, units of radians per radian)
- * and beta is the frequency gain (second order, units of radians per sample per radian)
+ * NOT HERTZ. The loop bandwidth determins the lock range and should be set
+ * around pi/200 -- 2pi/100.
* \sa gr_pll_freqdet_cf, gr_pll_carriertracking_cc
*/
-class gr_pll_refout_cc : public gr_sync_block
+class gr_pll_refout_cc : public gr_sync_block, public gri_control_loop
{
- friend gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float alpha, float beta,
- float max_freq, float min_freq);
+ friend gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float loop_bw,
+ float max_freq, float min_freq);
- float d_alpha,d_beta,d_max_freq,d_min_freq,d_phase,d_freq;
- gr_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq);
+ gr_pll_refout_cc (float loop_bw, float max_freq, float min_freq);
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
private:
float mod_2pi (float in);
- float phase_detector(gr_complex sample,float ref_phase);
+ float phase_detector(gr_complex sample, float ref_phase);
};
#endif
diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.i b/gnuradio-core/src/lib/general/gr_pll_refout_cc.i
index 026a684ed..834ea1e36 100644
--- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.i
+++ b/gnuradio-core/src/lib/general/gr_pll_refout_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -22,11 +22,11 @@
GR_SWIG_BLOCK_MAGIC(gr,pll_refout_cc)
- gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float alpha, float beta,
- float max_freq, float min_freq);
+gr_pll_refout_cc_sptr gr_make_pll_refout_cc (float loop_bw,
+ float max_freq, float min_freq);
-class gr_pll_refout_cc : public gr_sync_block
+class gr_pll_refout_cc : public gr_sync_block, public gri_control_loop
{
private:
- gr_pll_refout_cc (float alpha, float beta, float max_freq, float min_freq);
+ gr_pll_refout_cc (float loop_bw, float max_freq, float min_freq);
};
diff --git a/gnuradio-core/src/lib/general/gri_control_loop.cc b/gnuradio-core/src/lib/general/gri_control_loop.cc
new file mode 100644
index 000000000..affdeefc9
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gri_control_loop.cc
@@ -0,0 +1,183 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <gri_control_loop.h>
+#include <gr_math.h>
+#include <stdexcept>
+
+#define M_TWOPI (2.0f*M_PI)
+
+gri_control_loop::gri_control_loop(float loop_bw,
+ float max_freq, float min_freq)
+ : d_phase(0), d_freq(0), d_max_freq(max_freq), d_min_freq(min_freq)
+{
+ // Set the damping factor for a critically damped system
+ d_damping = sqrtf(2.0f)/2.0f;
+
+ // Set the bandwidth, which will then call update_gains()
+ set_loop_bandwidth(loop_bw);
+}
+
+gri_control_loop::~gri_control_loop()
+{
+}
+
+void
+gri_control_loop::update_gains()
+{
+ float denom = (1.0 + 2.0*d_damping*d_loop_bw + d_loop_bw*d_loop_bw);
+ d_alpha = (4*d_damping*d_loop_bw) / denom;
+ d_beta = (4*d_loop_bw*d_loop_bw) / denom;
+}
+
+void
+gri_control_loop::advance_loop(float error)
+{
+ d_freq = d_freq + d_beta * error;
+ d_phase = d_phase + d_freq + d_alpha * error;
+}
+
+
+void
+gri_control_loop::phase_wrap()
+{
+ while(d_phase>M_TWOPI)
+ d_phase -= M_TWOPI;
+ while(d_phase<-M_TWOPI)
+ d_phase += M_TWOPI;
+}
+
+void
+gri_control_loop::frequency_limit()
+{
+ if (d_freq > d_max_freq)
+ d_freq = d_max_freq;
+ else if (d_freq < d_min_freq)
+ d_freq = d_min_freq;
+}
+
+/*******************************************************************
+ SET FUNCTIONS
+*******************************************************************/
+
+void
+gri_control_loop::set_loop_bandwidth(float bw)
+{
+ if(bw < 0) {
+ throw std::out_of_range ("gri_control_loop: invalid bandwidth. Must be >= 0.");
+ }
+
+ d_loop_bw = bw;
+ update_gains();
+}
+
+void
+gri_control_loop::set_damping_factor(float df)
+{
+ if(df < 0 || df > 1.0) {
+ throw std::out_of_range ("gri_control_loop: invalid damping factor. Must be in [0,1].");
+ }
+
+ d_damping = df;
+ update_gains();
+}
+
+void
+gri_control_loop::set_alpha(float alpha)
+{
+ if(alpha < 0 || alpha > 1.0) {
+ throw std::out_of_range ("gri_control_loop: invalid alpha. Must be in [0,1].");
+ }
+ d_alpha = alpha;
+}
+
+void
+gri_control_loop::set_beta(float beta)
+{
+ if(beta < 0 || beta > 1.0) {
+ throw std::out_of_range ("gri_control_loop: invalid beta. Must be in [0,1].");
+ }
+ d_beta = beta;
+}
+
+void
+gri_control_loop::set_frequency(float freq)
+{
+ if(freq > d_max_freq)
+ d_freq = d_min_freq;
+ else if(freq < d_min_freq)
+ d_freq = d_max_freq;
+ else
+ d_freq = freq;
+}
+
+void
+gri_control_loop::set_phase(float phase)
+{
+ d_phase = phase;
+ while(d_phase>M_TWOPI)
+ d_phase -= M_TWOPI;
+ while(d_phase<-M_TWOPI)
+ d_phase += M_TWOPI;
+}
+
+
+/*******************************************************************
+ GET FUNCTIONS
+*******************************************************************/
+
+
+float
+gri_control_loop::get_loop_bandwidth() const
+{
+ return d_loop_bw;
+}
+
+float
+gri_control_loop::get_damping_factor() const
+{
+ return d_damping;
+}
+
+float
+gri_control_loop::get_alpha() const
+{
+ return d_alpha;
+}
+
+float
+gri_control_loop::get_beta() const
+{
+ return d_beta;
+}
+
+float
+gri_control_loop::get_frequency() const
+{
+ return d_freq;
+}
+
+float
+gri_control_loop::get_phase() const
+{
+ return d_phase;
+}
diff --git a/gnuradio-core/src/lib/general/gri_control_loop.h b/gnuradio-core/src/lib/general/gri_control_loop.h
new file mode 100644
index 000000000..a85625bbd
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gri_control_loop.h
@@ -0,0 +1,201 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef GRI_CONTROL_LOOP
+#define GRI_CONTROL_LOOP
+
+class gri_control_loop
+{
+ protected:
+ float d_phase, d_freq;
+ float d_max_freq, d_min_freq;
+ float d_damping, d_loop_bw;
+ float d_alpha, d_beta;
+
+ public:
+ gri_control_loop(float loop_bw, float max_freq, float min_freq);
+ virtual ~gri_control_loop();
+
+ /*! \brief update the system gains from the loop bandwidth and damping factor
+ *
+ * This function updates the system gains based on the loop
+ * bandwidth and damping factor of the system.
+ * These two factors can be set separately through their own
+ * set functions.
+ */
+ void update_gains();
+
+ /*! \brief update the system gains from the loop bandwidth and damping factor
+ *
+ * This function updates the system gains based on the loop
+ * bandwidth and damping factor of the system.
+ * These two factors can be set separately through their own
+ * set functions.
+ */
+ void advance_loop(float error);
+
+ /*! \brief Keep the phase between -2pi and 2pi
+ *
+ * This function keeps the phase between -2pi and 2pi. If the phase
+ * is greater than 2pi by d, it wraps around to be -2pi+d; similarly if
+ * it is less than -2pi by d, it wraps around to 2pi-d.
+ *
+ * This function should be called after advance_loop to keep the phase
+ * in a good operating region. It is set as a separate method in case
+ * another way is desired as this is fairly heavy-handed.
+ */
+ void phase_wrap();
+
+ /*! \brief Keep the frequency between d_min_freq and d_max_freq
+ *
+ * This function keeps the frequency between d_min_freq and d_max_freq.
+ * If the frequency is greater than d_max_freq, it is set to d_max_freq.
+ * If the frequency is less than d_min_freq, it is set to d_min_freq.
+ *
+ * This function should be called after advance_loop to keep the frequency
+ * in the specified region. It is set as a separate method in case
+ * another way is desired as this is fairly heavy-handed.
+ */
+ void frequency_limit();
+
+ /*******************************************************************
+ SET FUNCTIONS
+ *******************************************************************/
+
+ /*!
+ * \brief Set the loop bandwidth
+ *
+ * Set the loop filter's bandwidth to \p bw. This should be between
+ * 2*pi/200 and 2*pi/100 (in rads/samp). It must also be a positive
+ * number.
+ *
+ * When a new damping factor is set, the gains, alpha and beta, of the loop
+ * are recalculated by a call to update_gains().
+ *
+ * \param bw (float) new bandwidth
+ *
+ */
+ void set_loop_bandwidth(float bw);
+
+ /*!
+ * \brief Set the loop damping factor
+ *
+ * Set the loop filter's damping factor to \p df. The damping factor
+ * should be sqrt(2)/2.0 for critically damped systems.
+ * Set it to anything else only if you know what you are doing. It must
+ * be a number between 0 and 1.
+ *
+ * When a new damping factor is set, the gains, alpha and beta, of the loop
+ * are recalculated by a call to update_gains().
+ *
+ * \param df (float) new damping factor
+ *
+ */
+ void set_damping_factor(float df);
+
+ /*!
+ * \brief Set the loop gain alpha
+ *
+ * Set's the loop filter's alpha gain parameter.
+ *
+ * This value should really only be set by adjusting the loop bandwidth
+ * and damping factor.
+ *
+ * \param alpha (float) new alpha gain
+ *
+ */
+ void set_alpha(float alpha);
+
+ /*!
+ * \brief Set the loop gain beta
+ *
+ * Set's the loop filter's beta gain parameter.
+ *
+ * This value should really only be set by adjusting the loop bandwidth
+ * and damping factor.
+ *
+ * \param beta (float) new beta gain
+ *
+ */
+ void set_beta(float beta);
+
+ /*!
+ * \brief Set the Costas loop's frequency.
+ *
+ * Set's the Costas Loop's frequency. While this is normally updated by the
+ * inner loop of the algorithm, it could be useful to manually initialize,
+ * set, or reset this under certain circumstances.
+ *
+ * \param freq (float) new frequency
+ *
+ */
+ void set_frequency(float freq);
+
+ /*!
+ * \brief Set the Costas loop's phase.
+ *
+ * Set's the Costas Loop's phase. While this is normally updated by the
+ * inner loop of the algorithm, it could be useful to manually initialize,
+ * set, or reset this under certain circumstances.
+ *
+ * \param phase (float) new phase
+ *
+ */
+ void set_phase(float phase);
+
+
+ /*******************************************************************
+ GET FUNCTIONS
+ *******************************************************************/
+
+ /*!
+ * \brief Returns the loop bandwidth
+ */
+ float get_loop_bandwidth() const;
+
+ /*!
+ * \brief Returns the loop damping factor
+ */
+ float get_damping_factor() const;
+
+ /*!
+ * \brief Returns the loop gain alpha
+ */
+ float get_alpha() const;
+
+ /*!
+ * \brief Returns the loop gain beta
+ */
+ float get_beta() const;
+
+ /*!
+ * \brief Get the Costas loop's frequency estimate
+ */
+ float get_frequency() const;
+
+ /*!
+ * \brief Get the Costas loop's phase estimate
+ */
+ float get_phase() const;
+};
+
+#endif /* GRI_CONTROL_LOOP */
diff --git a/gnuradio-core/src/lib/general/gri_control_loop.i b/gnuradio-core/src/lib/general/gri_control_loop.i
new file mode 100644
index 000000000..67f8838cb
--- /dev/null
+++ b/gnuradio-core/src/lib/general/gri_control_loop.i
@@ -0,0 +1,57 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+
+class gri_control_loop
+{
+ public:
+ gri_control_loop(float loop_bw, float max_freq, float min_freq);
+ virtual ~gri_control_loop();
+
+ void update_gains();
+ void advance_loop(float error);
+ void phase_wrap();
+ void frequency_limit();
+
+ /*******************************************************************
+ SET FUNCTIONS
+ *******************************************************************/
+
+ void set_loop_bandwidth(float bw);
+ void set_damping_factor(float df);
+ void set_alpha(float alpha);
+ void set_beta(float beta);
+ void set_frequency(float freq);
+ void set_phase(float phase);
+
+
+ /*******************************************************************
+ GET FUNCTIONS
+ *******************************************************************/
+
+ float get_loop_bandwidth() const;
+ float get_damping_factor() const;
+ float get_alpha() const;
+ float get_beta() const;
+ float get_frequency() const;
+ float get_phase() const;
+};
diff --git a/gnuradio-core/src/lib/general/qa_general.cc b/gnuradio-core/src/lib/general/qa_general.cc
index 6984d798c..b9080f362 100644
--- a/gnuradio-core/src/lib/general/qa_general.cc
+++ b/gnuradio-core/src/lib/general/qa_general.cc
@@ -28,6 +28,7 @@
#include <qa_general.h>
#include <qa_gr_firdes.h>
#include <qa_gr_circular_file.h>
+#include <qa_gr_cpm.h>
#include <qa_gr_fxpt.h>
#include <qa_gr_fxpt_nco.h>
#include <qa_gr_fxpt_vco.h>
@@ -41,6 +42,7 @@ qa_general::suite ()
s->addTest (qa_gr_firdes::suite ());
s->addTest (qa_gr_circular_file::suite ());
+ s->addTest (qa_gr_cpm::suite ());
s->addTest (qa_gr_fxpt::suite ());
s->addTest (qa_gr_fxpt_nco::suite ());
s->addTest (qa_gr_fxpt_vco::suite ());
diff --git a/gnuradio-core/src/lib/general/qa_gr_cpm.cc b/gnuradio-core/src/lib/general/qa_gr_cpm.cc
new file mode 100644
index 000000000..cc32d1117
--- /dev/null
+++ b/gnuradio-core/src/lib/general/qa_gr_cpm.cc
@@ -0,0 +1,140 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <qa_gr_cpm.h>
+#include <gr_cpm.h>
+#include <cppunit/TestAssert.h>
+
+const double DELTA = 1e-5;
+const int L = 5;
+const int samples_per_sym = 4;
+const float taps_lrc[20] = {
+ 0, 0.002447174185242, 0.009549150281253, 0.020610737385376,
+ 0.034549150281253, 0.050000000000000, 0.065450849718747, 0.079389262614624,
+ 0.090450849718747, 0.097552825814758, 0.100000000000000, 0.097552825814758,
+ 0.090450849718747, 0.079389262614624, 0.065450849718747, 0.050000000000000,
+ 0.034549150281253, 0.020610737385376, 0.009549150281253, 0.002447174185242
+};
+
+
+const float taps_lsrc[20] = { // beta = 0.2
+ 0.000000000000000, 0.009062686687436, 0.019517618142920, 0.030875041875917,
+ 0.042552315421249, 0.053912556756416, 0.064308860403517, 0.073130584159352,
+ 0.079847961304114, 0.084051371489937, 0.085482007518284, 0.084051371489937,
+ 0.079847961304114, 0.073130584159352, 0.064308860403517, 0.053912556756416,
+ 0.042552315421249, 0.030875041875917, 0.019517618142920, 0.009062686687436
+};
+
+
+const float taps_tfm[20] = {
+ -0.003946522220317, -0.005147757690530, -0.003171631690177, 0.003959659609805,
+ 0.017498721302356, 0.037346982678383, 0.062251889790391, 0.087364237065604,
+ 0.110049050955117, 0.125677762224511, 0.132288693729399, 0.125677762224511,
+ 0.110049050955117, 0.087364237065604, 0.062251889790391, 0.037346982678383,
+ 0.017498721302356, 0.003959659609805, -0.003171631690177, -0.005147757690530
+};
+
+
+const float taps_gaussian[20] = { // BT = 0.3
+ 0.000000743866524, 0.000009286258371, 0.000085441834550, 0.000581664421923,
+ 0.002945540765422, 0.011178079812344, 0.032117220937421, 0.070841188736816,
+ 0.122053715366673, 0.167389736919915, 0.185594670675172, 0.167389736919915,
+ 0.122053715366673, 0.070841188736816, 0.032117220937421, 0.011178079812344,
+ 0.002945540765422, 0.000581664421923, 0.000085441834550, 0.000009286258371
+};
+
+
+// Check LREC phase response
+void
+qa_gr_cpm::t1 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LREC, samples_per_sym, L));
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], 0.05, DELTA);
+ }
+}
+
+
+// Check LRC phase response
+void
+qa_gr_cpm::t2 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LRC, samples_per_sym, L));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_lrc[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
+
+// Check LSRC phase response
+void
+qa_gr_cpm::t3 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::LSRC, samples_per_sym, L, 0.2));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_lsrc[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
+
+// Check the TFM phase response
+void
+qa_gr_cpm::t4 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::TFM, samples_per_sym, L));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_tfm[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
+
+// Check the Gaussian phase response
+void
+qa_gr_cpm::t5 ()
+{
+ std::vector<float> taps(gr_cpm::phase_response(gr_cpm::GAUSSIAN, samples_per_sym, L, 0.3));
+ float sum = 0;
+
+ for (int i = 0; i < L * samples_per_sym; i++) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(taps[i], taps_gaussian[i], DELTA);
+ sum += taps[i];
+ }
+
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(sum, 1.0, DELTA);
+}
+
diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.i b/gnuradio-core/src/lib/general/qa_gr_cpm.h
index 9a9f22b6e..741cb2860 100644
--- a/gnuradio-core/src/lib/general/gr_lms_dfe_cc.i
+++ b/gnuradio-core/src/lib/general/qa_gr_cpm.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2010 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,19 +19,31 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
+#ifndef _QA_GR_CPM_H
+#define _QA_GR_CPM_H
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/TestCase.h>
-GR_SWIG_BLOCK_MAGIC(gr,lms_dfe_cc)
+class qa_gr_cpm : public CppUnit::TestCase {
-gr_lms_dfe_cc_sptr gr_make_lms_dfe_cc (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
+ CPPUNIT_TEST_SUITE (qa_gr_cpm);
+ CPPUNIT_TEST (t1);
+ CPPUNIT_TEST (t2);
+ CPPUNIT_TEST (t3);
+ CPPUNIT_TEST (t4);
+ CPPUNIT_TEST (t5);
+ CPPUNIT_TEST_SUITE_END ();
-class gr_lms_dfe_cc : public gr_sync_block
-{
private:
- gr_lms_dfe_cc (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
- gr_complex slicer_0deg(gr_complex baud);
- gr_complex slicer_45deg(gr_complex baud);
- gr_complex conjg(gr_complex val);
+ void t1 ();
+ void t2 ();
+ void t3 ();
+ void t4 ();
+ void t5 ();
+
};
+
+
+#endif /* _QA_GR_CPM_H */
+
diff --git a/gnuradio-core/src/lib/hier/Makefile.am b/gnuradio-core/src/lib/hier/Makefile.am
index b525d19b4..369feef75 100644
--- a/gnuradio-core/src/lib/hier/Makefile.am
+++ b/gnuradio-core/src/lib/hier/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
diff --git a/gnuradio-core/src/lib/hier/hier.i b/gnuradio-core/src/lib/hier/hier.i
index dbcc8e915..bec3de7ed 100644
--- a/gnuradio-core/src/lib/hier/hier.i
+++ b/gnuradio-core/src/lib/hier/hier.i
@@ -29,3 +29,4 @@
%}
%include "gr_channel_model.i"
+
diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am
index f8e7640ae..d304a2123 100644
--- a/gnuradio-core/src/lib/swig/Makefile.am
+++ b/gnuradio-core/src/lib/swig/Makefile.am
@@ -45,7 +45,7 @@ TOP_SWIG_IFILES = \
swiginclude_HEADERS = \
gnuradio.i \
gr_swig_block_magic.i \
- gr_shared_ptr.i
+ gr_shared_ptr.i
# SWIG headers that get installed in ${prefix}/include/gnuradio/swig/...
nobase_swiginclude_HEADERS = \
diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen
index 0c3247565..cede68817 100644
--- a/gnuradio-core/src/lib/swig/Makefile.swig.gen
+++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen
@@ -105,7 +105,7 @@ _gnuradio_core_runtime_la_CXXFLAGS = \
$(gnuradio_core_runtime_la_swig_cxxflags)
python/gnuradio_core_runtime.cc: gnuradio_core_runtime.py
-gnuradio_core_runtime.py: gnuradio_core_runtime.i
+gnuradio_core_runtime.py: gnuradio_core_runtime.i
# Include the python dependencies for this file
-include python/gnuradio_core_runtime.d
@@ -250,7 +250,7 @@ _gnuradio_core_general_la_CXXFLAGS = \
$(gnuradio_core_general_la_swig_cxxflags)
python/gnuradio_core_general.cc: gnuradio_core_general.py
-gnuradio_core_general.py: gnuradio_core_general.i
+gnuradio_core_general.py: gnuradio_core_general.i
# Include the python dependencies for this file
-include python/gnuradio_core_general.d
@@ -395,7 +395,7 @@ _gnuradio_core_gengen_la_CXXFLAGS = \
$(gnuradio_core_gengen_la_swig_cxxflags)
python/gnuradio_core_gengen.cc: gnuradio_core_gengen.py
-gnuradio_core_gengen.py: gnuradio_core_gengen.i
+gnuradio_core_gengen.py: gnuradio_core_gengen.i
# Include the python dependencies for this file
-include python/gnuradio_core_gengen.d
@@ -540,7 +540,7 @@ _gnuradio_core_filter_la_CXXFLAGS = \
$(gnuradio_core_filter_la_swig_cxxflags)
python/gnuradio_core_filter.cc: gnuradio_core_filter.py
-gnuradio_core_filter.py: gnuradio_core_filter.i
+gnuradio_core_filter.py: gnuradio_core_filter.i
# Include the python dependencies for this file
-include python/gnuradio_core_filter.d
@@ -685,7 +685,7 @@ _gnuradio_core_io_la_CXXFLAGS = \
$(gnuradio_core_io_la_swig_cxxflags)
python/gnuradio_core_io.cc: gnuradio_core_io.py
-gnuradio_core_io.py: gnuradio_core_io.i
+gnuradio_core_io.py: gnuradio_core_io.i
# Include the python dependencies for this file
-include python/gnuradio_core_io.d
@@ -830,7 +830,7 @@ _gnuradio_core_hier_la_CXXFLAGS = \
$(gnuradio_core_hier_la_swig_cxxflags)
python/gnuradio_core_hier.cc: gnuradio_core_hier.py
-gnuradio_core_hier.py: gnuradio_core_hier.i
+gnuradio_core_hier.py: gnuradio_core_hier.i
# Include the python dependencies for this file
-include python/gnuradio_core_hier.d
diff --git a/gnuradio-core/src/python/gnuradio/Makefile.am b/gnuradio-core/src/python/gnuradio/Makefile.am
index eff35e95c..289e37662 100644
--- a/gnuradio-core/src/python/gnuradio/Makefile.am
+++ b/gnuradio-core/src/python/gnuradio/Makefile.am
@@ -22,16 +22,14 @@
include $(top_srcdir)/Makefile.common
if PYTHON
-SUBDIRS = gr gru gruimpl blks2 blks2impl vocoder
+SUBDIRS = gr gru gruimpl blks2 blks2impl
grpython_PYTHON = \
__init__.py \
eng_notation.py \
eng_option.py \
- modulation_utils.py \
modulation_utils2.py \
ofdm_packet_utils.py \
- packet_utils.py \
gr_unittest.py \
gr_xmlrunner.py \
optfir.py \
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am b/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am
index 7b24fb69d..9665dde0b 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/Makefile.am
@@ -30,17 +30,10 @@ grblkspython_PYTHON = \
__init__.py \
am_demod.py \
channel_model.py \
- dbpsk.py \
- dbpsk2.py \
- dqpsk.py \
- dqpsk2.py \
- d8psk.py \
filterbank.py \
fm_demod.py \
fm_emph.py \
generic_usrp.py \
- gmsk.py \
- cpm.py \
logpwrfft.py \
nbfm_rx.py \
nbfm_tx.py \
@@ -54,13 +47,8 @@ grblkspython_PYTHON = \
pfb_channelizer.py \
pfb_decimator.py \
pfb_interpolator.py \
- pkt.py \
psk.py \
qam.py \
- qam8.py \
- qam16.py \
- qam64.py \
- qam256.py \
rational_resampler.py \
standard_squelch.py \
stream_to_vector_decimator.py \
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py b/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py
deleted file mode 100644
index 67cf9f569..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/d8psk.py
+++ /dev/null
@@ -1,363 +0,0 @@
-#
-# Copyright 2005,2006,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-differential 8PSK modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import psk
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 3
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = 0.175
-_def_gain_mu = 0.175
-_def_mu = 0.5
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# D8PSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class d8psk_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "d8psk_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = 1
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (sps since we're interpolating by sps)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
-
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect & Initialize base class
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 3
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gray code = %s" % self._gray_code
- print "RS roll-off factor = %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds 8PSK modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(d8psk_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# D8PSK demodulator
-#
-# Differentially coherent detection of differentially encoded 8psk
-# /////////////////////////////////////////////////////////////////////////////
-
-class d8psk_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered DQPSK demodulation
-
- The input is the complex modulated signal at baseband.
- The output is a stream of bits packed 1 bit per byte (LSB)
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: float
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param costas_alpha: loop filter gain
- @type costas_alphas: float
- @param gain_mu: for M&M block
- @type gain_mu: float
- @param mu: for M&M block
- @type mu: float
- @param omega_relative_limit: for M&M block
- @type omega_relative_limit: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "d8psk_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._costas_alpha = costas_alpha
- self._mm_gain_mu = gain_mu
- self._mm_mu = mu
- self._mm_omega_relative_limit = omega_relative_limit
- self._gray_code = gray_code
-
- if samples_per_symbol < 2:
- raise TypeError, "sbp must be >= 2, is %d" % samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # Automatic gain control
- scale = (1.0/16384.0)
- self.pre_scaler = gr.multiply_const_cc(scale) # scale the signal from full-range to +-1
- #self.agc = gr.agc_cc(1e-2, 1, 1, 100)
- self.agc = gr.agc2_cc(1e-1, 1e-2, 1, 1, 100)
- #self.agc = gr.feedforward_agc_cc(16, 1.0)
-
- # RRC data filter
- ntaps = 11 * samples_per_symbol
- self.rrc_taps = gr.firdes.root_raised_cosine(
- 1.0, # gain
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
- self.rrc_filter=gr.interp_fir_filter_ccf(1, self.rrc_taps)
-
- # symbol clock recovery
- self._mm_omega = self._samples_per_symbol
- self._mm_gain_omega = .25 * self._mm_gain_mu * self._mm_gain_mu
- self._costas_beta = 0.25 * self._costas_alpha * self._costas_alpha
- fmin = -0.025
- fmax = 0.025
-
- self.receiver=gr.mpsk_receiver_cc(arity, 0,
- self._costas_alpha, self._costas_beta,
- fmin, fmax,
- self._mm_mu, self._mm_gain_mu,
- self._mm_omega, self._mm_gain_omega,
- self._mm_omega_relative_limit)
-
- # Perform Differential decoding on the constellation
- self.diffdec = gr.diff_phasor_cc()
-
- # find closest constellation point
- rot = 1
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.gray_to_binary[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.ungray_to_binary[arity])
-
-
- # unpack the k bit vector into a stream of bits
- self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.pre_scaler, self.agc, self.rrc_filter, self.receiver,
- self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 3
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nDemodulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
- print "Costas Loop alpha: %.2e" % self._costas_alpha
- print "Costas Loop beta: %.2e" % self._costas_beta
- print "M&M mu: %.2f" % self._mm_mu
- print "M&M mu gain: %.2e" % self._mm_gain_mu
- print "M&M omega: %.2f" % self._mm_omega
- print "M&M omega gain: %.2e" % self._mm_gain_omega
- print "M&M omega limit: %.2f" % self._mm_omega_relative_limit
-
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.pre_scaler,
- gr.file_sink(gr.sizeof_gr_complex, "rx_prescaler.dat"))
- self.connect(self.agc,
- gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rx_rrc_filter.dat"))
- self.connect(self.receiver,
- gr.file_sink(gr.sizeof_gr_complex, "rx_receiver.dat"))
- self.connect(self.diffdec,
- gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
- self.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "rx_gray_decoder.dat"))
- self.connect(self.unpack,
- gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
-
- def add_options(parser):
- """
- Adds modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- parser.add_option("", "--costas-alpha", type="float", default=_def_costas_alpha,
- help="set Costas loop alpha value [default=%default] (PSK)")
- parser.add_option("", "--gain-mu", type="float", default=_def_gain_mu,
- help="set M&M symbol sync loop gain mu value [default=%default] (PSK)")
- parser.add_option("", "--mu", type="float", default=_def_mu,
- help="set M&M symbol sync loop mu value [default=%default] (PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(
- d8psk_demod.__init__, ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-#
-# Add these to the mod/demod registry
-#
-# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-modulation_utils.add_type_1_mod('d8psk', d8psk_mod)
-modulation_utils.add_type_1_demod('d8psk', d8psk_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py b/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
deleted file mode 100644
index 55e4890f3..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
+++ /dev/null
@@ -1,363 +0,0 @@
-#
-# Copyright 2005,2006,2007,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-differential BPSK modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import psk
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = 0.1
-_def_gain_mu = None
-_def_mu = 0.5
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DBPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class dbpsk_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered differential BPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per baud >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param log: Log modulation data to files?
- @type log: bool
- """
-
- gr.hier_block2.__init__(self, "dbpsk_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(self._samples_per_symbol, int) or self._samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % self._samples_per_symbol)
-
- ntaps = 11 * self._samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- self.chunks2symbols = gr.chunks_to_symbols_bc(psk.constellation[arity])
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (samples_per_symbol since we're
- # interpolating by samples_per_symbol)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol,
- self.rrc_taps)
-
- # Connect
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # static method that's also callable on an instance
- return 1
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def add_options(parser):
- """
- Adds DBPSK modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default]")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=True,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(dbpsk_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
- def _print_verbage(self):
- print "\nModulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.dat"))
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DBPSK demodulator
-#
-# Differentially coherent detection of differentially encoded BPSK
-# /////////////////////////////////////////////////////////////////////////////
-
-class dbpsk_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered differential BPSK demodulation
-
- The input is the complex modulated signal at baseband.
- The output is a stream of bits packed 1 bit per byte (LSB)
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: float
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param costas_alpha: loop filter gain
- @type costas_alphas: float
- @param gain_mu: for M&M block
- @type gain_mu: float
- @param mu: for M&M block
- @type mu: float
- @param omega_relative_limit: for M&M block
- @type omega_relative_limit: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "dbpsk_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._costas_alpha = costas_alpha
- self._mm_gain_mu = gain_mu
- self._mm_mu = mu
- self._mm_omega_relative_limit = omega_relative_limit
- self._gray_code = gray_code
-
- if samples_per_symbol < 2:
- raise TypeError, "samples_per_symbol must be >= 2, is %r" % (samples_per_symbol,)
-
- arity = pow(2,self.bits_per_symbol())
-
- # Automatic gain control
- #scale = (1.0/16384.0)
- #self.pre_scaler = gr.multiply_const_cc(scale) # scale the signal from full-range to +-1
- self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100)
- #self.agc = gr.feedforward_agc_cc(16, 2.0)
-
- # RRC data filter
- ntaps = 11 * samples_per_symbol
- self.rrc_taps = gr.firdes.root_raised_cosine(
- 1.0, # gain
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
- self.rrc_filter=gr.interp_fir_filter_ccf(1, self.rrc_taps)
-
- # symbol clock recovery
- if not self._mm_gain_mu:
- self._mm_gain_mu = 0.1
-
- self._mm_omega = self._samples_per_symbol
- self._mm_gain_omega = .25 * self._mm_gain_mu * self._mm_gain_mu
- self._costas_beta = 0.25 * self._costas_alpha * self._costas_alpha
- fmin = -0.25
- fmax = 0.25
-
- self.receiver=gr.mpsk_receiver_cc(arity, 0,
- self._costas_alpha, self._costas_beta,
- fmin, fmax,
- self._mm_mu, self._mm_gain_mu,
- self._mm_omega, self._mm_gain_omega,
- self._mm_omega_relative_limit)
-
- # Do differential decoding based on phase change of symbols
- self.diffdec = gr.diff_phasor_cc()
-
- # find closest constellation point
- rot = 1
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.gray_to_binary[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.ungray_to_binary[arity])
-
- # unpack the k bit vector into a stream of bits
- self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect and Initialize base class
- self.connect(self, self.agc, self.rrc_filter, self.receiver,
- self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 1
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nDemodulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
- print "Costas Loop alpha: %.2e" % self._costas_alpha
- print "Costas Loop beta: %.2e" % self._costas_beta
- print "M&M mu: %.2f" % self._mm_mu
- print "M&M mu gain: %.2e" % self._mm_gain_mu
- print "M&M omega: %.2f" % self._mm_omega
- print "M&M omega gain: %.2e" % self._mm_gain_omega
- print "M&M omega limit: %.2f" % self._mm_omega_relative_limit
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.pre_scaler,
- gr.file_sink(gr.sizeof_gr_complex, "rx_prescaler.dat"))
- self.connect(self.agc,
- gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rx_rrc_filter.dat"))
- self.connect(self.receiver,
- gr.file_sink(gr.sizeof_gr_complex, "rx_receiver.dat"))
- self.connect(self.diffdec,
- gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
- self.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "rx_symbol_mapper.dat"))
- self.connect(self.unpack,
- gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
-
- def add_options(parser):
- """
- Adds DBPSK demodulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- parser.add_option("", "--costas-alpha", type="float", default=None,
- help="set Costas loop alpha value [default=%default] (PSK)")
- parser.add_option("", "--gain-mu", type="float", default=_def_gain_mu,
- help="set M&M symbol sync loop gain mu value [default=%default] (GMSK/PSK)")
- parser.add_option("", "--mu", type="float", default=_def_mu,
- help="set M&M symbol sync loop mu value [default=%default] (GMSK/PSK)")
- parser.add_option("", "--omega-relative-limit", type="float", default=_def_omega_relative_limit,
- help="M&M clock recovery omega relative limit [default=%default] (GMSK/PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(
- dbpsk_demod.__init__, ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-#
-# Add these to the mod/demod registry
-#
-modulation_utils.add_type_1_mod('dbpsk', dbpsk_mod)
-modulation_utils.add_type_1_demod('dbpsk', dbpsk_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk2.py b/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk2.py
deleted file mode 100644
index d7bcf5390..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk2.py
+++ /dev/null
@@ -1,369 +0,0 @@
-#
-# Copyright 2009,2010 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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-differential BPSK modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils2
-from math import pi, sqrt, ceil
-import psk
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_freq_alpha = 0.010
-_def_phase_alpha = 0.1
-_def_timing_alpha = 0.100
-_def_timing_beta = 0.010
-_def_timing_max_dev = 1.5
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DBPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class dbpsk2_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered differential BPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per baud >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param log: Log modulation data to files?
- @type log: bool
- """
-
- gr.hier_block2.__init__(self, "dbpsk_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if self._samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % self._samples_per_symbol)
-
- arity = pow(2,self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- self.chunks2symbols = gr.chunks_to_symbols_bc(psk.constellation[arity])
-
- # pulse shaping filter
- nfilts = 32
- ntaps = nfilts * 11 * int(self._samples_per_symbol) # make nfilts filters of ntaps each
- self.rrc_taps = gr.firdes.root_raised_cosine(
- nfilts, # gain
- nfilts, # sampling rate based on 32 filters in resampler
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
- self.rrc_filter = gr.pfb_arb_resampler_ccf(self._samples_per_symbol, self.rrc_taps)
-
- # Connect
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # static method that's also callable on an instance
- return 1
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def add_options(parser):
- """
- Adds DBPSK modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default]")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=True,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils2.extract_kwargs_from_options(dbpsk2_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
- def _print_verbage(self):
- print "\nModulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.dat"))
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DBPSK demodulator
-#
-# Differentially coherent detection of differentially encoded BPSK
-# /////////////////////////////////////////////////////////////////////////////
-
-class dbpsk2_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- freq_alpha=_def_freq_alpha,
- phase_alpha=_def_phase_alpha,
- timing_alpha=_def_timing_alpha,
- timing_max_dev=_def_timing_max_dev,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log,
- sync_out=False):
- """
- Hierarchical block for RRC-filtered differential BPSK demodulation
-
- The input is the complex modulated signal at baseband.
- The output is a stream of bits packed 1 bit per byte (LSB)
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: float
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param freq_alpha: loop filter gain for frequency recovery
- @type freq_alpha: float
- @param phase_alpha: loop filter gain for phase/fine frequency recovery
- @type phase_alpha: float
- @param timing_alpha: loop alpha gain for timing recovery
- @type timing_alpha: float
- @param timing_max: timing loop maximum rate deviations
- @type timing_max: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param log: Print modualtion data to files?
- @type log: bool
- @param sync_out: Output a sync signal on :1?
- @type sync_out: bool
- """
- if sync_out: io_sig_out = gr.io_signaturev(2, 2, (gr.sizeof_char, gr.sizeof_gr_complex))
- else: io_sig_out = gr.io_signature(1, 1, gr.sizeof_char)
-
- gr.hier_block2.__init__(self, "dqpsk2_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- io_sig_out) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._freq_alpha = freq_alpha
- self._freq_beta = 0.10*self._freq_alpha
- self._phase_alpha = phase_alpha
- self._timing_alpha = timing_alpha
- self._timing_beta = _def_timing_beta
- self._timing_max_dev=timing_max_dev
- self._gray_code = gray_code
-
- if samples_per_symbol < 2:
- raise TypeError, "samples_per_symbol must be >= 2, is %r" % (samples_per_symbol,)
-
- arity = pow(2,self.bits_per_symbol())
-
- # Automatic gain control
- self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100)
- #self.agc = gr.feedforward_agc_cc(16, 1.0)
-
- # Frequency correction
- self.freq_recov = gr.fll_band_edge_cc(self._samples_per_symbol, self._excess_bw,
- 11*int(self._samples_per_symbol),
- self._freq_alpha, self._freq_beta)
-
- # symbol timing recovery with RRC data filter
- nfilts = 32
- ntaps = 11 * int(self._samples_per_symbol*nfilts)
- taps = gr.firdes.root_raised_cosine(nfilts, nfilts,
- 1.0/float(self._samples_per_symbol),
- self._excess_bw, ntaps)
- self.time_recov = gr.pfb_clock_sync_ccf(self._samples_per_symbol,
- self._timing_alpha,
- taps, nfilts, nfilts/2, self._timing_max_dev)
- self.time_recov.set_beta(self._timing_beta)
-
- # Perform phase / fine frequency correction
- self._phase_beta = 0.25 * self._phase_alpha * self._phase_alpha
- # Allow a frequency swing of +/- half of the sample rate
- fmin = -0.5
- fmax = 0.5
-
- self.phase_recov = gr.costas_loop_cc(self._phase_alpha,
- self._phase_beta,
- fmax, fmin, arity)
-
- # Do differential decoding based on phase change of symbols
- self.diffdec = gr.diff_phasor_cc()
-
- # find closest constellation point
- rot = 1
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.gray_to_binary[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.ungray_to_binary[arity])
-
- # unpack the k bit vector into a stream of bits
- self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.agc,
- self.freq_recov, self.time_recov, self.phase_recov,
- self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
- if sync_out: self.connect(self.time_recov, (self, 1))
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 1
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nDemodulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
- print "FLL gain: %.2e" % self._freq_alpha
- print "Timing alpha gain: %.2e" % self._timing_alpha
- print "Timing beta gain: %.2e" % self._timing_beta
- print "Timing max dev: %.2f" % self._timing_max_dev
- print "Phase track alpha: %.2e" % self._phase_alpha
- print "Phase track beta: %.2e" % self._phase_beta
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.agc,
- gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
- self.connect(self.freq_recov,
- gr.file_sink(gr.sizeof_gr_complex, "rx_freq_recov.dat"))
- self.connect(self.time_recov,
- gr.file_sink(gr.sizeof_gr_complex, "rx_time_recov.dat"))
- self.connect(self.phase_recov,
- gr.file_sink(gr.sizeof_gr_complex, "rx_phase_recov.dat"))
- self.connect(self.diffdec,
- gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
- self.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "rx_symbol_mapper.dat"))
- self.connect(self.unpack,
- gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
-
- def add_options(parser):
- """
- Adds DBPSK demodulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- parser.add_option("", "--freq-alpha", type="float", default=_def_freq_alpha,
- help="set frequency lock loop alpha gain value [default=%default] (PSK)")
- parser.add_option("", "--phase-alpha", type="float", default=_def_phase_alpha,
- help="set phase tracking loop alpha value [default=%default] (PSK)")
- parser.add_option("", "--timing-alpha", type="float", default=_def_timing_alpha,
- help="set timing symbol sync loop gain alpha value [default=%default] (GMSK/PSK)")
- parser.add_option("", "--timing-beta", type="float", default=_def_timing_beta,
- help="set timing symbol sync loop gain beta value [default=%default] (GMSK/PSK)")
- parser.add_option("", "--timing-max-dev", type="float", default=_def_timing_max_dev,
- help="set timing symbol sync loop maximum deviation [default=%default] (GMSK/PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils2.extract_kwargs_from_options(
- dbpsk2_demod.__init__, ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-#
-# Add these to the mod/demod registry
-#
-modulation_utils2.add_type_1_mod('dbpsk2', dbpsk2_mod)
-modulation_utils2.add_type_1_demod('dbpsk2', dbpsk2_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py b/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
deleted file mode 100644
index 42d534168..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk.py
+++ /dev/null
@@ -1,363 +0,0 @@
-#
-# Copyright 2005,2006,2007,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-differential QPSK modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import psk
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = 0.15
-_def_gain_mu = None
-_def_mu = 0.5
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DQPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class dqpsk_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "dqpsk_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = .707 + .707j
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (sps since we're interpolating by sps)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
-
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect & Initialize base class
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 2
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nModulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRS roll-off factor: %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds QPSK modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(dqpsk_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DQPSK demodulator
-#
-# Differentially coherent detection of differentially encoded qpsk
-# /////////////////////////////////////////////////////////////////////////////
-
-class dqpsk_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered DQPSK demodulation
-
- The input is the complex modulated signal at baseband.
- The output is a stream of bits packed 1 bit per byte (LSB)
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: float
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param costas_alpha: loop filter gain
- @type costas_alphas: float
- @param gain_mu: for M&M block
- @type gain_mu: float
- @param mu: for M&M block
- @type mu: float
- @param omega_relative_limit: for M&M block
- @type omega_relative_limit: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "dqpsk_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._costas_alpha = costas_alpha
- self._mm_gain_mu = gain_mu
- self._mm_mu = mu
- self._mm_omega_relative_limit = omega_relative_limit
- self._gray_code = gray_code
-
- if samples_per_symbol < 2:
- raise TypeError, "sbp must be >= 2, is %d" % samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # Automatic gain control
- scale = (1.0/16384.0)
- self.pre_scaler = gr.multiply_const_cc(scale) # scale the signal from full-range to +-1
- #self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100)
- self.agc = gr.feedforward_agc_cc(16, 2.0)
-
- # RRC data filter
- ntaps = 11 * samples_per_symbol
- self.rrc_taps = gr.firdes.root_raised_cosine(
- 1.0, # gain
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
- self.rrc_filter=gr.interp_fir_filter_ccf(1, self.rrc_taps)
-
- if not self._mm_gain_mu:
- sbs_to_mm = {2: 0.050, 3: 0.075, 4: 0.11, 5: 0.125, 6: 0.15, 7: 0.15}
- self._mm_gain_mu = sbs_to_mm[samples_per_symbol]
-
- self._mm_omega = self._samples_per_symbol
- self._mm_gain_omega = .25 * self._mm_gain_mu * self._mm_gain_mu
- self._costas_beta = 0.25 * self._costas_alpha * self._costas_alpha
- fmin = -0.25
- fmax = 0.25
-
- self.receiver=gr.mpsk_receiver_cc(arity, pi/4.0,
- self._costas_alpha, self._costas_beta,
- fmin, fmax,
- self._mm_mu, self._mm_gain_mu,
- self._mm_omega, self._mm_gain_omega,
- self._mm_omega_relative_limit)
-
- # Perform Differential decoding on the constellation
- self.diffdec = gr.diff_phasor_cc()
-
- # find closest constellation point
- rot = 1
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.gray_to_binary[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.ungray_to_binary[arity])
-
- # unpack the k bit vector into a stream of bits
- self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect & Initialize base class
- self.connect(self, self.pre_scaler, self.agc, self.rrc_filter, self.receiver,
- self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 2
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nDemodulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
- print "Costas Loop alpha: %.2e" % self._costas_alpha
- print "Costas Loop beta: %.2e" % self._costas_beta
- print "M&M mu: %.2f" % self._mm_mu
- print "M&M mu gain: %.2e" % self._mm_gain_mu
- print "M&M omega: %.2f" % self._mm_omega
- print "M&M omega gain: %.2e" % self._mm_gain_omega
- print "M&M omega limit: %.2f" % self._mm_omega_relative_limit
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.pre_scaler,
- gr.file_sink(gr.sizeof_gr_complex, "rx_prescaler.dat"))
- self.connect(self.agc,
- gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rx_rrc_filter.dat"))
- self.connect(self.receiver,
- gr.file_sink(gr.sizeof_gr_complex, "rx_receiver.dat"))
- self.connect(self.diffdec,
- gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
- self.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "rx_gray_decoder.dat"))
- self.connect(self.unpack,
- gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
-
- def add_options(parser):
- """
- Adds modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- parser.add_option("", "--costas-alpha", type="float", default=_def_costas_alpha,
- help="set Costas loop alpha value [default=%default] (PSK)")
- parser.add_option("", "--gain-mu", type="float", default=_def_gain_mu,
- help="set M&M symbol sync loop gain mu value [default=%default] (PSK)")
- parser.add_option("", "--mu", type="float", default=_def_mu,
- help="set M&M symbol sync loop mu value [default=%default] (PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(
- dqpsk_demod.__init__, ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-#
-# Add these to the mod/demod registry
-#
-modulation_utils.add_type_1_mod('dqpsk', dqpsk_mod)
-modulation_utils.add_type_1_demod('dqpsk', dqpsk_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk2.py b/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk2.py
deleted file mode 100644
index e1e627707..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/dqpsk2.py
+++ /dev/null
@@ -1,377 +0,0 @@
-#
-# Copyright 2009,2010 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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-differential QPSK modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils2
-from math import pi, sqrt
-import psk
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_freq_alpha = 0.010
-_def_phase_alpha = 0.01
-_def_timing_alpha = 0.100
-_def_timing_beta = 0.010
-_def_timing_max_dev = 1.5
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DQPSK modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class dqpsk2_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "dqpsk2_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if samples_per_symbol < 2:
- raise TypeError, ("sbp must be >= 2, is %f" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = .707 + .707j
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- nfilts = 32
- ntaps = 11 * int(nfilts * self._samples_per_symbol) # make nfilts filters of ntaps each
- self.rrc_taps = gr.firdes.root_raised_cosine(
- nfilts, # gain
- nfilts, # sampling rate based on 32 filters in resampler
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
- self.rrc_filter = gr.pfb_arb_resampler_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect & Initialize base class
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 2
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nModulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRS roll-off factor: %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "tx_graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "tx_diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds QPSK modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils2.extract_kwargs_from_options(dqpsk2_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# DQPSK demodulator
-#
-# Differentially coherent detection of differentially encoded qpsk
-# /////////////////////////////////////////////////////////////////////////////
-
-class dqpsk2_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- freq_alpha=_def_freq_alpha,
- phase_alpha=_def_phase_alpha,
- timing_alpha=_def_timing_alpha,
- timing_max_dev=_def_timing_max_dev,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log,
- sync_out=False):
- """
- Hierarchical block for RRC-filtered DQPSK demodulation
-
- The input is the complex modulated signal at baseband.
- The output is a stream of bits packed 1 bit per byte (LSB)
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: float
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param freq_alpha: loop filter gain for frequency recovery
- @type freq_alpha: float
- @param phase_alpha: loop filter gain
- @type phase_alphas: float
- @param timing_alpha: timing loop alpha gain
- @type timing_alpha: float
- @param timing_max: timing loop maximum rate deviations
- @type timing_max: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param log: Print modualtion data to files?
- @type log: bool
- @param sync_out: Output a sync signal on :1?
- @type sync_out: bool
- """
- if sync_out: io_sig_out = gr.io_signaturev(2, 2, (gr.sizeof_char, gr.sizeof_gr_complex))
- else: io_sig_out = gr.io_signature(1, 1, gr.sizeof_char)
-
- gr.hier_block2.__init__(self, "dqpsk2_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- io_sig_out) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._freq_alpha = freq_alpha
- self._freq_beta = 0.25*self._freq_alpha**2
- self._phase_alpha = phase_alpha
- self._timing_alpha = timing_alpha
- self._timing_beta = _def_timing_beta
- self._timing_max_dev=timing_max_dev
- self._gray_code = gray_code
-
- if samples_per_symbol < 2:
- raise TypeError, "sbp must be >= 2, is %d" % samples_per_symbol
-
- arity = pow(2,self.bits_per_symbol())
-
- # Automatic gain control
- self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100)
- #self.agc = gr.feedforward_agc_cc(16, 2.0)
-
- # Frequency correction
- self.freq_recov = gr.fll_band_edge_cc(self._samples_per_symbol, self._excess_bw,
- 11*int(self._samples_per_symbol),
- self._freq_alpha, self._freq_beta)
-
-
- # symbol timing recovery with RRC data filter
- nfilts = 32
- ntaps = 11 * int(samples_per_symbol*nfilts)
- taps = gr.firdes.root_raised_cosine(nfilts, nfilts,
- 1.0/float(self._samples_per_symbol),
- self._excess_bw, ntaps)
- self.time_recov = gr.pfb_clock_sync_ccf(self._samples_per_symbol,
- self._timing_alpha,
- taps, nfilts, nfilts/2, self._timing_max_dev)
- self.time_recov.set_beta(self._timing_beta)
-
-
- # Perform phase / fine frequency correction
- self._phase_beta = 0.25 * self._phase_alpha * self._phase_alpha
- # Allow a frequency swing of +/- half of the sample rate
- fmin = -0.5
- fmax = 0.5
-
- self.phase_recov = gr.costas_loop_cc(self._phase_alpha,
- self._phase_beta,
- fmax, fmin, arity)
-
-
- # Perform Differential decoding on the constellation
- self.diffdec = gr.diff_phasor_cc()
-
- # find closest constellation point
- rot = 1
- rotated_const = map(lambda pt: pt * rot, psk.constellation[arity])
- self.slicer = gr.constellation_decoder_cb(rotated_const, range(arity))
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(psk.gray_to_binary[arity])
- else:
- self.symbol_mapper = gr.map_bb(psk.ungray_to_binary[arity])
-
- # unpack the k bit vector into a stream of bits
- self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.agc,
- self.freq_recov, self.time_recov, self.phase_recov,
- self.diffdec, self.slicer, self.symbol_mapper, self.unpack, self)
- if sync_out: self.connect(self.time_recov, (self, 1))
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 2
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "\nDemodulator:"
- print "bits per symbol: %d" % self.bits_per_symbol()
- print "Gray code: %s" % self._gray_code
- print "RRC roll-off factor: %.2f" % self._excess_bw
- print "FLL gain: %.2f" % self._freq_alpha
- print "Timing alpha gain: %.2f" % self._timing_alpha
- print "Timing beta gain: %.2f" % self._timing_beta
- print "Timing max dev: %.2f" % self._timing_max_dev
- print "Phase track alpha: %.2e" % self._phase_alpha
- print "Phase track beta: %.2e" % self._phase_beta
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.agc,
- gr.file_sink(gr.sizeof_gr_complex, "rx_agc.dat"))
- self.connect(self.freq_recov,
- gr.file_sink(gr.sizeof_gr_complex, "rx_freq_recov.dat"))
- self.connect(self.time_recov,
- gr.file_sink(gr.sizeof_gr_complex, "rx_time_recov.dat"))
- self.connect(self.phase_recov,
- gr.file_sink(gr.sizeof_gr_complex, "rx_phase_recov.dat"))
- self.connect(self.diffdec,
- gr.file_sink(gr.sizeof_gr_complex, "rx_diffdec.dat"))
- self.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "rx_slicer.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "rx_gray_decoder.dat"))
- self.connect(self.unpack,
- gr.file_sink(gr.sizeof_char, "rx_unpack.dat"))
-
- def add_options(parser):
- """
- Adds DQPSK demodulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- parser.add_option("", "--freq-alpha", type="float", default=_def_freq_alpha,
- help="set frequency lock loop alpha gain value [default=%default] (PSK)")
- parser.add_option("", "--phase-alpha", type="float", default=_def_phase_alpha,
- help="set phase tracking loop alpha value [default=%default] (PSK)")
- parser.add_option("", "--timing-alpha", type="float", default=_def_timing_alpha,
- help="set timing symbol sync loop gain alpha value [default=%default] (GMSK/PSK)")
- parser.add_option("", "--timing-beta", type="float", default=_def_timing_beta,
- help="set timing symbol sync loop gain beta value [default=%default] (GMSK/PSK)")
- parser.add_option("", "--timing-max-dev", type="float", default=_def_timing_max_dev,
- help="set timing symbol sync loop maximum deviation [default=%default] (GMSK/PSK)")
- add_options=staticmethod(add_options)
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils2.extract_kwargs_from_options(
- dqpsk2_demod.__init__, ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-#
-# Add these to the mod/demod registry
-#
-modulation_utils2.add_type_1_mod('dqpsk2', dqpsk2_mod)
-modulation_utils2.add_type_1_demod('dqpsk2', dqpsk2_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py b/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py
index 1910b5011..55870513a 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py
@@ -88,7 +88,7 @@ class demod_20k0f3e_cf(fm_demod_cf):
fm_demod_cf.__init__(self, channel_rate, audio_decim,
5000, # Deviation
3000, # Audio passband frequency
- 4000) # Audio stopband frequency
+ 4500) # Audio stopband frequency
class demod_200kf3e_cf(fm_demod_cf):
"""
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py
index 62f40582e..3aadf700b 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py
@@ -73,3 +73,56 @@ class pfb_arb_resampler_ccf(gr.hier_block2):
def set_rate(self, rate):
self.pfb.set_rate(rate)
+
+
+class pfb_arb_resampler_fff(gr.hier_block2):
+ '''
+ Convenience wrapper for the polyphase filterbank arbitrary resampler.
+
+ The block takes a single float stream in and outputs a single float
+ stream out. As such, it requires no extra glue to handle the input/output
+ streams. This block is provided to be consistent with the interface to the
+ other PFB block.
+ '''
+ def __init__(self, rate, taps=None, flt_size=32, atten=100):
+ gr.hier_block2.__init__(self, "pfb_arb_resampler_fff",
+ gr.io_signature(1, 1, gr.sizeof_float), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_float)) # Output signature
+
+ self._rate = rate
+ self._size = flt_size
+
+ if taps is not None:
+ self._taps = taps
+ else:
+ # Create a filter that covers the full bandwidth of the input signal
+ bw = 0.4
+ tb = 0.2
+ ripple = 0.1
+ #self._taps = gr.firdes.low_pass_2(self._size, self._size, bw, tb, atten)
+ made = False
+ while not made:
+ try:
+ self._taps = optfir.low_pass(self._size, self._size, bw, bw+tb, ripple, atten)
+ made = True
+ except RuntimeError:
+ ripple += 0.01
+ made = False
+ print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple))
+
+ # Build in an exit strategy; if we've come this far, it ain't working.
+ if(ripple >= 1.0):
+ raise RuntimeError("optfir could not generate an appropriate filter.")
+
+ self.pfb = gr.pfb_arb_resampler_fff(self._rate, self._taps, self._size)
+ #print "PFB has %d taps\n" % (len(self._taps),)
+
+ self.connect(self, self.pfb)
+ self.connect(self.pfb, self)
+
+ # Note -- set_taps not implemented in base class yet
+ def set_taps(self, taps):
+ self.pfb.set_taps(taps)
+
+ def set_rate(self, rate):
+ self.pfb.set_rate(rate)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py b/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py
deleted file mode 100644
index 0bdb9c6fb..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/qam16.py
+++ /dev/null
@@ -1,208 +0,0 @@
-#
-# Copyright 2005,2006,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-QAM16 modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import qam
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = None
-_def_gain_mu = 0.03
-_def_mu = 0.05
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM16 modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam16_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "qam16_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2, self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(qam.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(qam.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = 1.0
- print "constellation with %d arity" % arity
- rotated_const = map(lambda pt: pt * rot, qam.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (sps since we're interpolating by sps)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
-
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 4
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gray code = %s" % self._gray_code
- print "RRS roll-off factor = %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds QAM modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(qam16_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM16 demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam16_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- gr.hier_block2.__init__(self, "qam16_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
- # do this
- pass
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 4
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
-#
-# Add these to the mod/demod registry
-#
-# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-#modulation_utils.add_type_1_mod('qam16', qam16_mod)
-#modulation_utils.add_type_1_demod('qam16', qam16_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py b/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py
deleted file mode 100644
index fc455f17c..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/qam256.py
+++ /dev/null
@@ -1,209 +0,0 @@
-#
-# Copyright 2005,2006,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-QAM256 modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import qam
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = None
-_def_gain_mu = 0.03
-_def_mu = 0.05
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM256 modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam256_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "qam256_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2, self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(qam.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(qam.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = 1.0
- print "constellation with %d arity" % arity
- rotated_const = map(lambda pt: pt * rot, qam.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (sps since we're interpolating by sps)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
-
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 8
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gray code = %s" % self._gray_code
- print "RRS roll-off factor = %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds QAM modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(qam256_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM256 demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam256_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- gr.hier_block2.__init__(self, "qam256_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
-
- # do this
- pass
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 8
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
-#
-# Add these to the mod/demod registry
-#
-# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-#modulation_utils.add_type_1_mod('qam256', qam256_mod)
-#modulation_utils.add_type_1_demod('qam256', qam256_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py b/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py
deleted file mode 100644
index 5509f3745..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/qam64.py
+++ /dev/null
@@ -1,208 +0,0 @@
-#
-# Copyright 2005,2006,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-differential QPSK modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import qam
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = None
-_def_gain_mu = 0.03
-_def_mu = 0.05
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM64 modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam64_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "qam64_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2, self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(qam.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(qam.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = 1.0
- print "constellation with %d arity" % arity
- rotated_const = map(lambda pt: pt * rot, qam.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (sps since we're interpolating by sps)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
-
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 6
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gray code = %s" % self._gray_code
- print "RRS roll-off factor = %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds QAM modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(qam64_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM16 demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam64_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- gr.hier_block2.__init__(self, "qam64_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
-
- # do this
- pass
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 6
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
-#
-# Add these to the mod/demod registry
-#
-# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-#modulation_utils.add_type_1_mod('qam64', qam64_mod)
-#modulation_utils.add_type_1_demod('qam16', qam16_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py b/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py
deleted file mode 100644
index 6a7b35597..000000000
--- a/gnuradio-core/src/python/gnuradio/blks2impl/qam8.py
+++ /dev/null
@@ -1,209 +0,0 @@
-#
-# Copyright 2005,2006,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.
-#
-
-# See gnuradio-examples/python/digital for examples
-
-"""
-QAM8 modulation and demodulation.
-"""
-
-from gnuradio import gr, gru, modulation_utils
-from math import pi, sqrt
-import qam
-import cmath
-from pprint import pprint
-
-# default values (used in __init__ and add_options)
-_def_samples_per_symbol = 2
-_def_excess_bw = 0.35
-_def_gray_code = True
-_def_verbose = False
-_def_log = False
-
-_def_costas_alpha = None
-_def_gain_mu = 0.03
-_def_mu = 0.05
-_def_omega_relative_limit = 0.005
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM8 modulator
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam8_mod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- """
- Hierarchical block for RRC-filtered QPSK modulation.
-
- The input is a byte stream (unsigned char) and the
- output is the complex modulated signal at baseband.
-
- @param samples_per_symbol: samples per symbol >= 2
- @type samples_per_symbol: integer
- @param excess_bw: Root-raised cosine filter excess bandwidth
- @type excess_bw: float
- @param gray_code: Tell modulator to Gray code the bits
- @type gray_code: bool
- @param verbose: Print information about modulator?
- @type verbose: bool
- @param debug: Print modualtion data to files?
- @type debug: bool
- """
-
- gr.hier_block2.__init__(self, "qam8_mod",
- gr.io_signature(1, 1, gr.sizeof_char), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- self._samples_per_symbol = samples_per_symbol
- self._excess_bw = excess_bw
- self._gray_code = gray_code
-
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("sbp must be an integer >= 2, is %d" % samples_per_symbol)
-
- ntaps = 11 * samples_per_symbol
-
- arity = pow(2, self.bits_per_symbol())
-
- # turn bytes into k-bit vectors
- self.bytes2chunks = \
- gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
-
- if self._gray_code:
- self.symbol_mapper = gr.map_bb(qam.binary_to_gray[arity])
- else:
- self.symbol_mapper = gr.map_bb(qam.binary_to_ungray[arity])
-
- self.diffenc = gr.diff_encoder_bb(arity)
-
- rot = 1.0
- print "constellation with %d arity" % arity
- rotated_const = map(lambda pt: pt * rot, qam.constellation[arity])
- self.chunks2symbols = gr.chunks_to_symbols_bc(rotated_const)
-
- # pulse shaping filter
- self.rrc_taps = gr.firdes.root_raised_cosine(
- self._samples_per_symbol, # gain (sps since we're interpolating by sps)
- self._samples_per_symbol, # sampling rate
- 1.0, # symbol rate
- self._excess_bw, # excess bandwidth (roll-off factor)
- ntaps)
-
- self.rrc_filter = gr.interp_fir_filter_ccf(self._samples_per_symbol, self.rrc_taps)
-
- if verbose:
- self._print_verbage()
-
- if log:
- self._setup_logging()
-
- # Connect
- self.connect(self, self.bytes2chunks, self.symbol_mapper, self.diffenc,
- self.chunks2symbols, self.rrc_filter, self)
-
- def samples_per_symbol(self):
- return self._samples_per_symbol
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 3
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
- def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "Gray code = %s" % self._gray_code
- print "RRS roll-off factor = %f" % self._excess_bw
-
- def _setup_logging(self):
- print "Modulation logging turned on."
- self.connect(self.bytes2chunks,
- gr.file_sink(gr.sizeof_char, "bytes2chunks.dat"))
- self.connect(self.symbol_mapper,
- gr.file_sink(gr.sizeof_char, "graycoder.dat"))
- self.connect(self.diffenc,
- gr.file_sink(gr.sizeof_char, "diffenc.dat"))
- self.connect(self.chunks2symbols,
- gr.file_sink(gr.sizeof_gr_complex, "chunks2symbols.dat"))
- self.connect(self.rrc_filter,
- gr.file_sink(gr.sizeof_gr_complex, "rrc_filter.dat"))
-
- def add_options(parser):
- """
- Adds QAM modulation-specific options to the standard parser
- """
- parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
- help="set RRC excess bandwith factor [default=%default] (PSK)")
- parser.add_option("", "--no-gray-code", dest="gray_code",
- action="store_false", default=_def_gray_code,
- help="disable gray coding on modulated bits (PSK)")
- add_options=staticmethod(add_options)
-
-
- def extract_kwargs_from_options(options):
- """
- Given command line options, create dictionary suitable for passing to __init__
- """
- return modulation_utils.extract_kwargs_from_options(qam8_mod.__init__,
- ('self',), options)
- extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# QAM8 demodulator
-#
-# /////////////////////////////////////////////////////////////////////////////
-
-class qam8_demod(gr.hier_block2):
-
- def __init__(self,
- samples_per_symbol=_def_samples_per_symbol,
- excess_bw=_def_excess_bw,
- costas_alpha=_def_costas_alpha,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- gray_code=_def_gray_code,
- verbose=_def_verbose,
- log=_def_log):
-
- gr.hier_block2.__init__(self, "qam8_demod",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
-
- # do this
- pass
-
- def bits_per_symbol(self=None): # staticmethod that's also callable on an instance
- return 3
- bits_per_symbol = staticmethod(bits_per_symbol) # make it a static method. RTFM
-
-#
-# Add these to the mod/demod registry
-#
-# NOT READY TO BE USED YET -- ENABLE AT YOUR OWN RISK
-modulation_utils.add_type_1_mod('qam8', qam8_mod)
-#modulation_utils.add_type_1_demod('qam8', qam8_demod)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py
index 858b9cde6..3a93a11d6 100755
--- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py
+++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py
@@ -28,8 +28,9 @@ class wfm_rcv_fmdet(gr.hier_block2):
"""
Hierarchical block for demodulating a broadcast FM signal.
- The input is the downconverted complex baseband signal (gr_complex).
- The output is two streams of the demodulated audio (float) 0=Left, 1=Right.
+ The input is the downconverted complex baseband signal
+ (gr_complex). The output is two streams of the demodulated
+ audio (float) 0=Left, 1=Right.
@param demod_rate: input sample rate of complex baseband input.
@type demod_rate: float
@@ -39,16 +40,15 @@ class wfm_rcv_fmdet(gr.hier_block2):
gr.hier_block2.__init__(self, "wfm_rcv_fmdet",
gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
gr.io_signature(2, 2, gr.sizeof_float)) # Output signature
- lowfreq = -125e3
- highfreq = 125e3
+ lowfreq = -125e3/demod_rate
+ highfreq = 125e3/demod_rate
audio_rate = demod_rate / audio_decimation
-
- # We assign to self so that outsiders can grab the demodulator
+ # We assign to self so that outsiders can grab the demodulator
# if they need to. E.g., to plot its output.
#
# input: complex; output: float
-
+
self.fm_demod = gr.fmdet_cf (demod_rate, lowfreq, highfreq, 0.05)
# input: float; output: float
@@ -62,25 +62,31 @@ class wfm_rcv_fmdet(gr.hier_block2):
15000 ,
width_of_transition_band,
gr.firdes.WIN_HAMMING)
+
# input: float; output: float
self.audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs)
if 1:
- # Pick off the stereo carrier/2 with this filter. It attenuated 10 dB so apply 10 dB gain
- # We pick off the negative frequency half because we want to base band by it!
- ## NOTE THIS WAS HACKED TO OFFSET INSERTION LOSS DUE TO DEEMPHASIS
+ # Pick off the stereo carrier/2 with this filter. It
+ # attenuated 10 dB so apply 10 dB gain We pick off the
+ # negative frequency half because we want to base band by
+ # it!
+ ## NOTE THIS WAS HACKED TO OFFSET INSERTION LOSS DUE TO
+ ## DEEMPHASIS
stereo_carrier_filter_coeffs = gr.firdes.complex_band_pass(10.0,
- demod_rate,
- -19020,
- -18980,
- width_of_transition_band,
- gr.firdes.WIN_HAMMING)
+ demod_rate,
+ -19020,
+ -18980,
+ width_of_transition_band,
+ gr.firdes.WIN_HAMMING)
#print "len stereo carrier filter = ",len(stereo_carrier_filter_coeffs)
#print "stereo carrier filter ", stereo_carrier_filter_coeffs
#print "width of transition band = ",width_of_transition_band, " audio rate = ", audio_rate
- # Pick off the double side band suppressed carrier Left-Right audio. It is attenuated 10 dB so apply 10 dB gain
+ # Pick off the double side band suppressed carrier
+ # Left-Right audio. It is attenuated 10 dB so apply 10 dB
+ # gain
stereo_dsbsc_filter_coeffs = gr.firdes.complex_band_pass(20.0,
demod_rate,
@@ -90,101 +96,121 @@ class wfm_rcv_fmdet(gr.hier_block2):
gr.firdes.WIN_HAMMING)
#print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs)
#print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs
- # construct overlap add filter system from coefficients for stereo carrier
- self.stereo_carrier_filter = gr.fir_filter_fcc(audio_decimation, stereo_carrier_filter_coeffs)
-
- # carrier is twice the picked off carrier so arrange to do a commplex multiply
+ # construct overlap add filter system from coefficients
+ # for stereo carrier
+ self.stereo_carrier_filter = gr.fir_filter_fcc(audio_decimation,
+ stereo_carrier_filter_coeffs)
+ # carrier is twice the picked off carrier so arrange to do
+ # a commplex multiply
self.stereo_carrier_generator = gr.multiply_cc();
# Pick off the rds signal
-
stereo_rds_filter_coeffs = gr.firdes.complex_band_pass(30.0,
- demod_rate,
- 57000 - 1500,
- 57000 + 1500,
- width_of_transition_band,
- gr.firdes.WIN_HAMMING)
+ demod_rate,
+ 57000 - 1500,
+ 57000 + 1500,
+ width_of_transition_band,
+ gr.firdes.WIN_HAMMING)
#print "len stereo dsbsc filter = ",len(stereo_dsbsc_filter_coeffs)
#print "stereo dsbsc filter ", stereo_dsbsc_filter_coeffs
# construct overlap add filter system from coefficients for stereo carrier
- self.rds_signal_filter = gr.fir_filter_fcc(audio_decimation, stereo_rds_filter_coeffs)
-
-
-
-
-
-
+ self.rds_signal_filter = gr.fir_filter_fcc(audio_decimation,
+ stereo_rds_filter_coeffs)
self.rds_carrier_generator = gr.multiply_cc();
self.rds_signal_generator = gr.multiply_cc();
self_rds_signal_processor = gr.null_sink(gr.sizeof_gr_complex);
-
-
alpha = 5 * 0.25 * math.pi / (audio_rate)
beta = alpha * alpha / 4.0
max_freq = -2.0*math.pi*18990/audio_rate;
- min_freq = -2.0*math.pi*19010/audio_rate;
+ min_freq = -2.0*math.pi*19010/audio_rate;
+ self.stereo_carrier_pll_recovery = gr.pll_refout_cc(alpha,beta,
+ max_freq,
+ min_freq);
+
+ #self.stereo_carrier_pll_recovery.squelch_enable(False)
+ ##pll_refout does not have squelch yet, so disabled for
+ #now
- self.stereo_carrier_pll_recovery = gr.pll_refout_cc(alpha,beta,max_freq,min_freq);
- #self.stereo_carrier_pll_recovery.squelch_enable(False) #pll_refout does not have squelch yet, so disabled for now
-
-
- # set up mixer (multiplier) to get the L-R signal at baseband
+ # set up mixer (multiplier) to get the L-R signal at
+ # baseband
self.stereo_basebander = gr.multiply_cc();
- # pick off the real component of the basebanded L-R signal. The imaginary SHOULD be zero
+ # pick off the real component of the basebanded L-R
+ # signal. The imaginary SHOULD be zero
self.LmR_real = gr.complex_to_real();
self.Make_Left = gr.add_ff();
self.Make_Right = gr.sub_ff();
- self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation, stereo_dsbsc_filter_coeffs)
+ self.stereo_dsbsc_filter = gr.fir_filter_fcc(audio_decimation,
+ stereo_dsbsc_filter_coeffs)
if 1:
- # send the real signal to complex filter to pick off the carrier and then to one side of a multiplier
- self.connect (self, self.fm_demod,self.stereo_carrier_filter,self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,0))
+ # send the real signal to complex filter to pick off the
+ # carrier and then to one side of a multiplier
+ self.connect (self, self.fm_demod, self.stereo_carrier_filter,
+ self.stereo_carrier_pll_recovery,
+ (self.stereo_carrier_generator,0))
+
# send the already filtered carrier to the otherside of the carrier
+ # the resulting signal from this multiplier is the carrier
+ # with correct phase but at -38000 Hz.
self.connect (self.stereo_carrier_pll_recovery, (self.stereo_carrier_generator,1))
- # the resulting signal from this multiplier is the carrier with correct phase but at -38000 Hz.
# send the new carrier to one side of the mixer (multiplier)
self.connect (self.stereo_carrier_generator, (self.stereo_basebander,0))
+
# send the demphasized audio to the DSBSC pick off filter, the complex
# DSBSC signal at +38000 Hz is sent to the other side of the mixer/multiplier
- self.connect (self.fm_demod,self.stereo_dsbsc_filter, (self.stereo_basebander,1))
# the result is BASEBANDED DSBSC with phase zero!
+ self.connect (self.fm_demod,self.stereo_dsbsc_filter, (self.stereo_basebander,1))
- # Pick off the real part since the imaginary is theoretically zero and then to one side of a summer
+ # Pick off the real part since the imaginary is
+ # theoretically zero and then to one side of a summer
self.connect (self.stereo_basebander, self.LmR_real, (self.Make_Left,0))
- #take the same real part of the DSBSC baseband signal and send it to negative side of a subtracter
+
+ #take the same real part of the DSBSC baseband signal and
+ #send it to negative side of a subtracter
self.connect (self.LmR_real,(self.Make_Right,1))
- # Make rds carrier by taking the squared pilot tone and multiplying by pilot tone
+ # Make rds carrier by taking the squared pilot tone and
+ # multiplying by pilot tone
self.connect (self.stereo_basebander,(self.rds_carrier_generator,0))
self.connect (self.stereo_carrier_pll_recovery,(self.rds_carrier_generator,1))
- # take signal, filter off rds, send into mixer 0 channel
+
+ # take signal, filter off rds, send into mixer 0 channel
self.connect (self.fm_demod,self.rds_signal_filter,(self.rds_signal_generator,0))
- # take rds_carrier_generator output and send into mixer 1 channel
+
+ # take rds_carrier_generator output and send into mixer 1
+ # channel
self.connect (self.rds_carrier_generator,(self.rds_signal_generator,1))
- # send basebanded rds signal and send into "processor" which for now is a null sink
+
+ # send basebanded rds signal and send into "processor"
+ # which for now is a null sink
self.connect (self.rds_signal_generator,self_rds_signal_processor)
if 1:
- # pick off the audio, L+R that is what we used to have and send it to the summer
+ # pick off the audio, L+R that is what we used to have and
+ # send it to the summer
self.connect(self.fm_demod, self.audio_filter, (self.Make_Left, 1))
- # take the picked off L+R audio and send it to the PLUS side of the subtractor
+
+ # take the picked off L+R audio and send it to the PLUS
+ # side of the subtractor
self.connect(self.audio_filter,(self.Make_Right, 0))
+
# The result of Make_Left gets (L+R) + (L-R) and results in 2*L
# The result of Make_Right gets (L+R) - (L-R) and results in 2*R
self.connect(self.Make_Left , self.deemph_Left, (self, 0))
self.connect(self.Make_Right, self.deemph_Right, (self, 1))
+
# NOTE: mono support will require variable number of outputs in hier_block2s
# See ticket:174 in Trac database
#else:
diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am
index 45c970227..7bf1c0827 100644
--- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am
+++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am
@@ -49,11 +49,8 @@ noinst_PYTHON = \
qa_argmax.py \
qa_bin_statistics.py \
qa_classify.py \
- qa_cma_equalizer.py \
qa_complex_to_xxx.py \
- qa_constellation_decoder_cb.py \
qa_copy.py \
- qa_correlate_access_code.py \
qa_delay.py \
qa_dc_blocker.py \
qa_diff_encoder.py \
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py
index 47f0ecb22..5977c1b52 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_pll_carriertracking.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2004,2007,2010 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -34,115 +34,114 @@ class test_pll_carriertracking (gr_unittest.TestCase):
def test_pll_carriertracking (self):
expected_result = ((1.00000238419+7.21919457547e-09j),
(0.998025715351+0.062790453434j),
- (0.992878139019+0.119114711881j),
- (0.985585451126+0.16916936636j),
- (0.976963579655+0.21341380477j),
- (0.967643141747+0.252319812775j),
- (0.958120942116+0.286356031895j),
- (0.948766887188+0.315971136093j),
- (0.939851403236+0.341586351395j),
- (0.931558966637+0.363589793444j),
- (0.924019515514+0.382339715958j),
- (0.917312920094+0.398162424564j),
- (0.9114767313+0.411352336407j),
- (0.906515955925+0.422172755003j),
- (0.902329206467+0.431043088436j),
- (0.8989828825+0.437978446484j),
- (0.896438419819+0.443168222904j),
- (0.894643902779+0.446782171726j),
- (0.893543541431+0.448972672224j),
- (0.893085837364+0.449881345034j),
- (0.893211960793+0.449634194374j),
- (0.893862366676+0.448344886303j),
- (0.894974172115+0.446114838123j),
- (0.89649784565+0.443042784929j),
- (0.898379862309+0.439216792583j),
- (0.900570392609+0.434715718031j),
- (0.902926802635+0.429791986942j),
- (0.905423760414+0.424503326416j),
- (0.908115327358+0.418716549873j),
- (0.910964310169+0.412489384413j),
- (0.913929581642+0.405871063471j),
- (0.916985273361+0.398915469646j),
- (0.920104384422+0.391668856144j),
- (0.923261523247+0.384174525738j),
- (0.926428377628+0.376470327377j),
- (0.929587602615+0.3685952425j),
- (0.932724237442+0.360585510731j),
- (0.935822367668+0.352472603321j),
- (0.938865244389+0.344285786152j),
- (0.941773712635+0.336241692305j),
- (0.944620370865+0.328158795834j),
- (0.94739818573+0.32005661726j),
- (0.950098872185+0.311952739954j),
- (0.952714562416+0.303861320019j),
- (0.955247402191+0.295800030231j),
- (0.957694888115+0.287783116102j),
- (0.960053324699+0.279822826385j),
- (0.962315440178+0.271930038929j),
- (0.96448802948+0.264117747545j),
- (0.966570436954+0.256397068501j),
- (0.968563258648+0.248777091503j),
- (0.970409572124+0.241460204124j),
- (0.972127914429+0.234440952539j),
- (0.97377294302+0.227515518665j),
- (0.975345790386+0.220690101385j),
- (0.976839780807+0.213968709111j),
- (0.978262722492+0.207358703017j),
- (0.979616940022+0.200864806771j),
- (0.980905056+0.194491744041j),
- (0.982122182846+0.188243359327j),
- (0.983273088932+0.18212479353j),
- (0.984363257885+0.176140069962j),
- (0.985394001007+0.170292437077j),
- (0.986363172531+0.16458517313j),
- (0.98724168539+0.159217983484j),
- (0.988072276115+0.153976023197j),
- (0.988858819008+0.148855358362j),
- (0.989599764347+0.143855035305j),
- (0.990294575691+0.138971716166j),
- (0.990951240063+0.134203910828j),
- (0.991572141647+0.129550367594j),
- (0.992157161236+0.125009477139j),
- (0.992702245712+0.120578929782j),
- (0.993216574192+0.116259463131j),
- (0.993701457977+0.112050771713j),
- (0.994158565998+0.107951454818j),
- (0.994559407234+0.104160495102j),
- (0.9949182868+0.100662395358j),
- (0.995259582996+0.0972395762801j),
- (0.995584189892+0.0938917249441j),
- (0.995885193348+0.0906178206205j),
- (0.99616932869+0.0874189138412j),
- (0.996438741684+0.0842954516411j),
- (0.996694862843+0.0812477469444j),
- (0.996931552887+0.0782764554024j),
- (0.997152447701+0.0753828883171j),
- (0.997361660004+0.0725681483746j),
- (0.997559130192+0.0698337852955j),
- (0.997741162777+0.067180365324j),
- (0.99789583683+0.0648084580898j),
- (0.998042702675+0.0624987781048j),
- (0.998183488846+0.0602464973927j),
- (0.998314678669+0.0580499768257j),
- (0.998434245586+0.0559054017067j),
- (0.998548746109+0.053810685873j),
- (0.998658537865+0.0517641305923j),
- (0.998762428761+0.0497645735741j),
- (0.998855054379+0.0478102117777j),
- (0.998943626881+0.0459015443921j),
- (0.999028742313+0.0440383702517j))
+ (0.992777824402+0.119947694242j),
+ (0.985192835331+0.171441286802j),
+ (0.976061582565+0.217501848936j),
+ (0.966034710407+0.258409559727j),
+ (0.95565611124+0.294477283955j),
+ (0.945357382298+0.326030552387j),
+ (0.935475051403+0.353395611048j),
+ (0.926258146763+0.376889169216j),
+ (0.917895197868+0.39681750536j),
+ (0.910515546799+0.413470208645j),
+ (0.904196679592+0.427117019892j),
+ (0.898972511292+0.438006043434j),
+ (0.894769787788+0.446523308754j),
+ (0.891652584076+0.452715367079j),
+ (0.8895829916+0.456773489714j),
+ (0.888502895832+0.458873122931j),
+ (0.888343691826+0.459175437689j),
+ (0.889035582542+0.457833081484j),
+ (0.890497922897+0.454985737801j),
+ (0.892645597458+0.450762689114j),
+ (0.895388305187+0.445282936096j),
+ (0.898648142815+0.438664674759j),
+ (0.902342617512+0.431016951799j),
+ (0.906392872334+0.422441422939j),
+ (0.910642921925+0.413191765547j),
+ (0.915039420128+0.403358519077j),
+ (0.919594764709+0.392864197493j),
+ (0.92425006628+0.381792247295j),
+ (0.928944349289+0.370217680931j),
+ (0.933634519577+0.358220815659j),
+ (0.938279032707+0.345874190331j),
+ (0.942840516567+0.333247303963j),
+ (0.947280526161+0.32040438056j),
+ (0.951574921608+0.307409763336j),
+ (0.955703914165+0.294323593378j),
+ (0.959648966789+0.281201630831j),
+ (0.963392794132+0.268095195293j),
+ (0.966880619526+0.255221515894j),
+ (0.970162451267+0.242447137833j),
+ (0.973235487938+0.229809194803j),
+ (0.97609680891+0.217341512442j),
+ (0.978744983673+0.20507311821j),
+ (0.981189727783+0.193033605814j),
+ (0.983436584473+0.181248426437j),
+ (0.985490739346+0.169738590717j),
+ (0.987353682518+0.158523857594j),
+ (0.989041447639+0.147622272372j),
+ (0.990563035011+0.137049794197j),
+ (0.991928339005+0.126818582416j),
+ (0.993117690086+0.117111675441j),
+ (0.994156062603+0.107930034399j),
+ (0.995076179504+0.0990980416536j),
+ (0.995887458324+0.0906178802252j),
+ (0.996591091156+0.0824909061193j),
+ (0.997202515602+0.0747182965279j),
+ (0.997730851173+0.0672992765903j),
+ (0.998185396194+0.0602316558361j),
+ (0.99856698513+0.0535135567188j),
+ (0.998885989189+0.0471420884132j),
+ (0.99915266037+0.0411129891872j),
+ (0.999372899532+0.0354214012623j),
+ (0.999548316002+0.0300626158714j),
+ (0.999680638313+0.0252036750317j),
+ (0.999784469604+0.020652115345j),
+ (0.999865531921+0.0163950324059j),
+ (0.999923825264+0.0124222636223j),
+ (0.999960243702+0.00872156023979j),
+ (0.999983668327+0.00528120994568j),
+ (0.999997138977+0.00209015607834j),
+ (1.00000119209-0.00086285173893j),
+ (0.999992132187-0.00358882546425j),
+ (0.999979138374-0.00609711557627j),
+ (0.999963641167-0.00839691981673j),
+ (0.999947249889-0.0104993218556j),
+ (0.999924004078-0.0122378543019j),
+ (0.999904811382-0.0136305987835j),
+ (0.999888062477-0.0148707330227j),
+ (0.9998742342-0.0159679055214j),
+ (0.999856114388-0.0169314742088j),
+ (0.999839782715-0.0177700817585j),
+ (0.999826967716-0.0184917747974j),
+ (0.999818325043-0.0191045701504j),
+ (0.999807476997-0.0196143388748j),
+ (0.999797284603-0.0200265944004j),
+ (0.999791204929-0.0203481912613j),
+ (0.99978852272-0.0205836892128j),
+ (0.99978530407-0.0207380950451j),
+ (0.999785065651-0.0206423997879j),
+ (0.999787807465-0.0204866230488j),
+ (0.999794304371-0.0202808082104j),
+ (0.999800384045-0.0200312435627j),
+ (0.999803245068-0.0197458267212j),
+ (0.9998087883-0.0194311738014j),
+ (0.999816894531-0.0190933048725j),
+ (0.999825954437-0.0187371373177j),
+ (0.999829888344-0.0183679759502j),
+ (0.999835848808-0.017987690866j),
+ (0.999844014645-0.0176006518304j))
sampling_freq = 10e3
freq = sampling_freq / 100
- alpha = 0.1
- beta = alpha * alpha / 4.0
+ loop_bw = math.pi/100.0
maxf = 1
minf = -1
src = gr.sig_source_c (sampling_freq, gr.GR_COS_WAVE, freq, 1.0)
- pll = gr.pll_carriertracking_cc(alpha, beta, maxf, minf)
+ pll = gr.pll_carriertracking_cc(loop_bw, maxf, minf)
head = gr.head (gr.sizeof_gr_complex, int (freq))
dst = gr.vector_sink_c ()
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py
index a044ca4e3..152026c35 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_pll_freqdet.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2004,2007,2010 Free Software Foundation, Inc.
+# Copyright 2004,2007,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -31,118 +31,117 @@ class test_pll_freqdet (gr_unittest.TestCase):
def tearDown (self):
self.tb = None
- def test_pll_refout (self):
+ def test_pll_freqdet (self):
expected_result = (0.0,
- 1.1489677586e-07,
- 0.972820967928,
- 2.74556447638,
- 5.14063115504,
- 8.00965893424,
- 11.2291407849,
- 14.6967083575,
- 18.3279143967,
- 22.0534772463,
- 25.8170063427,
- 29.5729048372,
- 33.28476877,
- 36.923851464,
- 40.4367920663,
- 43.8452165447,
- 47.1363805488,
- 50.3011890178,
- 53.3336388558,
- 56.2301430274,
- 58.9891659262,
- 61.6107668417,
- 64.0962975824,
- 66.4481415997,
- 68.6694590418,
- 70.7640385293,
- 72.7048794706,
- 74.5033240115,
- 76.2012544926,
- 77.8019140677,
- 79.3088126954,
- 80.7255967005,
- 82.0560428456,
- 83.3039575383,
- 84.473129399,
- 85.5673470484,
- 86.5902864563,
- 87.5456176636,
- 88.4368624865,
- 89.2363977903,
- 89.9861118444,
- 90.6888920639,
- 91.3474657813,
- 91.9644713943,
- 92.5423101413,
- 93.0832765389,
- 93.5894931633,
- 94.0629225081,
- 94.5054203452,
- 94.9186882929,
- 95.3043331057,
- 95.6326268597,
- 95.9117515522,
- 96.1801447842,
- 96.437391527,
- 96.6831953314,
- 96.9173605408,
- 97.1397982206,
- 97.3504727968,
- 97.5493842694,
- 97.7366275022,
- 97.9123032879,
- 98.0766013539,
- 98.2297054988,
- 98.3408027946,
- 98.4487102971,
- 98.5534280064,
- 98.6549025616,
- 98.7531576788,
- 98.848110352,
- 98.9397131494,
- 99.0278712074,
- 99.1124718752,
- 99.193408431,
- 99.2705445084,
- 99.3437733855,
- 99.3817366678,
- 99.391110391,
- 99.4089151289,
- 99.4333959024,
- 99.4630289627,
- 99.4964565726,
- 99.5325047932,
- 99.5701419814,
- 99.6084313579,
- 99.6465902967,
- 99.6838954618,
- 99.7197776709,
- 99.7537270313,
- 99.7542606398,
- 99.7595848672,
- 99.7691305308,
- 99.7823047325,
- 99.7986450115,
- 99.8176059012,
- 99.838724941,
- 99.8615040962,
- 99.8854690481,
- 99.910157336,
- 99.9351302152)
+ 4.33888922882e-08,
+ 0.367369994515,
+ 1.08135249597,
+ 2.10983253908,
+ 3.42221529438,
+ 4.98940390402,
+ 6.78379190842,
+ 8.77923286024,
+ 10.9510106794,
+ 13.2758363182,
+ 15.7317829127,
+ 18.2982902299,
+ 20.9561068599,
+ 23.6755271122,
+ 26.452952094,
+ 29.2731265301,
+ 32.1219053479,
+ 34.9862418188,
+ 37.8540971414,
+ 40.7144315483,
+ 43.5571390869,
+ 46.3730179743,
+ 49.1537231663,
+ 51.8917218889,
+ 54.58026103,
+ 57.2015358514,
+ 59.7513664199,
+ 62.2380533124,
+ 64.657612252,
+ 67.006640002,
+ 69.2822432184,
+ 71.4820384499,
+ 73.6041047056,
+ 75.6469478817,
+ 77.6094829742,
+ 79.4909866472,
+ 81.2911031615,
+ 83.0097850853,
+ 84.6355598352,
+ 86.1820937186,
+ 87.6504420946,
+ 89.0418441206,
+ 90.3577286819,
+ 91.5996432431,
+ 92.7692775646,
+ 93.8684162704,
+ 94.8989269904,
+ 95.8627662892,
+ 96.7619381633,
+ 97.598505899,
+ 98.362769679,
+ 99.0579904444,
+ 99.6992633875,
+ 100.288805948,
+ 100.828805921,
+ 101.321421457,
+ 101.76878699,
+ 102.17300138,
+ 102.536116055,
+ 102.860158727,
+ 103.147085962,
+ 103.398830608,
+ 103.617254366,
+ 103.792467691,
+ 103.939387906,
+ 104.060030865,
+ 104.15631756,
+ 104.230085975,
+ 104.283067372,
+ 104.316933727,
+ 104.333238432,
+ 104.333440018,
+ 104.318914008,
+ 104.290941063,
+ 104.250742554,
+ 104.187634452,
+ 104.103822339,
+ 104.013227468,
+ 103.916810336,
+ 103.815448432,
+ 103.709936239,
+ 103.600997093,
+ 103.489283183,
+ 103.375351833,
+ 103.259712936,
+ 103.142828952,
+ 103.025091195,
+ 102.90686726,
+ 102.776726069,
+ 102.648078982,
+ 102.521459607,
+ 102.397294831,
+ 102.275999684,
+ 102.157882471,
+ 102.043215927,
+ 101.93218978,
+ 101.824958181,
+ 101.72159228,
+ 101.622151366)
sampling_freq = 10e3
freq = sampling_freq / 100
- alpha = 0.2
- beta = alpha * alpha / 4.0
+ loop_bw = math.pi/100.0
maxf = 1
minf = -1
src = gr.sig_source_c (sampling_freq, gr.GR_COS_WAVE, freq, 1.0)
- pll = gr.pll_freqdet_cf(alpha, beta, maxf, minf)
+ pll = gr.pll_freqdet_cf(loop_bw, maxf, minf)
head = gr.head (gr.sizeof_float, int (freq))
dst = gr.vector_sink_f ()
@@ -154,7 +153,7 @@ class test_pll_freqdet (gr_unittest.TestCase):
# convert it from normalized frequency to absolute frequency (Hz)
dst_data = [i*(sampling_freq/(2*math.pi)) for i in dst_data]
-
+
self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 3)
if __name__ == '__main__':
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py b/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py
index c719d901d..4d82ed692 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_pll_refout.py
@@ -33,116 +33,115 @@ class test_pll_refout (gr_unittest.TestCase):
def test_pll_refout (self):
expected_result = ((1+0j),
- (1+7.39965699825e-10j),
- (0.999980390072+0.00626518437639j),
- (0.999828696251+0.0185074303299j),
- (0.999342679977+0.0362518914044j),
- (0.998255133629+0.0590478256345j),
- (0.996255218983+0.0864609181881j),
- (0.993005692959+0.118066303432j),
- (0.988157629967+0.153442293406j),
- (0.981362581253+0.192165210843j),
- (0.972283244133+0.233806177974j),
- (0.960601866245+0.277928203344j),
- (0.946027696133+0.324085712433j),
- (0.928303182125+0.371824204922j),
- (0.907292485237+0.420500129461j),
- (0.882742881775+0.469856321812j),
- (0.854515135288+0.519426465034j),
- (0.822515428066+0.568742752075j),
- (0.786696374416+0.617340147495j),
- (0.747057676315+0.664759278297j),
- (0.703645706177+0.710551023483j),
- (0.656552672386+0.754280149937j),
- (0.605915188789+0.795529305935j),
- (0.551911652088+0.833902597427j),
- (0.494760125875+0.869029581547j),
- (0.43471467495+0.900568246841j),
- (0.37224906683+0.928132891655j),
- (0.307677358389+0.95149075985j),
- (0.241136670113+0.970491170883j),
- (0.17298206687+0.984924972057j),
- (0.103586681187+0.99462044239j),
- (0.0333374515176+0.999444127083j),
- (-0.0373689383268+0.999301552773j),
- (-0.108129791915+0.994136810303j),
- (-0.178540587425+0.983932554722j),
- (-0.248198464513+0.968709230423j),
- (-0.316705435514+0.948523938656j),
- (-0.383672863245+0.92346906662j),
- (-0.448723107576+0.893670797348j),
- (-0.511321544647+0.859389483929j),
- (-0.571328163147+0.820721685886j),
- (-0.628419756889+0.777874410152j),
- (-0.682292759418+0.731079041958j),
- (-0.73266518116+0.680589199066j),
- (-0.779277086258+0.626679480076j),
- (-0.821892678738+0.569642364979j),
- (-0.860300958157+0.509786486626j),
- (-0.894316911697+0.447434008121j),
- (-0.923782110214+0.382918506861j),
- (-0.948564827442+0.316582858562j),
- (-0.968560934067+0.248776495457j),
- (-0.983657181263+0.180051460862j),
- (-0.993847966194+0.110752984881j),
- (-0.999158382416+0.0410190448165j),
- (-0.999585151672-0.0288016609848j),
- (-0.995150506496-0.0983637422323j),
- (-0.985901653767-0.167325690389j),
- (-0.971909880638-0.235353350639j),
- (-0.953269898891-0.302119880915j),
- (-0.930099308491-0.367308050394j),
- (-0.902536988258-0.430612236261j),
- (-0.870742440224-0.491739332676j),
- (-0.834894299507-0.550410330296j),
- (-0.795189321041-0.606361210346j),
- (-0.751972556114-0.659194409847j),
- (-0.705345034599-0.708864152431j),
- (-0.65554022789-0.755160212517j),
- (-0.602804005146-0.79788929224j),
- (-0.547393083572-0.836875617504j),
- (-0.489574193954-0.871961593628j),
- (-0.429622590542-0.903008520603j),
- (-0.367820799351-0.929896712303j),
- (-0.30445766449-0.952525854111j),
- (-0.239826664329-0.970815718174j),
- (-0.174224823713-0.984705924988j),
- (-0.107951194048-0.994156181812j),
- (-0.0415062084794-0.999138236046j),
- (0.0248276274651-0.999691724777j),
- (0.0909758731723-0.995853126049j),
- (0.156649366021-0.987654268742j),
- (0.221562758088-0.975146114826j),
- (0.285434871912-0.958398103714j),
- (0.34799093008-0.937497913837j),
- (0.408963024616-0.912550985813j),
- (0.468091547489-0.883679986j),
- (0.525126516819-0.851024150848j),
- (0.579828321934-0.814738690853j),
- (0.631969094276-0.774993598461j),
- (0.68133354187-0.731973052025j),
- (0.727582633495-0.68602001667j),
- (0.770699501038-0.637198805809j),
- (0.810512304306-0.585721611977j),
- (0.846863090992-0.531810939312j),
- (0.879608631134-0.475698083639j),
- (0.908620357513-0.417623102665j),
- (0.933785498142-0.357833325863j),
- (0.955007135868-0.29658266902j),
- (0.972205162048-0.23413066566j),
- (0.985315918922-0.170741200447j),
- (0.994293212891-0.106681533158j))
+ (1+6.4087357643e-10j),
+ (0.999985277653+0.00542619498447j),
+ (0.999868750572+0.0162021834403j),
+ (0.99948567152+0.0320679470897j),
+ (0.99860727787+0.0527590736747j),
+ (0.996953129768+0.0780025869608j),
+ (0.994203746319+0.107512556016j),
+ (0.990011692047+0.140985429287j),
+ (0.984013140202+0.178095817566j),
+ (0.975838363171+0.218493551016j),
+ (0.965121984482+0.261800557375j),
+ (0.95151245594+0.307610183954j),
+ (0.934681296349+0.355486690998j),
+ (0.914401650429+0.404808044434j),
+ (0.890356600285+0.455263823271j),
+ (0.862329125404+0.506348133087j),
+ (0.830152392387+0.557536482811j),
+ (0.793714106083+0.608290970325j),
+ (0.752960026264+0.658066213131j),
+ (0.707896590233+0.706316053867j),
+ (0.658591926098+0.752500295639j),
+ (0.605175673962+0.796091973782j),
+ (0.547837555408+0.836584687233j),
+ (0.48682525754+0.873499393463j),
+ (0.42244040966+0.906390726566j),
+ (0.355197101831+0.934791445732j),
+ (0.285494059324+0.958380460739j),
+ (0.213591173291+0.976923108101j),
+ (0.139945343137+0.990159213543j),
+ (0.065038472414+0.997882783413j),
+ (-0.0106285437942+0.999943494797j),
+ (-0.0865436866879+0.996248066425j),
+ (-0.162189796567+0.986759603024j),
+ (-0.23705175519+0.971496999264j),
+ (-0.310622543097+0.950533330441j),
+ (-0.38240903616+0.923993110657j),
+ (-0.451937526464+0.89204955101j),
+ (-0.518758952618+0.854920566082j),
+ (-0.582311093807+0.812966048717j),
+ (-0.642372369766+0.76639264822j),
+ (-0.698591887951+0.715520322323j),
+ (-0.750654160976+0.660695314407j),
+ (-0.798280358315+0.602286040783j),
+ (-0.841228663921+0.540679454803j),
+ (-0.87929558754+0.476276367903j),
+ (-0.912315964699+0.409486919641j),
+ (-0.940161883831+0.340728074312j),
+ (-0.962742805481+0.270418733358j),
+ (-0.980004072189+0.198977485299j),
+ (-0.991925954819+0.126818284392j),
+ (-0.99851256609+0.0545223206282j),
+ (-0.999846458435-0.0175215266645j),
+ (-0.996021270752-0.0891158208251j),
+ (-0.987133920193-0.159895718098j),
+ (-0.973306238651-0.2295101583j),
+ (-0.954683184624-0.297624111176j),
+ (-0.931430280209-0.363919824362j),
+ (-0.903732538223-0.428097635508j),
+ (-0.871792256832-0.489875763655j),
+ (-0.835827112198-0.548992812634j),
+ (-0.796068251133-0.605206847191j),
+ (-0.752758979797-0.658296227455j),
+ (-0.706152498722-0.70805978775j),
+ (-0.656641483307-0.754202902317j),
+ (-0.604367733002-0.79670548439j),
+ (-0.549597978592-0.835429251194j),
+ (-0.492602348328-0.870254516602j),
+ (-0.433654457331-0.901079237461j),
+ (-0.373029649258-0.927819430828j),
+ (-0.31100410223-0.950408577919j),
+ (-0.247853919864-0.968797445297j),
+ (-0.183855071664-0.982953369617j),
+ (-0.119282215834-0.992860376835j),
+ (-0.0544078871608-0.998518764973j),
+ (0.0104992967099-0.999944865704j),
+ (0.0749994292855-0.997183561325j),
+ (0.138844624162-0.990314185619j),
+ (0.201967850327-0.979392170906j),
+ (0.264124274254-0.964488625526j),
+ (0.325075358152-0.945688128471j),
+ (0.3845885396-0.92308807373j),
+ (0.442438393831-0.89679890871j),
+ (0.498407125473-0.866943061352j),
+ (0.552284479141-0.833655714989j),
+ (0.603869199753-0.797083437443j),
+ (0.652970373631-0.757383465767j),
+ (0.69940674305-0.714723825455j),
+ (0.743007957935-0.66928255558j),
+ (0.78350687027-0.62138313055j),
+ (0.820889055729-0.571087777615j),
+ (0.855021059513-0.51859331131j),
+ (0.885780930519-0.46410369873j),
+ (0.913058102131-0.407829582691j),
+ (0.936754107475-0.349988251925j),
+ (0.956783294678-0.290801793337j),
+ (0.973072886467-0.230497643352j),
+ (0.985563337803-0.169307261705j),
+ (0.9942086339-0.1074674353j),
+ (0.9989772439-0.0452152714133j))
sampling_freq = 10e3
freq = sampling_freq / 100
- alpha = 0.1
- beta = alpha * alpha / 4.0
+ loop_bw = math.pi/100.0
maxf = 1
minf = -1
src = gr.sig_source_c (sampling_freq, gr.GR_COS_WAVE, freq, 1.0)
- pll = gr.pll_refout_cc(alpha, beta, maxf, minf)
+ pll = gr.pll_refout_cc(loop_bw, maxf, minf)
head = gr.head (gr.sizeof_gr_complex, int (freq))
dst = gr.vector_sink_c ()
@@ -151,8 +150,7 @@ class test_pll_refout (gr_unittest.TestCase):
self.tb.run ()
dst_data = dst.data ()
-
- self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4)
if __name__ == '__main__':
gr_unittest.run(test_pll_refout, "test_pll_refout.xml")
diff --git a/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py b/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py
index ded77f5f3..c3dc5cf13 100644
--- a/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py
+++ b/gnuradio-core/src/python/gnuradio/gr_xmlrunner.py
@@ -6,8 +6,6 @@ XML Test Runner for PyUnit
# the Public Domain. With contributions by Paolo Borelli and others.
# Added to GNU Radio Oct. 3, 2010
-from __future__ import with_statement
-
__version__ = "0.1"
import os.path
@@ -185,7 +183,9 @@ class XMLTestRunner(object):
result = _XMLTestResult(classname)
start_time = time.time()
- with _fake_std_streams():
+ fss = _fake_std_streams()
+ fss.__enter__()
+ try:
test(result)
try:
out_s = sys.stdout.getvalue()
@@ -195,6 +195,8 @@ class XMLTestRunner(object):
err_s = sys.stderr.getvalue()
except AttributeError:
err_s = ""
+ finally:
+ fss.__exit__(None, None, None)
time_taken = time.time() - start_time
result.print_report(stream, time_taken, out_s, err_s)
@@ -218,8 +220,8 @@ class _fake_std_streams(object):
def __enter__(self):
self._orig_stdout = sys.stdout
self._orig_stderr = sys.stderr
- sys.stdout = StringIO()
- sys.stderr = StringIO()
+ #sys.stdout = StringIO()
+ #sys.stderr = StringIO()
def __exit__(self, exc_type, exc_val, exc_tb):
sys.stdout = self._orig_stdout
diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am b/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am
index ffae4b809..903bc2695 100644
--- a/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am
+++ b/gnuradio-core/src/python/gnuradio/gruimpl/Makefile.am
@@ -25,7 +25,6 @@ grupythondir = $(grpythondir)/gruimpl
grupython_PYTHON = \
__init__.py \
- crc.py \
freqz.py \
gnuplot_freqz.py \
hexint.py \
diff --git a/gnuradio-core/src/python/gnuradio/vocoder/__init__.py b/gnuradio-core/src/python/gnuradio/vocoder/__init__.py
deleted file mode 100644
index a4917cf64..000000000
--- a/gnuradio-core/src/python/gnuradio/vocoder/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-# make this a package
diff --git a/gnuradio-examples/grc/Makefile.am b/gnuradio-examples/grc/Makefile.am
index d9a0d9c2c..e99d26299 100644
--- a/gnuradio-examples/grc/Makefile.am
+++ b/gnuradio-examples/grc/Makefile.am
@@ -46,15 +46,15 @@ dist_trellisdata_DATA = \
trellis/readme.txt \
trellis/interference_cancellation.grc
-usrpdatadir = $(grc_examples_prefix)/usrp
-dist_usrpdata_DATA = \
- usrp/usrp2_const_wave.grc \
- usrp/usrp2_dpsk_mod.grc \
- usrp/usrp_rx_dpsk.grc \
- usrp/usrp_tx_dpsk.grc \
- usrp/usrp2_fft.grc \
- usrp/usrp_two_tone_loopback.grc \
- usrp/usrp_wbfm_receive.grc
+uhddatadir = $(grc_examples_prefix)/uhd
+dist_uhddata_DATA = \
+ uhd/uhd_const_wave.grc \
+ uhd/uhd_dpsk_mod.grc \
+ uhd/uhd_rx_dpsk.grc \
+ uhd/uhd_tx_dpsk.grc \
+ uhd/uhd_fft.grc \
+ uhd/uhd_two_tone_loopback.grc \
+ uhd/uhd_wbfm_receive.grc
xmlrpcdatadir = $(grc_examples_prefix)/xmlrpc
dist_xmlrpcdata_DATA = \
diff --git a/gnuradio-examples/grc/uhd/.gitignore b/gnuradio-examples/grc/uhd/.gitignore
new file mode 100644
index 000000000..f6c10401f
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/.gitignore
@@ -0,0 +1,2 @@
+*.py
+*.pyc
diff --git a/gnuradio-examples/grc/uhd/uhd_const_wave.grc b/gnuradio-examples/grc/uhd/uhd_const_wave.grc
new file mode 100644
index 000000000..c64721c83
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_const_wave.grc
@@ -0,0 +1,1020 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 10:24:27 2011</timestamp>
+ <block>
+ <key>const_source_x</key>
+ <param>
+ <key>id</key>
+ <value>const_source_x_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>const</key>
+ <value>ampl</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(102, 193)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>ampl</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Amplitude</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>.1</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(174, 313)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(318, 314)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>2.4e9</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>2.5e9</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(24, 315)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_const_wave</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD Constant Wave</value>
+ </param>
+ <param>
+ <key>author</key>
+ <value>Example</value>
+ </param>
+ <param>
+ <key>description</key>
+ <value>Tune UHD Device</value>
+ </param>
+ <param>
+ <key>window_size</key>
+ <value>1280, 1024</value>
+ </param>
+ <param>
+ <key>generate_options</key>
+ <value>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.11.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>a</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(188, 12)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>1e6</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(342, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_sink</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_sink_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(308, 169)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2.45e9</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(468, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>g</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(616, 13)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>const_source_x_0</source_block_id>
+ <sink_block_id>uhd_usrp_sink_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc b/gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc
new file mode 100644
index 000000000..18ae9c3db
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_dpsk_mod.grc
@@ -0,0 +1,2238 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 14:44:48 2011</timestamp>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_dpsk_mod</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD DPSK Modulation</value>
+ </param>
+ <param>
+ <key>author</key>
+ <value>Example</value>
+ </param>
+ <param>
+ <key>description</key>
+ <value>Generate a DPSK signal</value>
+ </param>
+ <param>
+ <key>window_size</key>
+ <value>1280, 1024</value>
+ </param>
+ <param>
+ <key>generate_options</key>
+ <value>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable</key>
+ <param>
+ <key>id</key>
+ <value>samps_per_sym</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>8</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(33, 280)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_fftsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_fftsink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>FFT Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>y_per_div</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>y_divs</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_level</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>2.0</value>
+ </param>
+ <param>
+ <key>fft_size</key>
+ <value>1024</value>
+ </param>
+ <param>
+ <key>fft_rate</key>
+ <value>30</value>
+ </param>
+ <param>
+ <key>peak_hold</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>average</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>avg_alpha</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>None</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(697, 248)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_scopesink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_scopesink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>Scope Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>v_scale</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>v_offset</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>t_scale</key>
+ <value>1e-6</value>
+ </param>
+ <param>
+ <key>ac_couple</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>xy_mode</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>num_inputs</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>trig_mode</key>
+ <value>gr.gr_TRIG_MODE_AUTO</value>
+ </param>
+ <param>
+ <key>y_axis_label</key>
+ <value>Counts</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(469, 355)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>random_source_x</key>
+ <param>
+ <key>id</key>
+ <value>random_source_x_0</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>256</value>
+ </param>
+ <param>
+ <key>num_samps</key>
+ <value>1000</value>
+ </param>
+ <param>
+ <key>repeat</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(245, 139)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_multiply_const_vxx</key>
+ <param>
+ <key>id</key>
+ <value>gr_multiply_const_vxx_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>const</key>
+ <value>ampl</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(647, 163)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_rx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD RX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>rx_gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(477, 509)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>rx_freq_off</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>RX Freq Offset (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq_offset</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>-50e3</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>+50e3</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(190, 507)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>rx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default RX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1137, 8)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq_offset</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Rx Frequency Offset</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>o</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(824, 8)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_source</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_source_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address1</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq+rx_freq_off</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_rx_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(216, 288)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_constellationsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_constellationsink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>Constellation Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>frame_rate</key>
+ <value>5</value>
+ </param>
+ <param>
+ <key>const_size</key>
+ <value>2048</value>
+ </param>
+ <param>
+ <key>M</key>
+ <value>4</value>
+ </param>
+ <param>
+ <key>theta</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>loop_bw</key>
+ <value>6.28/100.0</value>
+ </param>
+ <param>
+ <key>fmax</key>
+ <value>0.06</value>
+ </param>
+ <param>
+ <key>mu</key>
+ <value>0.5</value>
+ </param>
+ <param>
+ <key>gain_mu</key>
+ <value>0.005</value>
+ </param>
+ <param>
+ <key>symbol_rate</key>
+ <value>samp_rate/samps_per_sym</value>
+ </param>
+ <param>
+ <key>omega_limit</key>
+ <value>0.005</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(862, 336)</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_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>dqpsk</value>
+ </param>
+ <param>
+ <key>samples_per_symbol</key>
+ <value>samps_per_sym</value>
+ </param>
+ <param>
+ <key>excess_bw</key>
+ <value>0.35</value>
+ </param>
+ <param>
+ <key>gray_coded</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>verbose</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>log</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(426, 139)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>ampl</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Amplitude</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>.1</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(33, 353)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_sink</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_sink_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address0</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_rx_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(838, 139)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_tx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD TX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>tx_gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(351, 508)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address, Dev 0</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.10.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(197, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address, Dev 1</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.11.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(357, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>1e6</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(543, 8)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2.45e9</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(669, 8)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>tx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default TX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1003, 8)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>2.4e9</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>2.5e9</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(35, 506)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_fftsink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_constellationsink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_scopesink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_multiply_const_vxx_0</source_block_id>
+ <sink_block_id>uhd_usrp_sink_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>random_source_x_0</source_block_id>
+ <sink_block_id>digital_dxpsk_mod_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>digital_dxpsk_mod_0</source_block_id>
+ <sink_block_id>gr_multiply_const_vxx_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/uhd/uhd_fft.grc b/gnuradio-examples/grc/uhd/uhd_fft.grc
new file mode 100644
index 000000000..29c375065
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_fft.grc
@@ -0,0 +1,1025 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 10:26:30 2011</timestamp>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_fft</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD FFT Plotter</value>
+ </param>
+ <param>
+ <key>author</key>
+ <value>Example</value>
+ </param>
+ <param>
+ <key>description</key>
+ <value>FFT waveform plot</value>
+ </param>
+ <param>
+ <key>window_size</key>
+ <value>1280, 1024</value>
+ </param>
+ <param>
+ <key>generate_options</key>
+ <value>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>g</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(633, 17)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2.45e9</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(485, 18)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.11.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>a</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(205, 16)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>1e6</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(359, 18)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_fftsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_fftsink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>FFT Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>y_per_div</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>y_divs</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_level</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>2.0</value>
+ </param>
+ <param>
+ <key>fft_size</key>
+ <value>1024</value>
+ </param>
+ <param>
+ <key>fft_rate</key>
+ <value>30</value>
+ </param>
+ <param>
+ <key>peak_hold</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>average</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>avg_alpha</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>None</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(479, 176)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_source</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_source_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(212, 216)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>2.4e9</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>2.5e9</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(36, 376)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(177, 377)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_fftsink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc b/gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc
new file mode 100644
index 000000000..73848ff3c
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_rx_dpsk.grc
@@ -0,0 +1,1431 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 15:08:55 2011</timestamp>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_rx_dpsk</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD RX DPSK</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>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(12, 9)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable</key>
+ <param>
+ <key>id</key>
+ <value>samps_per_sym</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>4</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(12, 88)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>1e6</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(339, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2.45e9</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(466, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>g</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(624, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.10.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>a</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(186, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq_offset</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Rx Frequency Offset</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>o</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(748, 15)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>2.4e9</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>2.5e9</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(12, 436)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_null_sink</key>
+ <param>
+ <key>id</key>
+ <value>gr_null_sink_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>byte</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(615, 144)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>timing_bw</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Timing Loop BW</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>6.28/100.0</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(604, 436)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>phase_bw</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Phase Loop BW</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>6.28/100.0</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1.0</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(461, 436)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_constellationsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_constellationsink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>Constellation Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>frame_rate</key>
+ <value>5</value>
+ </param>
+ <param>
+ <key>const_size</key>
+ <value>2048</value>
+ </param>
+ <param>
+ <key>M</key>
+ <value>4</value>
+ </param>
+ <param>
+ <key>theta</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>loop_bw</key>
+ <value>6.28/100.0</value>
+ </param>
+ <param>
+ <key>fmax</key>
+ <value>0.06</value>
+ </param>
+ <param>
+ <key>mu</key>
+ <value>0.5</value>
+ </param>
+ <param>
+ <key>gain_mu</key>
+ <value>0.005</value>
+ </param>
+ <param>
+ <key>symbol_rate</key>
+ <value>samp_rate/samps_per_sym</value>
+ </param>
+ <param>
+ <key>omega_limit</key>
+ <value>0.005</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(931, 313)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_fftsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_fftsink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>FFT Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>y_per_div</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>y_divs</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_level</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>2.0</value>
+ </param>
+ <param>
+ <key>fft_size</key>
+ <value>1024</value>
+ </param>
+ <param>
+ <key>fft_rate</key>
+ <value>30</value>
+ </param>
+ <param>
+ <key>peak_hold</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>average</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>avg_alpha</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>None</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(710, 236)</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_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>dqpsk</value>
+ </param>
+ <param>
+ <key>samples_per_symbol</key>
+ <value>samps_per_sym</value>
+ </param>
+ <param>
+ <key>excess_bw</key>
+ <value>0.35</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>omega_relative_limit</key>
+ <value>0.005</value>
+ </param>
+ <param>
+ <key>gray_coded</key>
+ <value>True</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>_coordinate</key>
+ <value>(303, 154)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>rx_freq_off</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>RX Freq Offset (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq_offset</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>-100e3</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>+100e3</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(149, 437)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(306, 438)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_source</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_source_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq+rx_freq_off</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(18, 276)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>digital_dxpsk_demod_0</source_block_id>
+ <sink_block_id>gr_null_sink_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>digital_dxpsk_demod_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_constellationsink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_fftsink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc b/gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc
new file mode 100644
index 000000000..8bcbc0792
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_two_tone_loopback.grc
@@ -0,0 +1,2204 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 15:27:04 2011</timestamp>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>tx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default TX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(999, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2.45e9</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(665, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq_offset</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Rx Frequency Offset</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>o</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(820, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address, Dev 1</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.11.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(353, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address, Dev 0</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.10.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(193, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_sig_source_x</key>
+ <param>
+ <key>id</key>
+ <value>gr_sig_source_x</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>waveform</key>
+ <value>gr.GR_COS_WAVE</value>
+ </param>
+ <param>
+ <key>freq</key>
+ <value>tone1</value>
+ </param>
+ <param>
+ <key>amp</key>
+ <value>tone_ampl</value>
+ </param>
+ <param>
+ <key>offset</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(258, 136)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_sig_source_x</key>
+ <param>
+ <key>id</key>
+ <value>gr_sig_source_x0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>waveform</key>
+ <value>gr.GR_COS_WAVE</value>
+ </param>
+ <param>
+ <key>freq</key>
+ <value>tone2</value>
+ </param>
+ <param>
+ <key>amp</key>
+ <value>tone_ampl</value>
+ </param>
+ <param>
+ <key>offset</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(259, 248)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_noise_source_x</key>
+ <param>
+ <key>id</key>
+ <value>gr_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>gr.GR_GAUSSIAN</value>
+ </param>
+ <param>
+ <key>amp</key>
+ <value>noise_ampl</value>
+ </param>
+ <param>
+ <key>seed</key>
+ <value>42</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(279, 364)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_sink</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_sink_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address0</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_rx_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(669, 178)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>rx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default RX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1139, 12)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tone1</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Tone 1</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>50e3</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>-samp_rate/2</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>samp_rate/2</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>0, 0, 1, 4</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(161, 484)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tone2</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Tone 2</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>75e3</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>-samp_rate/2</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>samp_rate/2</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>0, 4, 1, 4</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(308, 483)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_tx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD TX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>tx_gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(655, 486)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>2.4e9</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>2.5e9</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(514, 487)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_rx_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD RX Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>rx_gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(781, 487)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_source</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_source_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address1</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_rx_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(672, 320)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tone_ampl</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Tone Ampl</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0.15</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_VERTICAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>1, 0, 2, 1</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(14, 485)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>noise_ampl</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Noise Ampl</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0.1</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_VERTICAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>1, 1, 2, 1</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(15, 335)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_add_xx</key>
+ <param>
+ <key>id</key>
+ <value>gr_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>3</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(529, 172)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_two_tone_loopback</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD Loopback - 2 Tone</value>
+ </param>
+ <param>
+ <key>author</key>
+ <value>Example</value>
+ </param>
+ <param>
+ <key>description</key>
+ <value>Loopback test</value>
+ </param>
+ <param>
+ <key>window_size</key>
+ <value>1280, 1024</value>
+ </param>
+ <param>
+ <key>generate_options</key>
+ <value>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_fftsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_fftsink2</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>FFT Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>y_per_div</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>y_divs</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_level</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>2.0</value>
+ </param>
+ <param>
+ <key>fft_size</key>
+ <value>512*2</value>
+ </param>
+ <param>
+ <key>fft_rate</key>
+ <value>15</value>
+ </param>
+ <param>
+ <key>peak_hold</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>average</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>avg_alpha</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>window.blackmanharris</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>1, 2, 2, 4</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1114, 264)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>500e3</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(539, 11)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>gr_noise_source_x</source_block_id>
+ <sink_block_id>gr_add_xx</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>2</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_sig_source_x0</source_block_id>
+ <sink_block_id>gr_add_xx</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>1</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_sig_source_x</source_block_id>
+ <sink_block_id>gr_add_xx</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_add_xx</source_block_id>
+ <sink_block_id>uhd_usrp_sink_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>wxgui_fftsink2</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc b/gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc
new file mode 100644
index 000000000..281ba8429
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_tx_dpsk.grc
@@ -0,0 +1,1234 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 14:55:39 2011</timestamp>
+ <block>
+ <key>variable</key>
+ <param>
+ <key>id</key>
+ <value>samps_per_sym</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>4</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 100)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>ampl</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Amplitude</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>.1</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(7, 299)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>1e6</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(334, 15)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>2.45e9</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(463, 17)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(151, 441)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>2.4e9</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>2.5e9</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(7, 441)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>random_source_x</key>
+ <param>
+ <key>id</key>
+ <value>random_source_x_0</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>2**8</value>
+ </param>
+ <param>
+ <key>num_samps</key>
+ <value>1000</value>
+ </param>
+ <param>
+ <key>repeat</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(177, 162)</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_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>dqpsk</value>
+ </param>
+ <param>
+ <key>samples_per_symbol</key>
+ <value>samps_per_sym</value>
+ </param>
+ <param>
+ <key>excess_bw</key>
+ <value>0.35</value>
+ </param>
+ <param>
+ <key>gray_coded</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>verbose</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>log</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(366, 162)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>g</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(619, 15)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.10.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>a</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(177, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_sink</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_sink_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(783, 162)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_multiply_const_vxx</key>
+ <param>
+ <key>id</key>
+ <value>gr_multiply_const_vxx_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>const</key>
+ <value>ampl</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(566, 186)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_fftsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_fftsink2_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>Transmit Spectrum</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>y_per_div</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>y_divs</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_level</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>2</value>
+ </param>
+ <param>
+ <key>fft_size</key>
+ <value>1024</value>
+ </param>
+ <param>
+ <key>fft_rate</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>peak_hold</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>average</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>avg_alpha</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>None</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(827, 299)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_tx_dpsk</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD TX DPSK</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>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>random_source_x_0</source_block_id>
+ <sink_block_id>digital_dxpsk_mod_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_multiply_const_vxx_0</source_block_id>
+ <sink_block_id>wxgui_fftsink2_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>gr_multiply_const_vxx_0</source_block_id>
+ <sink_block_id>uhd_usrp_sink_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>digital_dxpsk_mod_0</source_block_id>
+ <sink_block_id>gr_multiply_const_vxx_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc b/gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc
new file mode 100644
index 000000000..62658a2eb
--- /dev/null
+++ b/gnuradio-examples/grc/uhd/uhd_wbfm_receive.grc
@@ -0,0 +1,1365 @@
+<?xml version='1.0' encoding='ASCII'?>
+<flow_graph>
+ <timestamp>Sat Oct 8 15:18:49 2011</timestamp>
+ <block>
+ <key>options</key>
+ <param>
+ <key>id</key>
+ <value>uhd_wbfm_receive</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>UHD WBFM Receive</value>
+ </param>
+ <param>
+ <key>author</key>
+ <value>Example</value>
+ </param>
+ <param>
+ <key>description</key>
+ <value>WBFM Receive</value>
+ </param>
+ <param>
+ <key>window_size</key>
+ <value>1280, 1024</value>
+ </param>
+ <param>
+ <key>generate_options</key>
+ <value>wx_gui</value>
+ </param>
+ <param>
+ <key>category</key>
+ <value>Custom</value>
+ </param>
+ <param>
+ <key>run_options</key>
+ <value>prompt</value>
+ </param>
+ <param>
+ <key>run</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>realtime_scheduling</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(10, 10)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>g</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(631, 15)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Default Frequency</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>93.3e6</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>f</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(479, 15)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_freq</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Freq (Hz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>freq</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>87.9e6</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>108.1e6</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(15, 441)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>fine</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Fine Freq (MHz)</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>-.1</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>.1</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>0, 2, 1, 2</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(277, 444)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>UHD Gain</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>gain</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>20</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value></value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(158, 440)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable_slider</key>
+ <param>
+ <key>id</key>
+ <value>volume</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Volume</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>min</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>max</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>num_steps</key>
+ <value>100</value>
+ </param>
+ <param>
+ <key>style</key>
+ <value>wx.SL_HORIZONTAL</value>
+ </param>
+ <param>
+ <key>converver</key>
+ <value>float_converter</value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>1, 0, 1, 4</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(436, 446)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>gr_multiply_const_vxx</key>
+ <param>
+ <key>id</key>
+ <value>gr_multiply_const_vxx</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>float</value>
+ </param>
+ <param>
+ <key>const</key>
+ <value>volume</value>
+ </param>
+ <param>
+ <key>vlen</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(836, 161)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>uhd_usrp_source</key>
+ <param>
+ <key>id</key>
+ <value>uhd_usrp_source_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>dev_addr</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>sync</key>
+ <value></value>
+ </param>
+ <param>
+ <key>clock_rate</key>
+ <value>0.0</value>
+ </param>
+ <param>
+ <key>num_mboards</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>ref_source0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>ref_source7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>sd_spec7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>nchan</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>center_freq0</key>
+ <value>tun_freq+fine</value>
+ </param>
+ <param>
+ <key>gain0</key>
+ <value>tun_gain</value>
+ </param>
+ <param>
+ <key>ant0</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw0</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant1</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw1</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant2</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw2</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant3</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw3</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant4</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw4</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant5</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw5</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant6</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw6</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant7</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw7</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant8</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw8</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant9</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw9</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant10</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw10</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant11</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw11</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant12</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw12</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant13</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw13</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant14</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw14</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant15</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw15</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant16</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw16</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant17</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw17</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant18</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw18</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant19</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw19</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant20</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw20</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant21</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw21</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant22</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw22</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant23</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw23</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant24</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw24</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant25</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw25</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant26</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw26</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant27</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw27</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant28</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw28</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant29</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw29</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant30</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw30</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>center_freq31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>gain31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ant31</key>
+ <value></value>
+ </param>
+ <param>
+ <key>bw31</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(14, 165)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>address</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>IP Address</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>addr=192.168.10.2</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>a</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(199, 14)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>wxgui_fftsink2</key>
+ <param>
+ <key>id</key>
+ <value>wxgui_fftsink2</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>complex</value>
+ </param>
+ <param>
+ <key>title</key>
+ <value>FFT Plot</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>baseband_freq</key>
+ <value>(freq+fine)*1e6</value>
+ </param>
+ <param>
+ <key>y_per_div</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>y_divs</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>ref_level</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>ref_scale</key>
+ <value>2.0</value>
+ </param>
+ <param>
+ <key>fft_size</key>
+ <value>512</value>
+ </param>
+ <param>
+ <key>fft_rate</key>
+ <value>15</value>
+ </param>
+ <param>
+ <key>peak_hold</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>average</key>
+ <value>False</value>
+ </param>
+ <param>
+ <key>avg_alpha</key>
+ <value>0</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>None</value>
+ </param>
+ <param>
+ <key>win_size</key>
+ <value></value>
+ </param>
+ <param>
+ <key>grid_pos</key>
+ <value>2, 0, 2, 4</value>
+ </param>
+ <param>
+ <key>notebook</key>
+ <value></value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(624, 278)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Sample Rate</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>400e3</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>eng_float</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>s</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(352, 15)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>parameter</key>
+ <param>
+ <key>id</key>
+ <value>audio_output</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>label</key>
+ <value>Audio Output Device</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value></value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>string</value>
+ </param>
+ <param>
+ <key>short_id</key>
+ <value>O</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(769, 13)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>audio_sink</key>
+ <param>
+ <key>id</key>
+ <value>audio_sink</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>int(samp_rate/audio_decim)</value>
+ </param>
+ <param>
+ <key>device_name</key>
+ <value>audio_output</value>
+ </param>
+ <param>
+ <key>ok_to_block</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>num_inputs</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(1023, 161)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>blks2_wfm_rcv</key>
+ <param>
+ <key>id</key>
+ <value>blks2_wfm_rcv</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>quad_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>audio_decimation</key>
+ <value>audio_decim</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(626, 153)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>low_pass_filter</key>
+ <param>
+ <key>id</key>
+ <value>low_pass_filter_0</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>type</key>
+ <value>fir_filter_ccf</value>
+ </param>
+ <param>
+ <key>decim</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>interp</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>gain</key>
+ <value>1</value>
+ </param>
+ <param>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ </param>
+ <param>
+ <key>cutoff_freq</key>
+ <value>115e3</value>
+ </param>
+ <param>
+ <key>width</key>
+ <value>30e3</value>
+ </param>
+ <param>
+ <key>win</key>
+ <value>firdes.WIN_HANN</value>
+ </param>
+ <param>
+ <key>beta</key>
+ <value>6.76</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(326, 141)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <block>
+ <key>variable</key>
+ <param>
+ <key>id</key>
+ <value>audio_decim</value>
+ </param>
+ <param>
+ <key>_enabled</key>
+ <value>True</value>
+ </param>
+ <param>
+ <key>value</key>
+ <value>10</value>
+ </param>
+ <param>
+ <key>_coordinate</key>
+ <value>(19, 351)</value>
+ </param>
+ <param>
+ <key>_rotation</key>
+ <value>0</value>
+ </param>
+ </block>
+ <connection>
+ <source_block_id>gr_multiply_const_vxx</source_block_id>
+ <sink_block_id>audio_sink</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>blks2_wfm_rcv</source_block_id>
+ <sink_block_id>gr_multiply_const_vxx</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>low_pass_filter_0</source_block_id>
+ <sink_block_id>blks2_wfm_rcv</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>uhd_usrp_source_0</source_block_id>
+ <sink_block_id>low_pass_filter_0</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+ <connection>
+ <source_block_id>low_pass_filter_0</source_block_id>
+ <sink_block_id>wxgui_fftsink2</sink_block_id>
+ <source_key>0</source_key>
+ <sink_key>0</sink_key>
+ </connection>
+</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp2_const_wave.grc b/gnuradio-examples/grc/usrp/usrp2_const_wave.grc
deleted file mode 100644
index fdbd7c1f3..000000000
--- a/gnuradio-examples/grc/usrp/usrp2_const_wave.grc
+++ /dev/null
@@ -1,252 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Wed Apr 15 11:22:56 2009</timestamp>
- <block>
- <key>const_source_x</key>
- <param>
- <key>id</key>
- <value>const_source_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>const</key>
- <value>ampl</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(284, 154)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp2_sink_xxxx</key>
- <param>
- <key>id</key>
- <value>usrp2_sink_xxxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>interface</key>
- <value></value>
- </param>
- <param>
- <key>mac_addr</key>
- <value></value>
- </param>
- <param>
- <key>interpolation</key>
- <value>interp</value>
- </param>
- <param>
- <key>frequency</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>gain</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(493, 106)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>interp</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>16</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(16, 255)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>USRP2 Freq (Hz)</value>
- </param>
- <param>
- <key>value</key>
- <value>2.45e9</value>
- </param>
- <param>
- <key>min</key>
- <value>2.4e9</value>
- </param>
- <param>
- <key>max</key>
- <value>2.5e9</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>slider_length</key>
- <value>200</value>
- </param>
- <param>
- <key>slider_type</key>
- <value>horizontal</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(30, 376)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>ampl</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Amplitude</value>
- </param>
- <param>
- <key>value</key>
- <value>.1</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>1</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>slider_length</key>
- <value>200</value>
- </param>
- <param>
- <key>slider_type</key>
- <value>horizontal</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(204, 376)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp2_const_wave</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP2 Constant Wave</value>
- </param>
- <param>
- <key>author</key>
- <value>Example</value>
- </param>
- <param>
- <key>description</key>
- <value>Tune USRP2</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</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>
- <connection>
- <source_block_id>const_source_x_0</source_block_id>
- <sink_block_id>usrp2_sink_xxxx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp2_dpsk_mod.grc b/gnuradio-examples/grc/usrp/usrp2_dpsk_mod.grc
deleted file mode 100644
index e9f9b41ea..000000000
--- a/gnuradio-examples/grc/usrp/usrp2_dpsk_mod.grc
+++ /dev/null
@@ -1,693 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Wed Apr 15 17:31:00 2009</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp2_dpsk_mod</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP2 DPSK Modulation</value>
- </param>
- <param>
- <key>author</key>
- <value>Example</value>
- </param>
- <param>
- <key>description</key>
- <value>Generate a DPSK signal</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</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>samp_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>100e6/interp</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(52, 166)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp2_sink_xxxx</key>
- <param>
- <key>id</key>
- <value>usrp2_sink_xxxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>interface</key>
- <value></value>
- </param>
- <param>
- <key>mac_addr</key>
- <value></value>
- </param>
- <param>
- <key>interpolation</key>
- <value>interp</value>
- </param>
- <param>
- <key>frequency</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>gain</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(1059, 56)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_multiply_const_vxx</key>
- <param>
- <key>id</key>
- <value>gr_multiply_const_vxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>const</key>
- <value>ampl</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(679, 58)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_dxpsk_mod</key>
- <param>
- <key>id</key>
- <value>blks2_dxpsk_mod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>dqpsk</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>samps_per_sym</value>
- </param>
- <param>
- <key>excess_bw</key>
- <value>0.35</value>
- </param>
- <param>
- <key>gray_code</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(468, 55)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>interp</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>100</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(31, 256)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samps_per_sym</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>8</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(126, 250)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>random_source_x</key>
- <param>
- <key>id</key>
- <value>random_source_x_0</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>256</value>
- </param>
- <param>
- <key>num_samps</key>
- <value>1000</value>
- </param>
- <param>
- <key>repeat</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(255, 39)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>ampl</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Amplitude</value>
- </param>
- <param>
- <key>value</key>
- <value>.1</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>1</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(246, 372)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>rx_freq_off</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>RX Freq Offset (Hz)</value>
- </param>
- <param>
- <key>value</key>
- <value>-20e3</value>
- </param>
- <param>
- <key>min</key>
- <value>-50e3</value>
- </param>
- <param>
- <key>max</key>
- <value>+50e3</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(247, 508)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>USRP2 Freq (Hz)</value>
- </param>
- <param>
- <key>value</key>
- <value>2.45e9</value>
- </param>
- <param>
- <key>min</key>
- <value>2.4e9</value>
- </param>
- <param>
- <key>max</key>
- <value>2.5e9</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(49, 341)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_constellationsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_constellationsink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>Constellation Plot</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>frame_rate</key>
- <value>5</value>
- </param>
- <param>
- <key>const_size</key>
- <value>2048</value>
- </param>
- <param>
- <key>M</key>
- <value>4</value>
- </param>
- <param>
- <key>theta</key>
- <value>0</value>
- </param>
- <param>
- <key>alpha</key>
- <value>0.005</value>
- </param>
- <param>
- <key>fmax</key>
- <value>0.06</value>
- </param>
- <param>
- <key>mu</key>
- <value>0.5</value>
- </param>
- <param>
- <key>gain_mu</key>
- <value>0.005</value>
- </param>
- <param>
- <key>symbol_rate</key>
- <value>samp_rate/samps_per_sym</value>
- </param>
- <param>
- <key>omega_limit</key>
- <value>0.005</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(920, 202)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_fftsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_fftsink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>FFT Plot</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>baseband_freq</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>y_per_div</key>
- <value>10</value>
- </param>
- <param>
- <key>ref_level</key>
- <value>10</value>
- </param>
- <param>
- <key>fft_size</key>
- <value>1024</value>
- </param>
- <param>
- <key>fft_rate</key>
- <value>30</value>
- </param>
- <param>
- <key>peak_hold</key>
- <value>False</value>
- </param>
- <param>
- <key>average</key>
- <value>False</value>
- </param>
- <param>
- <key>avg_alpha</key>
- <value>0</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(691, 155)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_scopesink2</key>
- <param>
- <key>id</key>
- <value>wxgui_scopesink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>False</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>Scope Plot</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>v_scale</key>
- <value>0</value>
- </param>
- <param>
- <key>t_scale</key>
- <value>1e-6</value>
- </param>
- <param>
- <key>ac_couple</key>
- <value>False</value>
- </param>
- <param>
- <key>xy_mode</key>
- <value>True</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>1</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(515, 272)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp2_source_xxxx</key>
- <param>
- <key>id</key>
- <value>usrp2_source_xxxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>interface</key>
- <value>eth1</value>
- </param>
- <param>
- <key>mac_addr</key>
- <value></value>
- </param>
- <param>
- <key>decimation</key>
- <value>interp</value>
- </param>
- <param>
- <key>frequency</key>
- <value>tun_freq + rx_freq_off</value>
- </param>
- <param>
- <key>gain</key>
- <value>30</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(270, 200)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>random_source_x_0</source_block_id>
- <sink_block_id>blks2_dxpsk_mod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_dxpsk_mod_0</source_block_id>
- <sink_block_id>gr_multiply_const_vxx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_multiply_const_vxx_0</source_block_id>
- <sink_block_id>usrp2_sink_xxxx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>usrp2_source_xxxx_0</source_block_id>
- <sink_block_id>wxgui_constellationsink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>usrp2_source_xxxx_0</source_block_id>
- <sink_block_id>wxgui_scopesink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>usrp2_source_xxxx_0</source_block_id>
- <sink_block_id>wxgui_fftsink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp2_fft.grc b/gnuradio-examples/grc/usrp/usrp2_fft.grc
deleted file mode 100644
index 134bd4614..000000000
--- a/gnuradio-examples/grc/usrp/usrp2_fft.grc
+++ /dev/null
@@ -1,264 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Wed Apr 15 17:30:20 2009</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp2_fft</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP2 FFT Plotter</value>
- </param>
- <param>
- <key>author</key>
- <value>Example</value>
- </param>
- <param>
- <key>description</key>
- <value>FFT waveform plot</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</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>samp_rate</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>100e6/decim</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(10, 170)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>decim</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>16</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(24, 267)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>USRP2 Freq (Hz)</value>
- </param>
- <param>
- <key>value</key>
- <value>2.45e9</value>
- </param>
- <param>
- <key>min</key>
- <value>2.4e9</value>
- </param>
- <param>
- <key>max</key>
- <value>2.5e9</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(32, 365)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_fftsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_fftsink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>FFT Plot</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>baseband_freq</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>y_per_div</key>
- <value>10</value>
- </param>
- <param>
- <key>ref_level</key>
- <value>10</value>
- </param>
- <param>
- <key>fft_size</key>
- <value>1024</value>
- </param>
- <param>
- <key>fft_rate</key>
- <value>30</value>
- </param>
- <param>
- <key>peak_hold</key>
- <value>False</value>
- </param>
- <param>
- <key>average</key>
- <value>False</value>
- </param>
- <param>
- <key>avg_alpha</key>
- <value>0</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(466, 100)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp2_source_xxxx</key>
- <param>
- <key>id</key>
- <value>usrp2_source_xxxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>interface</key>
- <value></value>
- </param>
- <param>
- <key>mac_addr</key>
- <value></value>
- </param>
- <param>
- <key>decimation</key>
- <value>decim</value>
- </param>
- <param>
- <key>frequency</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>gain</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(211, 200)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>usrp2_source_xxxx_0</source_block_id>
- <sink_block_id>wxgui_fftsink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc b/gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc
deleted file mode 100644
index 9843ee6b0..000000000
--- a/gnuradio-examples/grc/usrp/usrp_rx_dpsk.grc
+++ /dev/null
@@ -1,727 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Wed Dec 2 11:03:20 2009</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp_rx_dpsk</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP RX DPSK</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>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</value>
- </param>
- <param>
- <key>run_options</key>
- <value>prompt</value>
- </param>
- <param>
- <key>run</key>
- <value>True</value>
- </param>
- <param>
- <key>realtime_scheduling</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(12, 9)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samps_per_sym</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(14, 79)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>2.45e9</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(18, 151)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>p2p</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>2.0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(13, 314)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>timing_alpha</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Timing Alpha</value>
- </param>
- <param>
- <key>value</key>
- <value>.1</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>.5</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(759, 365)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_null_sink</key>
- <param>
- <key>id</key>
- <value>gr_null_sink_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>byte</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(815, 80)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>costas_alpha</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Costas Alpha</value>
- </param>
- <param>
- <key>value</key>
- <value>0.175</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>.5</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(598, 367)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_fftsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_fftsink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>Receive Spectrum</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>baseband_freq</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>y_per_div</key>
- <value>10</value>
- </param>
- <param>
- <key>y_divs</key>
- <value>10</value>
- </param>
- <param>
- <key>ref_level</key>
- <value>-40</value>
- </param>
- <param>
- <key>ref_scale</key>
- <value>p2p</value>
- </param>
- <param>
- <key>fft_size</key>
- <value>1024</value>
- </param>
- <param>
- <key>fft_rate</key>
- <value>15</value>
- </param>
- <param>
- <key>peak_hold</key>
- <value>False</value>
- </param>
- <param>
- <key>average</key>
- <value>False</value>
- </param>
- <param>
- <key>avg_alpha</key>
- <value>0</value>
- </param>
- <param>
- <key>win</key>
- <value>None</value>
- </param>
- <param>
- <key>win_size</key>
- <value></value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(383, 321)</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>1e6/4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(20, 234)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>gain</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Gain</value>
- </param>
- <param>
- <key>value</key>
- <value>20</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>70</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(152, 378)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp2_source_xxxx</key>
- <param>
- <key>id</key>
- <value>usrp2_source_xxxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>interface</key>
- <value></value>
- </param>
- <param>
- <key>mac_addr</key>
- <value></value>
- </param>
- <param>
- <key>decimation</key>
- <value>int(100e6/samp_rate)</value>
- </param>
- <param>
- <key>frequency</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>lo_offset</key>
- <value>float('inf')</value>
- </param>
- <param>
- <key>gain</key>
- <value>gain</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(158, 51)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp_simple_source_x</key>
- <param>
- <key>id</key>
- <value>usrp_simple_source_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>False</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>format</key>
- <value></value>
- </param>
- <param>
- <key>which</key>
- <value>0</value>
- </param>
- <param>
- <key>decimation</key>
- <value>int(64e6/samp_rate)</value>
- </param>
- <param>
- <key>frequency</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>lo_offset</key>
- <value>float('inf')</value>
- </param>
- <param>
- <key>gain</key>
- <value>gain</value>
- </param>
- <param>
- <key>side</key>
- <value>B</value>
- </param>
- <param>
- <key>rx_ant</key>
- <value>TX/RX</value>
- </param>
- <param>
- <key>hb_filters</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(154, 218)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_dxpsk2_demod</key>
- <param>
- <key>id</key>
- <value>blks2_dxpsk2_demod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>dqpsk</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>samps_per_sym</value>
- </param>
- <param>
- <key>excess_bw</key>
- <value>0.35</value>
- </param>
- <param>
- <key>costas_alpha</key>
- <value>costas_alpha</value>
- </param>
- <param>
- <key>timing_alpha</key>
- <value>timing_alpha</value>
- </param>
- <param>
- <key>timing_max_dev</key>
- <value>1.5</value>
- </param>
- <param>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- </param>
- <param>
- <key>gray_code</key>
- <value>True</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>sync_out</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(487, 64)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_scopesink2</key>
- <param>
- <key>id</key>
- <value>wxgui_scopesink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>Recovered DQPSK Constellation</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate/4/20</value>
- </param>
- <param>
- <key>v_scale</key>
- <value>0</value>
- </param>
- <param>
- <key>v_offset</key>
- <value>0</value>
- </param>
- <param>
- <key>t_scale</key>
- <value>0</value>
- </param>
- <param>
- <key>ac_couple</key>
- <value>False</value>
- </param>
- <param>
- <key>xy_mode</key>
- <value>True</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>1</value>
- </param>
- <param>
- <key>win_size</key>
- <value></value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(760, 239)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>180</value>
- </param>
- </block>
- <block>
- <key>gr_keep_one_in_n</key>
- <param>
- <key>id</key>
- <value>gr_keep_one_in_n_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>n</key>
- <value>20</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(873, 151)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>usrp2_source_xxxx_0</source_block_id>
- <sink_block_id>wxgui_fftsink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>usrp2_source_xxxx_0</source_block_id>
- <sink_block_id>blks2_dxpsk2_demod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_dxpsk2_demod_0</source_block_id>
- <sink_block_id>gr_null_sink_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_dxpsk2_demod_0</source_block_id>
- <sink_block_id>gr_keep_one_in_n_0</sink_block_id>
- <source_key>1</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_keep_one_in_n_0</source_block_id>
- <sink_block_id>wxgui_scopesink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp_two_tone_loopback.grc b/gnuradio-examples/grc/usrp/usrp_two_tone_loopback.grc
deleted file mode 100644
index 3df977044..000000000
--- a/gnuradio-examples/grc/usrp/usrp_two_tone_loopback.grc
+++ /dev/null
@@ -1,749 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Fri Apr 17 18:23:35 2009</timestamp>
- <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>64e6/200</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(9, 166)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>int(100e6)</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(116, 166)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_sig_source_x</key>
- <param>
- <key>id</key>
- <value>gr_sig_source_x</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>waveform</key>
- <value>gr.GR_COS_WAVE</value>
- </param>
- <param>
- <key>freq</key>
- <value>tone1</value>
- </param>
- <param>
- <key>amp</key>
- <value>tone_ampl</value>
- </param>
- <param>
- <key>offset</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(258, 20)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_sig_source_x</key>
- <param>
- <key>id</key>
- <value>gr_sig_source_x0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>waveform</key>
- <value>gr.GR_COS_WAVE</value>
- </param>
- <param>
- <key>freq</key>
- <value>tone2</value>
- </param>
- <param>
- <key>amp</key>
- <value>tone_ampl</value>
- </param>
- <param>
- <key>offset</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(255, 179)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_add_xx</key>
- <param>
- <key>id</key>
- <value>gr_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>3</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(528, 78)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>parameter</key>
- <param>
- <key>id</key>
- <value>tx_side</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value></value>
- </param>
- <param>
- <key>value</key>
- <value>A</value>
- </param>
- <param>
- <key>type</key>
- <value>string</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(688, 384)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp_simple_sink_x</key>
- <param>
- <key>id</key>
- <value>usrp_simple_sink_x</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>format</key>
- <value></value>
- </param>
- <param>
- <key>which</key>
- <value>0</value>
- </param>
- <param>
- <key>interpolation</key>
- <value>400</value>
- </param>
- <param>
- <key>frequency</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>gain</key>
- <value>0</value>
- </param>
- <param>
- <key>side</key>
- <value>tx_side</value>
- </param>
- <param>
- <key>transmit</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(835, 5)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp_simple_source_x</key>
- <param>
- <key>id</key>
- <value>usrp_simple_source_x</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>format</key>
- <value></value>
- </param>
- <param>
- <key>which</key>
- <value>0</value>
- </param>
- <param>
- <key>decimation</key>
- <value>200</value>
- </param>
- <param>
- <key>frequency</key>
- <value>tun_freq</value>
- </param>
- <param>
- <key>gain</key>
- <value>20</value>
- </param>
- <param>
- <key>side</key>
- <value>rx_side</value>
- </param>
- <param>
- <key>rx_ant</key>
- <value>rx_ant</value>
- </param>
- <param>
- <key>hb_filters</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(479, 224)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>parameter</key>
- <param>
- <key>id</key>
- <value>rx_ant</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value></value>
- </param>
- <param>
- <key>value</key>
- <value>RXA</value>
- </param>
- <param>
- <key>type</key>
- <value>string</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(802, 384)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_fftsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_fftsink2</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>FFT Plot</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>baseband_freq</key>
- <value>0</value>
- </param>
- <param>
- <key>y_per_div</key>
- <value>10</value>
- </param>
- <param>
- <key>ref_level</key>
- <value>100</value>
- </param>
- <param>
- <key>fft_size</key>
- <value>512*2</value>
- </param>
- <param>
- <key>fft_rate</key>
- <value>15</value>
- </param>
- <param>
- <key>peak_hold</key>
- <value>False</value>
- </param>
- <param>
- <key>average</key>
- <value>False</value>
- </param>
- <param>
- <key>avg_alpha</key>
- <value>0</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>1, 2, 2, 4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(746, 133)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>parameter</key>
- <param>
- <key>id</key>
- <value>rx_side</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value></value>
- </param>
- <param>
- <key>value</key>
- <value>A</value>
- </param>
- <param>
- <key>type</key>
- <value>string</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(568, 382)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_noise_source_x</key>
- <param>
- <key>id</key>
- <value>gr_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>gr.GR_GAUSSIAN</value>
- </param>
- <param>
- <key>amp</key>
- <value>noise_ampl</value>
- </param>
- <param>
- <key>seed</key>
- <value>42</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(276, 312)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>noise_ampl</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Noise Ampl</value>
- </param>
- <param>
- <key>value</key>
- <value>2000</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>5000</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_VERTICAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>1, 1, 2, 1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(20, 243)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tone_ampl</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Tone Ampl</value>
- </param>
- <param>
- <key>value</key>
- <value>5000</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>10e3</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_VERTICAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>1, 0, 2, 1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(28, 437)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tone1</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Tone 1</value>
- </param>
- <param>
- <key>value</key>
- <value>50e3</value>
- </param>
- <param>
- <key>min</key>
- <value>-samp_rate/2</value>
- </param>
- <param>
- <key>max</key>
- <value>samp_rate/2</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>0, 0, 1, 4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(190, 436)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tone2</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Tone 2</value>
- </param>
- <param>
- <key>value</key>
- <value>75e3</value>
- </param>
- <param>
- <key>min</key>
- <value>-samp_rate/2</value>
- </param>
- <param>
- <key>max</key>
- <value>samp_rate/2</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>0, 4, 1, 4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(367, 439)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp_two_tone_loopback</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP Loopback - 2 Tone</value>
- </param>
- <param>
- <key>author</key>
- <value>Example</value>
- </param>
- <param>
- <key>description</key>
- <value>Loopback test with basic rx and basic tx</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</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>
- <connection>
- <source_block_id>gr_sig_source_x</source_block_id>
- <sink_block_id>gr_add_xx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_sig_source_x0</source_block_id>
- <sink_block_id>gr_add_xx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>1</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_noise_source_x</source_block_id>
- <sink_block_id>gr_add_xx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>2</sink_key>
- </connection>
- <connection>
- <source_block_id>usrp_simple_source_x</source_block_id>
- <sink_block_id>wxgui_fftsink2</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_add_xx</source_block_id>
- <sink_block_id>usrp_simple_sink_x</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc b/gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc
deleted file mode 100644
index 90ec5e910..000000000
--- a/gnuradio-examples/grc/usrp/usrp_tx_dpsk.grc
+++ /dev/null
@@ -1,583 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Thu Dec 3 11:42:41 2009</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp_tx_dpsk</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP TX DPSK</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>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</value>
- </param>
- <param>
- <key>run_options</key>
- <value>prompt</value>
- </param>
- <param>
- <key>run</key>
- <value>True</value>
- </param>
- <param>
- <key>realtime_scheduling</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(10, 10)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>samps_per_sym</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(15, 76)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>random_source_x</key>
- <param>
- <key>id</key>
- <value>random_source_x_0</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>2**8</value>
- </param>
- <param>
- <key>num_samps</key>
- <value>1000</value>
- </param>
- <param>
- <key>repeat</key>
- <value>True</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(23, 319)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_dxpsk2_mod</key>
- <param>
- <key>id</key>
- <value>blks2_dxpsk2_mod_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>dqpsk</value>
- </param>
- <param>
- <key>samples_per_symbol</key>
- <value>samps_per_sym</value>
- </param>
- <param>
- <key>excess_bw</key>
- <value>0.35</value>
- </param>
- <param>
- <key>gray_code</key>
- <value>True</value>
- </param>
- <param>
- <key>verbose</key>
- <value>False</value>
- </param>
- <param>
- <key>log</key>
- <value>False</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(234, 151)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp_simple_sink_x</key>
- <param>
- <key>id</key>
- <value>usrp_simple_sink_x_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>which</key>
- <value>0</value>
- </param>
- <param>
- <key>interpolation</key>
- <value>int(128e6/samp_rate)</value>
- </param>
- <param>
- <key>frequency</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>lo_offset</key>
- <value>float('inf')</value>
- </param>
- <param>
- <key>gain</key>
- <value>0</value>
- </param>
- <param>
- <key>side</key>
- <value>A</value>
- </param>
- <param>
- <key>transmit</key>
- <value>auto_tr</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(516, 203)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp2_sink_xxxx</key>
- <param>
- <key>id</key>
- <value>usrp2_sink_xxxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>False</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>interface</key>
- <value></value>
- </param>
- <param>
- <key>mac_addr</key>
- <value></value>
- </param>
- <param>
- <key>interpolation</key>
- <value>int(100e6/samp_rate)</value>
- </param>
- <param>
- <key>frequency</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>lo_offset</key>
- <value>float('inf')</value>
- </param>
- <param>
- <key>gain</key>
- <value>0</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(498, 51)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>tx_ampl</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>TX Amplitude</value>
- </param>
- <param>
- <key>value</key>
- <value>.2</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>1</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(277, 491)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>2.45e9+freq_off</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(14, 141)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>freq_off</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Frequency Offset</value>
- </param>
- <param>
- <key>value</key>
- <value>0</value>
- </param>
- <param>
- <key>min</key>
- <value>-samp_rate/2</value>
- </param>
- <param>
- <key>max</key>
- <value>samp_rate/2</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(63, 483)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable</key>
- <param>
- <key>id</key>
- <value>p2p</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>2**15</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(179, 37)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_multiply_const_vxx</key>
- <param>
- <key>id</key>
- <value>gr_multiply_const_vxx_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>const</key>
- <value>tx_ampl*p2p/2.</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(306, 355)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_fftsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_fftsink2_0</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>Transmit Spectrum</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>samp_rate</value>
- </param>
- <param>
- <key>baseband_freq</key>
- <value>bb_freq</value>
- </param>
- <param>
- <key>y_per_div</key>
- <value>10</value>
- </param>
- <param>
- <key>y_divs</key>
- <value>10</value>
- </param>
- <param>
- <key>ref_level</key>
- <value>0</value>
- </param>
- <param>
- <key>ref_scale</key>
- <value>p2p</value>
- </param>
- <param>
- <key>fft_size</key>
- <value>1024</value>
- </param>
- <param>
- <key>fft_rate</key>
- <value>20</value>
- </param>
- <param>
- <key>peak_hold</key>
- <value>False</value>
- </param>
- <param>
- <key>average</key>
- <value>False</value>
- </param>
- <param>
- <key>avg_alpha</key>
- <value>0</value>
- </param>
- <param>
- <key>win</key>
- <value>None</value>
- </param>
- <param>
- <key>win_size</key>
- <value></value>
- </param>
- <param>
- <key>grid_pos</key>
- <value></value>
- </param>
- <param>
- <key>notebook</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(576, 410)</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>1e6/4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(12, 207)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <connection>
- <source_block_id>random_source_x_0</source_block_id>
- <sink_block_id>blks2_dxpsk2_mod_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_dxpsk2_mod_0</source_block_id>
- <sink_block_id>gr_multiply_const_vxx_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_multiply_const_vxx_0</source_block_id>
- <sink_block_id>usrp_simple_sink_x_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_multiply_const_vxx_0</source_block_id>
- <sink_block_id>wxgui_fftsink2_0</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/grc/usrp/usrp_wbfm_receive.grc b/gnuradio-examples/grc/usrp/usrp_wbfm_receive.grc
deleted file mode 100644
index 8f53475ab..000000000
--- a/gnuradio-examples/grc/usrp/usrp_wbfm_receive.grc
+++ /dev/null
@@ -1,466 +0,0 @@
-<?xml version='1.0' encoding='ASCII'?>
-<flow_graph>
- <timestamp>Fri Apr 17 19:06:07 2009</timestamp>
- <block>
- <key>options</key>
- <param>
- <key>id</key>
- <value>usrp_wbfm_receive</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>title</key>
- <value>USRP WBFM Receive</value>
- </param>
- <param>
- <key>author</key>
- <value>Example</value>
- </param>
- <param>
- <key>description</key>
- <value>WBFM Receive with Basic RX or TV RX</value>
- </param>
- <param>
- <key>window_size</key>
- <value>1280, 1024</value>
- </param>
- <param>
- <key>generate_options</key>
- <value>wx_gui</value>
- </param>
- <param>
- <key>category</key>
- <value>Custom</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>decim</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>value</key>
- <value>200</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(14, 173)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>volume</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Volume</value>
- </param>
- <param>
- <key>value</key>
- <value>1</value>
- </param>
- <param>
- <key>min</key>
- <value>0</value>
- </param>
- <param>
- <key>max</key>
- <value>10</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>1, 0, 1, 4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(991, 40)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>usrp_simple_source_x</key>
- <param>
- <key>id</key>
- <value>usrp_simple_source_x</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>format</key>
- <value></value>
- </param>
- <param>
- <key>which</key>
- <value>0</value>
- </param>
- <param>
- <key>decimation</key>
- <value>decim</value>
- </param>
- <param>
- <key>frequency</key>
- <value>(freq+fine)*1e6</value>
- </param>
- <param>
- <key>gain</key>
- <value>20</value>
- </param>
- <param>
- <key>side</key>
- <value>A</value>
- </param>
- <param>
- <key>rx_ant</key>
- <value>None</value>
- </param>
- <param>
- <key>hb_filters</key>
- <value></value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(277, 29)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>wxgui_fftsink2</key>
- <param>
- <key>id</key>
- <value>wxgui_fftsink2</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>complex</value>
- </param>
- <param>
- <key>title</key>
- <value>FFT Plot</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>64e6/decim</value>
- </param>
- <param>
- <key>baseband_freq</key>
- <value>(freq+fine)*1e6</value>
- </param>
- <param>
- <key>y_per_div</key>
- <value>10</value>
- </param>
- <param>
- <key>ref_level</key>
- <value>50</value>
- </param>
- <param>
- <key>fft_size</key>
- <value>512</value>
- </param>
- <param>
- <key>fft_rate</key>
- <value>15</value>
- </param>
- <param>
- <key>peak_hold</key>
- <value>False</value>
- </param>
- <param>
- <key>average</key>
- <value>False</value>
- </param>
- <param>
- <key>avg_alpha</key>
- <value>0</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>2, 0, 2, 4</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(512, 191)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>freq</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Frequency (MHz)</value>
- </param>
- <param>
- <key>value</key>
- <value>100</value>
- </param>
- <param>
- <key>min</key>
- <value>87.5</value>
- </param>
- <param>
- <key>max</key>
- <value>108.0</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>1000</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>0, 0, 1, 2</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(104, 243)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>variable_slider</key>
- <param>
- <key>id</key>
- <value>fine</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>label</key>
- <value>Fine Freq (MHz)</value>
- </param>
- <param>
- <key>value</key>
- <value>0</value>
- </param>
- <param>
- <key>min</key>
- <value>-.1</value>
- </param>
- <param>
- <key>max</key>
- <value>.1</value>
- </param>
- <param>
- <key>num_steps</key>
- <value>100</value>
- </param>
- <param>
- <key>style</key>
- <value>wx.SL_HORIZONTAL</value>
- </param>
- <param>
- <key>converver</key>
- <value>float_converter</value>
- </param>
- <param>
- <key>grid_pos</key>
- <value>0, 2, 1, 2</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(275, 246)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>blks2_wfm_rcv</key>
- <param>
- <key>id</key>
- <value>blks2_wfm_rcv</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>quad_rate</key>
- <value>64e6/decim</value>
- </param>
- <param>
- <key>audio_decimation</key>
- <value>10</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(510, 37)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>gr_multiply_const_vxx</key>
- <param>
- <key>id</key>
- <value>gr_multiply_const_vxx</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>type</key>
- <value>float</value>
- </param>
- <param>
- <key>const</key>
- <value>volume</value>
- </param>
- <param>
- <key>vlen</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(764, 55)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>0</value>
- </param>
- </block>
- <block>
- <key>audio_sink</key>
- <param>
- <key>id</key>
- <value>audio_sink</value>
- </param>
- <param>
- <key>_enabled</key>
- <value>True</value>
- </param>
- <param>
- <key>samp_rate</key>
- <value>32000</value>
- </param>
- <param>
- <key>device_name</key>
- <value></value>
- </param>
- <param>
- <key>ok_to_block</key>
- <value>True</value>
- </param>
- <param>
- <key>num_inputs</key>
- <value>1</value>
- </param>
- <param>
- <key>_coordinate</key>
- <value>(703, 241)</value>
- </param>
- <param>
- <key>_rotation</key>
- <value>180</value>
- </param>
- </block>
- <connection>
- <source_block_id>usrp_simple_source_x</source_block_id>
- <sink_block_id>blks2_wfm_rcv</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>usrp_simple_source_x</source_block_id>
- <sink_block_id>wxgui_fftsink2</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>blks2_wfm_rcv</source_block_id>
- <sink_block_id>gr_multiply_const_vxx</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
- <connection>
- <source_block_id>gr_multiply_const_vxx</source_block_id>
- <sink_block_id>audio_sink</sink_block_id>
- <source_key>0</source_key>
- <sink_key>0</sink_key>
- </connection>
-</flow_graph>
diff --git a/gnuradio-examples/python/Makefile.am b/gnuradio-examples/python/Makefile.am
index 65021729a..a32f1fa86 100644
--- a/gnuradio-examples/python/Makefile.am
+++ b/gnuradio-examples/python/Makefile.am
@@ -22,16 +22,9 @@
include $(top_srcdir)/Makefile.common
SUBDIRS = \
- apps \
- digital \
- digital-bert \
- digital_voice \
mp-sched \
- multi-antenna \
multi_usrp \
network \
ofdm \
pfb \
- tags \
- usrp \
- usrp2
+ tags
diff --git a/gnuradio-examples/python/apps/README b/gnuradio-examples/python/apps/README
deleted file mode 100644
index b64b9d066..000000000
--- a/gnuradio-examples/python/apps/README
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2005 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.
-#
-
-This directory servers as the parent directory for various and sundry
-applications such as scanners, HF radios, etc. Each subdirectory
-shall have a README file that includes a short description of what the
-application does, and a list of hardware dependencies. E.g., requires
-a USRP with an xyz daughterboard, connected to a footronics magic box.
diff --git a/gnuradio-examples/python/apps/hf_explorer/README b/gnuradio-examples/python/apps/hf_explorer/README
deleted file mode 100644
index 5f780b3d9..000000000
--- a/gnuradio-examples/python/apps/hf_explorer/README
+++ /dev/null
@@ -1,48 +0,0 @@
-hfx.py is meant to be a full-featured Long Wave / Medium Wave
-and Short Wave (250kHz to 30Mhz) AM and Single Sideband receiver.
-It uses the USRP with a Basic RX board, and will need an
-antenna and some preamps, about 30db gain will work. See the
-'Help' menu or hfx_help for more info.
-
-----------------------------------------------------------
-
-hfx2.py is a major revision built about complex fir filter
-coeffecients ability and cleaner python script. Inherits
-most features from hfx.py - Powermate knob supported but
-not required, tooltip frequency display, single click
-tuning, AGC, record to disk, play from disk and record audio.
-New feature is ability to tailor the audio passband with two
-sliders over the spectrum display. The sliders almost align
-with the actual frequency. Preset filter settings for LSB
-(-3000 to 0kHz), USB (0 to +3000kHz), CW (-400 to -800Hz)
-and AM (-5kHz from carrier to +5kHz).
-
-AM now switches in a synchronous PLL detector with the
-carriers at 7.5kHz. The PLL carrier is displayed in the
-bottom display and helps show where on the upper spectrum
-the demodulated signal lies. Everything gets shifted up
-7.5kHz in AM, center frequency, tooltips, etc. The target
-AM carrier needs to be closely tuned in, it will have a
-hollow sound untill it is locked, and then the PLL carrier
-in the bottom display will jump up and remain relatively
-constant. There is a slider "AM sync carrier" to play with
-different levels to mix with the signal for demodulation.
-The filter in AM is preset to 2500/12500 (7.5kHz +/- 5kHz)
-and is handy for removing adjacent channel interference.
-Change AM_SYNC_DISPLAY in script for whether to show AM
-Sync carrier or not.
-Run with "-h" for command line help with setting USRP
-ddc center frequency, decimation, rf data record, playback
-and audio data recording.
-
-There are some controls for controlling a varactor and
-tuning an antenna - just ignore them unless you want
-to build a voltage tuned antenna to track frequency.
-
-There is also code for Web based control of frequency and
-volume - so I can tune the radio with an Ipaq from bed.
-Disabled by default - it takes a web server, some
-directories and scripts to use.
-
-
-
diff --git a/gnuradio-examples/python/apps/hf_radio/input.py b/gnuradio-examples/python/apps/hf_radio/input.py
deleted file mode 100644
index 5984d8254..000000000
--- a/gnuradio-examples/python/apps/hf_radio/input.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# Basic USRP setup and control.
-# It's only ever been tried with a basic rx daughter card.
-#
-# Imagine that the gnuradio boilerplate is here.
-#
-# M. Revnell 2005-Dec
-
-from gnuradio import gr, gru, optfir
-from gnuradio import usrp
-from usrpm import usrp_dbid
-import math
-
-# Put special knowlege of usrp here.
-
-class input:
- def __init__( self, decim ):
- self.freq = -2.5e6
- self.src = usrp.source_c( )
- self.subdev = usrp.pick_subdev( self.src,
- (usrp_dbid.BASIC_RX,
- usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO))
-
- print self.subdev
-
- self.subdevice = usrp.selected_subdev( self.src,
- self.subdev )
-
- self.mux = usrp.determine_rx_mux_value( self.src,
- self.subdev )
- self.decim = decim
-
- self.adc_rate = self.src.adc_rate()
- self.usrp_rate = self.adc_rate / self.decim
- self.src.set_decim_rate( self.decim )
- self.src.set_mux( self.mux )
- usrp.tune( self.src, 0, self.subdevice, self.freq )
-
- def set_freq( self, x ):
- r = usrp.tune( self.src, 0, self.subdevice, -x )
- if r:
- self.freq = -x
diff --git a/gnuradio-examples/python/apps/hf_radio/output.py b/gnuradio-examples/python/apps/hf_radio/output.py
deleted file mode 100644
index dc9caf528..000000000
--- a/gnuradio-examples/python/apps/hf_radio/output.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Audio output with a volume control.
-#
-# M. Revnell 2005-Dec
-
-from gnuradio import gr, gru
-from gnuradio import audio
-
-class output( gr.hier_block ):
- def __init__( self, fg, rate ):
- self.out = audio.sink( rate )
- self.vol = gr.multiply_const_ff( 0.1 )
- fg.connect( self.vol, self.out )
- gr.hier_block.__init__(self, fg, self.vol, None )
-
- def set( self, val ):
- self.vol.set_k( val )
-
diff --git a/gnuradio-examples/python/apps/hf_radio/ssbagc.py b/gnuradio-examples/python/apps/hf_radio/ssbagc.py
deleted file mode 100644
index fdf40bc6b..000000000
--- a/gnuradio-examples/python/apps/hf_radio/ssbagc.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# post detection agc processing
-#
-# Imagine that the usual gnuradio copyright stuff is right here.
-#
-# This agc strategy is copied more or less verbatim from
-# weaver_isb_am1_usrp3.py by cswiger.
-#
-# Thanks.
-#
-# Then modified in a variety of ways.
-#
-# There doesn't appear to be a way to hook multiple blocks to the
-# input port when building a hier block like this. Thus the
-# split below.
-#
-# Basic operation.
-# Power is estimated by squaring the input.
-# Low pass filter using a 1 pole iir.
-# The time constant can be tweaked by changing the taps.
-# Currently there is no implementation to change this while operating
-# a potentially useful addition.
-# The log block turns this into dB
-# gain adjusts the agc authority.
-#
-# M. Revnell 2006-Jan
-
-from gnuradio import gr, gru
-
-class agc( gr.hier_block ):
- def __init__( self, fg ):
- self.split = gr.multiply_const_ff( 1 )
- self.sqr = gr.multiply_ff( )
- self.int0 = gr.iir_filter_ffd( [.004, 0], [0, .999] )
- self.offs = gr.add_const_ff( -30 )
- self.gain = gr.multiply_const_ff( 70 )
- self.log = gr.nlog10_ff( 10, 1 )
- self.agc = gr.divide_ff( )
-
- fg.connect( self.split, ( self.agc, 0 ) )
- fg.connect( self.split, ( self.sqr, 0 ) )
- fg.connect( self.split, ( self.sqr, 1 ) )
- fg.connect( self.sqr, self.int0 )
- fg.connect( self.int0, self.log )
- fg.connect( self.log, self.offs )
- fg.connect( self.offs, self.gain )
- fg.connect( self.gain, ( self.agc, 1 ) )
-
- gr.hier_block.__init__( self, fg, self.split, self.agc )
diff --git a/gnuradio-examples/python/digital-bert/README b/gnuradio-examples/python/digital-bert/README
deleted file mode 100644
index 83f52f4f5..000000000
--- a/gnuradio-examples/python/digital-bert/README
+++ /dev/null
@@ -1,63 +0,0 @@
-BERT testing example scripts
-
-
-benchmark_tx.py
-
-This sets up a BPSK transmitter that is modulated with a pseudorandom
-sequence of bits. The PN code is generated by sending an all 1s
-sequence through a 7-bit scrambler. The transmitter performs the BPSK
-modulation, then passes the complex baseband waveform through a
-root-raised-cosine filter and onto the USRP.
-
-The --sps parameter controls how many baseband samples per symbol
-are created and passed through the RRC filter, prior to going to the
-USRP over the USB for interpolation to the final DAC rate.
-
-The baseband bit rate is controlled by -r or --rate. This value, when
-multiplied by the --sps parameter, must result in valid interpolation
-rate for the USRP. For example, if the baseband rate is 250k bits/sec,
-and the samples per symbol is 4, then the final rate is 1M samples/sec,
-which results in an interpolation rate of 128. The valid interpolation
-rates for the USRP are multiples of 4 between 16 and 512.
-
-Finally, the RRC excess bandwidth may be specified by --excess-bw.
-(See ./benchmark_tx.py -h for additional parameters.)
-
-
-benchmark_rx.py
-
-This sets up a BPSK receiver to demodulate the received waveform. It
-accepts a similar set of parameters as the transmitter, except that one
-specifies the USRP decimation rate desired. The resulting sample stream
-rate must be an integral number of baseband symbols. For example, the
-parameters corresponding to the above transmitter would be to use a
-decimation rate of 8 (32 sps), 16 (16 sps), 32 (8 sps), 64, (4 sps), or
-128 (2 sps). The lower the USRP decimation, the more CPU is required to
-demodulate the signal, so not all valid decimation rates will work.
-
-The baseband signal from the USRP is first passed through an AGC to
-establish an average power of 1.0. It is then passed through a matched
-filter (another RRC), a Costas phase-locked loop, and a Mueller and
-Muller bit timing recovery loop. The resulting constellation has an SNR
-estimation probe attached, and is then sliced into a bit stream.
-
-The recovered bits are then passed through a 7-bit descrambler. If
-there are no channel errors, the all 1s sequence is recovered. In the
-event of a channel error, there will be a 0 in the bit stream for each
-feedback tap in the descrambler. In this case, the CCSDS descrambler is
-using 3 feedback taps.
-
-Finally, the signal is passed into a bit density measurement probe. The
-channel BER is measured by dividing the 0s density by three. This
-measurement is inaccurate at high BER rates (>10%) as the error 0s
-begin to overlap.
-
-The benchmark script will, once per second, output the Costas loop
-frequency offset, the recovered timing error, the estimated SNR, and the
-average BER.
-
-NOTE: The particular SNR estimator used is inaccurate below about 7dB,
-and will report erroneously high values even for random noise.
-
-There are a variety of Costas and M&M loop parameters one can adjust.
-See ./benchmark_rx.py -h for the full set.
diff --git a/gnuradio-examples/python/digital-bert/benchmark_rx.py b/gnuradio-examples/python/digital-bert/benchmark_rx.py
deleted file mode 100755
index 1e00dbd76..000000000
--- a/gnuradio-examples/python/digital-bert/benchmark_rx.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-
-from gnuradio import gr, eng_notation, usrp
-from optparse import OptionParser
-from gnuradio.eng_option import eng_option
-from receive_path import receive_path
-import gnuradio.gr.gr_threading as _threading
-import sys, time
-
-n2s = eng_notation.num_to_str
-
-class status_thread(_threading.Thread):
- def __init__(self, tb):
- _threading.Thread.__init__(self)
- self.setDaemon(1)
- self.tb = tb
- self.done = False
- self.start()
-
- def run(self):
- while not self.done:
- print "Freq. Offset: %5.0f Hz Timing Offset: %5.1f ppm Estimated SNR: %4.1f dB BER: %g" % (
- tb.frequency_offset(), tb.timing_offset()*1e6, tb.snr(), tb.ber())
- try:
- time.sleep(1.0)
- except KeyboardInterrupt:
- self.done = True
-
-class rx_bpsk_block(gr.top_block):
- def __init__(self, options):
-
- gr.top_block.__init__(self, "rx_mpsk")
-
- print "USRP decimation rate", options.decim_rate
-
- # Create a USRP source at desired board, sample rate, frequency, and gain
- self._setup_usrp(options.which,
- options.decim_rate,
- options.rx_subdev_spec,
- options.freq,
- options.gain)
-
- # Create the BERT receiver
- if_rate = self._usrp.adc_rate()/options.decim_rate
- self._receiver = receive_path(if_rate,
- options.rate,
- options.excess_bw,
- options.costas_alpha,
- options.costas_beta,
- options.costas_max,
- options.mm_gain_mu,
- options.mm_gain_omega,
- options.mm_omega_limit)
-
- self.connect(self._usrp, self._receiver)
-
-
- def _setup_usrp(self, which, decim, subdev_spec, freq, gain):
- self._usrp = usrp.source_c(which=which, decim_rate=decim)
- if subdev_spec is None:
- subdev_spec = usrp.pick_rx_subdevice(self._usrp)
- self._subdev = usrp.selected_subdev(self._usrp, subdev_spec)
- mux = usrp.determine_rx_mux_value(self._usrp, subdev_spec)
- self._usrp.set_mux(mux)
- tr = self._usrp.tune(0, self._subdev, freq)
- if not (tr):
- print "Failed to tune to center frequency!"
- else:
- print "Center frequency:", n2s(freq)
- if gain is None:
- g = self._subdev.gain_range();
- gain = float(g[0]+g[1])/2.0
- self._subdev.set_gain(gain)
- print "RX d'board:", self._subdev.side_and_name()
-
- def snr(self):
- return self._receiver.snr()
-
- def mag(self):
- return self._receiver.signal_mean()
-
- def var(self):
- return self._receiver.noise_variance()
-
- def ber(self):
- return self._receiver.ber()
-
- def frequency_offset(self):
- return self._receiver.frequency_offset()
-
- def timing_offset(self):
- return self._receiver.timing_offset()
-
-def get_options():
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which USRP (0, 1, ...) (default is %default)",
- metavar="NUM")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set Rx gain (default is mid-point)")
- parser.add_option("-r", "--rate", type="eng_float", default=250e3,
- help="Select modulation symbol rate (default=%default)")
- parser.add_option("-d", "--decim-rate", type="int", default=8,
- help="Select USRP decimation rate (default=%default)")
- parser.add_option("", "--excess-bw", type="eng_float", default=0.35,
- help="Select RRC excess bandwidth (default=%default)")
- parser.add_option("", "--costas-alpha", type="eng_float", default=0.05,
- help="set Costas loop 1st order gain, (default=%default)")
- parser.add_option("", "--costas-beta", type="eng_float", default=0.00025,
- help="set Costas loop 2nd order gain, (default=%default)")
- parser.add_option("", "--costas-max", type="eng_float", default=0.05,
- help="set Costas loop max freq (rad/sample) (default=%default)")
- parser.add_option("", "--mm-gain-mu", type="eng_float", default=0.001,
- help="set M&M loop 1st order gain, (default=%default)")
- parser.add_option("", "--mm-gain-omega", type="eng_float", default=0.000001,
- help="set M&M loop 2nd order gain, (default=%default)")
- parser.add_option("", "--mm-omega-limit", type="eng_float", default=0.0001,
- help="set M&M max timing error, (default=%default)")
-
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- if options.freq == None:
- print "You must supply a frequency with -f or --freq"
- sys.exit(1)
-
- return (options, args)
-
-
-if __name__ == "__main__":
- (options, args) = get_options()
-
- tb = rx_bpsk_block(options)
-
- print "\n*** SNR estimator is inaccurate below about 7dB"
- print "*** BER estimator is inaccurate above about 10%\n"
- updater = status_thread(tb)
-
- try:
- tb.run()
- except KeyboardInterrupt:
- updater.done = True
- updater = None
diff --git a/gnuradio-examples/python/digital-bert/benchmark_tx.py b/gnuradio-examples/python/digital-bert/benchmark_tx.py
deleted file mode 100755
index 000f4bca2..000000000
--- a/gnuradio-examples/python/digital-bert/benchmark_tx.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-
-from gnuradio import gr, eng_notation, usrp
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-from transmit_path import transmit_path
-import sys
-
-_dac_rate = 128e6
-
-n2s = eng_notation.num_to_str
-
-class tx_bpsk_block(gr.top_block):
- def __init__(self, options):
- gr.top_block.__init__(self, "tx_mpsk")
-
- self._transmitter = transmit_path(options.sps,
- options.excess_bw,
- options.amplitude)
-
- if_rate = options.rate*options.sps
- interp = int(_dac_rate/if_rate)
-
- print "Modulation:", n2s(options.rate), "bits/sec"
- print "TX IF rate:", n2s(if_rate), "samples/sec"
- print "USRP interpolation:", interp
- print "DAC amplitude:", options.amplitude
-
- self._setup_usrp(options.which,
- interp,
- options.tx_subdev_spec,
- options.freq)
-
- self.connect(self._transmitter, self._usrp)
-
-
- def _setup_usrp(self, which, interp, subdev_spec, freq):
- self._usrp = usrp.sink_c(which=which, interp_rate=interp)
- if subdev_spec is None:
- subdev_spec = usrp.pick_tx_subdevice(self._usrp)
- self._usrp.set_mux(usrp.determine_tx_mux_value(self._usrp, subdev_spec))
- self._subdev = usrp.selected_subdev(self._usrp, subdev_spec)
- tr = usrp.tune(self._usrp, self._subdev.which(), self._subdev, freq)
- if not (tr):
- print "Failed to tune to center frequency!"
- else:
- print "Center frequency:", n2s(freq)
- gain = float(self._subdev.gain_range()[1]) # Max TX gain
- self._subdev.set_gain(gain)
- self._subdev.set_enable(True)
- print "TX d'board:", self._subdev.side_and_name()
-
-
-def get_options():
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which USRP (0, 1, ...) default is %default",
- metavar="NUM")
- parser.add_option("-T", "--tx-subdev-spec", type="subdev", default=None,
- help="select USRP Tx side A or B (default=first one with a daughterboard)")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-a", "--amplitude", type="eng_float", default=2000,
- help="set Tx amplitude (0-32767) (default=%default)")
- parser.add_option("-r", "--rate", type="eng_float", default=250e3,
- help="Select modulation symbol rate (default=%default)")
- parser.add_option("", "--sps", type="int", default=2,
- help="Select samples per symbol (default=%default)")
- parser.add_option("", "--excess-bw", type="eng_float", default=0.35,
- help="Select RRC excess bandwidth (default=%default)")
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- if options.freq == None:
- print "Must supply frequency as -f or --freq"
- sys.exit(1)
-
- return (options, args)
-
-if __name__ == "__main__":
- (options, args) = get_options()
-
- tb = tx_bpsk_block(options)
-
- try:
- tb.run()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital-bert/receive_path.py b/gnuradio-examples/python/digital-bert/receive_path.py
deleted file mode 100644
index e273923a4..000000000
--- a/gnuradio-examples/python/digital-bert/receive_path.py
+++ /dev/null
@@ -1,118 +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.
-#
-
-from gnuradio import gr, eng_notation
-import math
-
-n2s = eng_notation.num_to_str
-
-class receive_path(gr.hier_block2):
- def __init__(self,
- if_rate, # Incoming sample rate
- symbol_rate, # Original symbol rate
- excess_bw, # RRC excess bandwidth, typically 0.35-0.5
- costas_alpha, # Costas loop 1st order gain, typically 0.01-0.2
- costas_beta, # Costas loop 2nd order gain, typically alpha^2/4.0
- costas_max, # Costas loop max frequency offset in radians/sample
- mm_gain_mu, # M&M loop 1st order gain, typically 0.001-0.2
- mm_gain_omega, # M&M loop 2nd order gain, typically alpha^2/4.0
- mm_omega_limit, # M&M loop max timing error
- ):
-
- gr.hier_block2.__init__(self, "receive_path",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
-
- self._if_rate = if_rate
- self._sps = int(self._if_rate/symbol_rate)
- print "IF sample rate:", n2s(self._if_rate)
- print "Symbol rate:", n2s(symbol_rate)
- print "Samples/symbol:", self._sps
- print "RRC bandwidth:", excess_bw
-
- # Create AGC to scale input to unity
- self._agc = gr.agc_cc(1e-5, 1.0, 1.0, 1.0)
-
- # Create RRC with specified excess bandwidth
- taps = gr.firdes.root_raised_cosine(1.0, # Gain
- self._sps, # Sampling rate
- 1.0, # Symbol rate
- excess_bw, # Roll-off factor
- 11*self._sps) # Number of taps
-
- self._rrc = gr.fir_filter_ccf(1, taps)
-
- # Create a Costas loop frequency/phase recovery block
-
- print "Costas alpha:", costas_alpha
- print "Costas beta:", costas_beta
- print "Costas max:", costas_max
-
- self._costas = gr.costas_loop_cc(costas_alpha, # PLL first order gain
- costas_beta, # PLL second order gain
- costas_max, # Max frequency offset rad/sample
- -costas_max, # Min frequency offset rad/sample
- 2) # BPSK
-
- # Create a M&M bit synchronization retiming block
- mm_mu = 0.5
- mm_omega = self._sps
-
- print "MM gain mu:", mm_gain_mu
- print "MM gain omega:", mm_gain_omega
- print "MM omega limit:", mm_omega_limit
-
- self._mm = gr.clock_recovery_mm_cc(mm_omega, # Initial samples/symbol
- mm_gain_omega, # Second order gain
- mm_mu, # Initial symbol phase
- mm_gain_mu, # First order gain
- mm_omega_limit) # Maximum timing offset
-
- # Add an SNR probe on the demodulated constellation
- self._snr_probe = gr.probe_mpsk_snr_c(10.0/symbol_rate)
- self.connect(self._mm, self._snr_probe)
-
- # Slice the resulting constellation into bits.
- # Get inphase channel and make decision about 0
- self._c2r = gr.complex_to_real()
- self._slicer = gr.binary_slicer_fb()
-
- # Descramble BERT sequence. A channel error will create 3 incorrect bits
- self._descrambler = gr.descrambler_bb(0x8A, 0x7F, 7) # CCSDS 7-bit descrambler
-
- # Measure BER by the density of 0s in the stream
- self._ber = gr.probe_density_b(1.0/symbol_rate)
-
- self.connect(self, self._agc, self._rrc, self._costas, self._mm,
- self._c2r, self._slicer, self._descrambler, self._ber)
-
- def frequency_offset(self):
- return self._costas.freq()*self._if_rate/(2*math.pi)
-
- def timing_offset(self):
- return self._mm.omega()/self._sps-1.0
-
- def snr(self):
- return self._snr_probe.snr()
-
- def ber(self):
- return (1.0-self._ber.density())/3.0
-
diff --git a/gnuradio-examples/python/digital-bert/transmit_path.py b/gnuradio-examples/python/digital-bert/transmit_path.py
deleted file mode 100644
index 96834b398..000000000
--- a/gnuradio-examples/python/digital-bert/transmit_path.py
+++ /dev/null
@@ -1,61 +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.
-#
-
-from gnuradio import gr
-from math import pi, log10
-import cmath
-
-class transmit_path(gr.hier_block2):
- """
- This transmits a BERT sequence of bits using filtered BPSK and
- outputs the complex baseband waveform.
- """
- def __init__(self,
- sps, # Samples per symbol
- excess_bw, # RRC filter excess bandwidth (typically 0.35-0.5)
- amplitude # DAC output level, 0-32767, typically 2000-8000
- ):
-
- gr.hier_block2.__init__(self, "transmit_path",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- # Create BERT data bit stream
- self._bits = gr.vector_source_b([1,], True) # Infinite stream of ones
- self._scrambler = gr.scrambler_bb(0x8A, 0x7F, 7) # CCSDS 7-bit scrambler
-
- # Map to constellation
- self._constellation = [-1+0j, 1+0j]
- self._mapper = gr.chunks_to_symbols_bc(self._constellation)
-
- # Create RRC with specified excess bandwidth
- taps = gr.firdes.root_raised_cosine(sps*amplitude, # Gain
- sps, # Sampling rate
- 1.0, # Symbol rate
- excess_bw, # Roll-off factor
- 11*sps) # Number of taps
-
- self._rrc = gr.interp_fir_filter_ccf(sps, # Interpolation rate
- taps) # FIR taps
-
- # Wire block inputs and outputs
- self.connect(self._bits, self._scrambler, self._mapper, self._rrc, self)
-
diff --git a/gnuradio-examples/python/digital/benchmark_loopback.py b/gnuradio-examples/python/digital/benchmark_loopback.py
deleted file mode 100755
index 47e4f2028..000000000
--- a/gnuradio-examples/python/digital/benchmark_loopback.py
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005, 2006, 2007, 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, gru, modulation_utils
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-import random, time, struct, sys, math
-
-# from current dir
-from transmit_path import transmit_path
-from receive_path import receive_path
-
-class my_top_block(gr.top_block):
- def __init__(self, mod_class, demod_class, rx_callback, options):
- gr.top_block.__init__(self)
-
- channelon = True;
-
- SNR = 10.0**(options.snr/10.0)
- frequency_offset = options.frequency_offset
-
- power_in_signal = abs(options.tx_amplitude)**2
- noise_power = power_in_signal/SNR
- noise_voltage = math.sqrt(noise_power)
-
- # With new interface, sps does not get set by default, but
- # in the loopback, we don't recalculate it; so just force it here
- if(options.samples_per_symbol == None):
- options.samples_per_symbol = 2
-
- self.txpath = transmit_path(mod_class, options)
- self.throttle = gr.throttle(gr.sizeof_gr_complex, options.sample_rate)
- self.rxpath = receive_path(demod_class, rx_callback, options)
-
- if channelon:
- self.channel = gr.channel_model(noise_voltage, frequency_offset, 1.01)
-
- if options.discontinuous:
- z = 20000*[0,]
- self.zeros = gr.vector_source_c(z, True)
- packet_size = 5*((4+8+4+1500+4) * 8)
- self.mux = gr.stream_mux(gr.sizeof_gr_complex, [packet_size-0, int(9e5)])
-
- # Connect components
- self.connect(self.txpath, (self.mux,0))
- self.connect(self.zeros, (self.mux,1))
- self.connect(self.mux, self.channel, self.rxpath)
-
- else:
- self.connect(self.txpath, self.channel, self.rxpath)
-
- else:
- # Connect components
- self.connect(self.txpath, self.throttle, 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
- (pktno,) = struct.unpack('!H', payload[0:2])
- n_rcvd += 1
- if ok:
- n_right += 1
-
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
- # print payload[2:len(payload)]
-
- def send_pkt(payload='', eof=False):
- return tb.txpath.send_pkt(payload, eof)
-
-
- mods = modulation_utils.type_1_mods()
- demods = modulation_utils.type_1_demods()
-
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
- channel_grp = parser.add_option_group("Channel")
-
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
- default='dbpsk',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
-
- parser.add_option("-s", "--size", type="eng_float", default=1500,
- 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 discontinous transmission (bursts of 5 packets)")
-
- channel_grp.add_option("", "--sample-rate", type="eng_float", default=1e5,
- help="set speed of channel/simulation rate to RATE [default=%default]")
- channel_grp.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB [default=%default]")
- channel_grp.add_option("", "--frequency-offset", type="eng_float", default=0,
- help="set frequency offset introduced by channel [default=%default]")
- channel_grp.add_option("", "--seed", action="store_true", default=False,
- help="use a random seed for AWGN noise [default=%default]")
-
- transmit_path.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
-
- for mod in mods.values():
- mod.add_options(expert_grp)
- for demod in demods.values():
- demod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- r = gr.enable_realtime_scheduling()
- if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
-
- # Create an instance of a hierarchical block
- tb = my_top_block(mods[options.modulation], demods[options.modulation], rx_callback, options)
- tb.start()
-
- # generate and send packets
- nbytes = int(1e6 * options.megabytes)
- n = 0
- pktno = 0
- pkt_size = int(options.size)
-
- while n < nbytes:
- send_pkt(struct.pack('!H', pktno & 0xffff) + (pkt_size - 2) * chr(pktno & 0xff))
- n += pkt_size
- pktno += 1
-
- send_pkt(eof=True)
-
- tb.wait()
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital/benchmark_qt_loopback.py b/gnuradio-examples/python/digital/benchmark_qt_loopback.py
deleted file mode 100755
index 0ae0e4e51..000000000
--- a/gnuradio-examples/python/digital/benchmark_qt_loopback.py
+++ /dev/null
@@ -1,470 +0,0 @@
-#!/usr/bin/env python
-
-from gnuradio import gr, gru, modulation_utils
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import random, time, struct, sys, os, math
-
-from threading import Thread
-
-# from current dir
-from transmit_path import transmit_path
-from receive_path import receive_path
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Please install gr-qtgui."
- sys.exit(1)
-
-try:
- from qt_digital_window import Ui_DigitalWindow
-except ImportError:
- print "Error: could not find qt_digital_window.py:"
- print "\t\"pyuic4 qt_digital_window.ui -o qt_digital_window.py\""
- sys.exit(1)
-
-
-#print os.getpid()
-#raw_input()
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-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_timing_gain_alpha())
- self.set_alpha(self.fg.rx_alpha())
-
- # 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)
-
- # Build a timer to update the packet number and PER fields
- self.update_delay = 250 # time between updating packet rate fields
- self.pkt_timer = QtCore.QTimer(self)
- self.connect(self.pkt_timer, QtCore.SIGNAL("timeout()"),
- self.updatePacketInfo)
- self.pkt_timer.start(self.update_delay)
-
- 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_alpha(self, alpha):
- self.gui.alphaEdit.setText(QtCore.QString("%1").arg(alpha))
-
- def alphaEditText(self):
- try:
- alpha = self.gui.alphaEdit.text().toDouble()[0]
- self.fg.set_rx_alpha(alpha)
- except RuntimeError:
- pass
-
- def gainMuEditText(self):
- try:
- gain = self.gui.gainMuEdit.text().toDouble()[0]
- self.fg.set_rx_timing_gain_alpha(gain)
- except RuntimeError:
- pass
-
- # Accessor functions for packet error reporting
- def updatePacketInfo(self):
- # Pull these globals in from the main thread
- global n_rcvd, n_right, pktno
-
- if(pktno > 0):
- per = float(n_rcvd - n_right)/float(pktno)
- else:
- per = 0
- self.gui.pktsRcvdEdit.setText(QtCore.QString("%1").arg(n_rcvd))
- self.gui.pktsCorrectEdit.setText(QtCore.QString("%1").arg(n_right))
- self.gui.perEdit.setText(QtCore.QString("%1").arg(per))
-
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the GNU Radio Top Block
-# ////////////////////////////////////////////////////////////////////
-
-
-
-class my_top_block(gr.top_block):
- def __init__(self, mod_class, demod_class, rx_callback, options):
- gr.top_block.__init__(self)
-
- self._sample_rate = options.sample_rate
-
- if(options.samples_per_symbol is None):
- options.samples_per_symbol = 2
-
- channelon = True;
-
- self.gui_on = options.gui
-
- self._frequency_offset = options.frequency_offset
- self._timing_offset = options.timing_offset
- self._tx_amplitude = options.tx_amplitude
- self._snr_dB = options.snr
-
- self._noise_voltage = self.get_noise_voltage(self._snr_dB)
-
- self.txpath = transmit_path(mod_class, options)
- self.throttle = gr.throttle(gr.sizeof_gr_complex, self.sample_rate())
- self.rxpath = receive_path(demod_class, rx_callback, options)
-
- # FIXME: do better exposure to lower issues for control
- self._timing_gain_alpha = self.rxpath.packet_receiver._demodulator._mm_gain_mu
- self._alpha = self.rxpath.packet_receiver._demodulator._costas_alpha
-
- if channelon:
- self.channel = gr.channel_model(self._noise_voltage,
- self.frequency_offset(),
- self.timing_offset())
-
- if options.discontinuous:
- z = 20000*[0,]
- self.zeros = gr.vector_source_c(z, True)
- packet_size = 5*((4+8+4+1500+4) * 8)
- self.mux = gr.stream_mux(gr.sizeof_gr_complex, [packet_size-0, int(9e5)])
-
- # Connect components
- self.connect(self.txpath, self.throttle, (self.mux,0))
- self.connect(self.zeros, (self.mux,1))
- self.connect(self.mux, self.channel, self.rxpath)
-
- else:
- self.connect(self.txpath, self.throttle, self.channel, self.rxpath)
-
- if self.gui_on:
- self.qapp = QtGui.QApplication(sys.argv)
- fftsize = 2048
-
- self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._sample_rate,
- "Tx", True, True, False, True, True)
- self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._sample_rate,
- "Rx", True, True, False, True, True)
-
- self.snk_tx.set_frequency_axis(-80, 0)
- self.snk_rx.set_frequency_axis(-60, 20)
-
- # Connect to the QT sinks
- # FIXME: make better exposure to receiver from rxpath
- self.receiver = self.rxpath.packet_receiver._demodulator.receiver
- self.receiver.set_alpha(2)
- self.receiver.set_beta(0.02)
- self.connect(self.channel, self.snk_tx)
- self.connect(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()
-
- else:
- # Connect components
- self.connect(self.txpath, self.throttle, self.rxpath)
-
-
-
- # System Parameters
- def sample_rate(self):
- return self._sample_rate
-
- def set_sample_rate(self, sr):
- self._sample_rate = sr
- #self.throttle.set_samples_per_second(self._sample_rate)
-
- # Channel Model Parameters
- def snr(self):
- return self._snr_dB
-
- def set_snr(self, snr):
- self._snr_dB = snr
- self._noise_voltage = self.get_noise_voltage(self._snr_dB)
- self.channel.set_noise_voltage(self._noise_voltage)
-
- def get_noise_voltage(self, SNR):
- snr = 10.0**(SNR/10.0)
- power_in_signal = abs(self._tx_amplitude)**2
- noise_power = power_in_signal/snr
- noise_voltage = math.sqrt(noise_power)
- return noise_voltage
-
- def frequency_offset(self):
- return self._frequency_offset * self.sample_rate()
-
- def set_frequency_offset(self, fo):
- self._frequency_offset = fo / self.sample_rate()
- self.channel.set_frequency_offset(self._frequency_offset)
-
- def timing_offset(self):
- return self._timing_offset
-
- def set_timing_offset(self, to):
- self._timing_offset = to
- self.channel.set_timing_offset(self._timing_offset)
-
-
- # Receiver Parameters
- def rx_timing_gain_alpha(self):
- return self._timing_gain_alpha
-
- def rx_timing_gain_beta(self):
- return self._timing_gain_beta
-
- def set_rx_timing_gain_alpha(self, gain):
- self._timing_gain_alpha = gain
- self.receiver.set_gain_mu(self._timing_gain_alpha)
-
- def rx_alpha(self):
- return self._alpha
-
- def rx_beta(self):
- return self.beta
-
- def set_rx_alpha(self, alpha):
- self._alpha = alpha
- self.beta = .25 * self._alpha * self._alpha
- self.receiver.set_alpha(self._alpha)
- self.receiver.set_beta(self.beta)
-
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# Thread to handle the packet sending procedure
-# Operates in parallel with qApp.exec_()
-# /////////////////////////////////////////////////////////////////////////////
-
-
-
-class th_send(Thread):
- def __init__(self, send_fnc, megs, sz):
- Thread.__init__(self)
- self.send = send_fnc
- self.nbytes = int(1e6 * megs)
- self.pkt_size = int(sz)
-
- def run(self):
- # generate and send packets
- n = 0
- pktno = 0
-
- while n < self.nbytes:
- self.send(struct.pack('!H', pktno & 0xffff) +
- (self.pkt_size - 2) * chr(pktno & 0xff))
- n += self.pkt_size
- pktno += 1
-
- self.send(eof=True)
-
- def stop(self):
- self.nbytes = 0
-
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-
-
-def main():
-
- global n_rcvd, n_right, pktno
-
- n_rcvd = 0
- n_right = 0
- pktno = 0
-
- def rx_callback(ok, payload):
- global n_rcvd, n_right, pktno
- (pktno,) = struct.unpack('!H', payload[0:2])
- n_rcvd += 1
- if ok:
- n_right += 1
-
- if not options.gui:
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
-
-
- def send_pkt(payload='', eof=False):
- return tb.txpath.send_pkt(payload, eof)
-
- mods = modulation_utils.type_1_mods()
- demods = modulation_utils.type_1_demods()
-
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
- channel_grp = parser.add_option_group("Channel")
-
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
- default='dbpsk',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
-
- parser.add_option("-s", "--size", type="eng_float", default=1500,
- 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 discontinous transmission (bursts of 5 packets)")
- parser.add_option("-G", "--gui", action="store_true", default=False,
- help="Turn on the GUI [default=%default]")
-
- channel_grp.add_option("", "--sample-rate", type="eng_float", default=1e5,
- help="set speed of channel/simulation rate to RATE [default=%default]")
- channel_grp.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB [default=%default]")
- channel_grp.add_option("", "--frequency-offset", type="eng_float", default=0,
- help="set frequency offset introduced by channel [default=%default]")
- channel_grp.add_option("", "--timing-offset", type="eng_float", default=1.0,
- help="set timing offset introduced by channel [default=%default]")
- channel_grp.add_option("", "--seed", action="store_true", default=False,
- help="use a random seed for AWGN noise [default=%default]")
-
- transmit_path.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
-
- for mod in mods.values():
- mod.add_options(expert_grp)
- for demod in demods.values():
- demod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- r = gr.enable_realtime_scheduling()
- if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
-
- # Create an instance of a hierarchical block
- tb = my_top_block(mods[options.modulation],
- demods[options.modulation],
- rx_callback, options)
- tb.start()
-
- packet_sender = th_send(send_pkt, options.megabytes, options.size)
- packet_sender.start()
-
- if(options.gui):
- tb.qapp.exec_()
- packet_sender.stop()
- else:
- # Process until done; hack in to the join to stop on an interrupt
- while(packet_sender.isAlive()):
- try:
- packet_sender.join(1)
- except KeyboardInterrupt:
- packet_sender.stop()
-
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital/benchmark_qt_loopback2.py b/gnuradio-examples/python/digital/benchmark_qt_loopback2.py
deleted file mode 100755
index 02ae4b25f..000000000
--- a/gnuradio-examples/python/digital/benchmark_qt_loopback2.py
+++ /dev/null
@@ -1,536 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 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, gru, modulation_utils2
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import random, time, struct, sys, os, math
-
-from threading import Thread
-
-# from current dir
-from transmit_path import transmit_path
-from receive_path import receive_path
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Please install gr-qtgui."
- sys.exit(1)
-
-try:
- from qt_digital_window2 import Ui_DigitalWindow
-except ImportError:
- print "Error: could not find qt_digital_window2.py:"
- print "\t\"pyuic4 qt_digital_window2.ui -o qt_digital_window2.py\""
- sys.exit(1)
-
-
-#print os.getpid()
-#raw_input()
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-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_clock(self.fg.rx_gain_clock())
- self.set_gain_phase(self.fg.rx_gain_phase())
- self.set_gain_freq(self.fg.rx_gain_freq())
-
- # 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.gainClockEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainClockEditText)
- self.connect(self.gui.gainPhaseEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainPhaseEditText)
- self.connect(self.gui.gainFreqEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainFreqEditText)
-
- # Build a timer to update the packet number and PER fields
- self.update_delay = 250 # time between updating packet rate fields
- self.pkt_timer = QtCore.QTimer(self)
- self.connect(self.pkt_timer, QtCore.SIGNAL("timeout()"),
- self.updatePacketInfo)
- self.pkt_timer.start(self.update_delay)
-
- 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_clock(self, gain):
- self.gui.gainClockEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_gain_phase(self, gain_phase):
- self.gui.gainPhaseEdit.setText(QtCore.QString("%1").arg(gain_phase))
-
- def set_gain_freq(self, gain_freq):
- self.gui.gainFreqEdit.setText(QtCore.QString("%1").arg(gain_freq))
-
-
- def set_alpha_time(self, alpha):
- self.gui.alphaTimeEdit.setText(QtCore.QString("%1").arg(alpha))
-
- def set_beta_time(self, beta):
- self.gui.betaTimeEdit.setText(QtCore.QString("%1").arg(beta))
-
- def set_alpha_phase(self, alpha):
- self.gui.alphaPhaseEdit.setText(QtCore.QString("%1").arg(alpha))
-
- def gainPhaseEditText(self):
- try:
- gain_phase = self.gui.gainPhaseEdit.text().toDouble()[0]
- self.fg.set_rx_gain_phase(gain_phase)
- except RuntimeError:
- pass
-
- def gainClockEditText(self):
- try:
- gain = self.gui.gainClockEdit.text().toDouble()[0]
- self.fg.set_rx_gain_clock(gain)
- except RuntimeError:
- pass
-
- def gainFreqEditText(self):
- try:
- gain = self.gui.gainFreqEdit.text().toDouble()[0]
- self.fg.set_rx_gain_freq(gain)
- except RuntimeError:
- pass
-
- # Accessor functions for packet error reporting
- def updatePacketInfo(self):
- # Pull these globals in from the main thread
- global n_rcvd, n_right, pktno
-
- if(pktno > 0):
- per = float(n_rcvd - n_right)/float(pktno)
- else:
- per = 0
- self.gui.pktsRcvdEdit.setText(QtCore.QString("%1").arg(n_rcvd))
- self.gui.pktsCorrectEdit.setText(QtCore.QString("%1").arg(n_right))
- self.gui.perEdit.setText(QtCore.QString("%1").arg(float(per), 0, 'e', 4))
-
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the GNU Radio Top Block
-# ////////////////////////////////////////////////////////////////////
-
-
-
-class my_top_block(gr.top_block):
- def __init__(self, mod_class, demod_class, rx_callback, options):
- gr.top_block.__init__(self)
-
- self._sample_rate = options.sample_rate
-
- channelon = True;
-
- self.gui_on = options.gui
-
- self._frequency_offset = options.frequency_offset
- self._timing_offset = options.timing_offset
- self._tx_amplitude = options.tx_amplitude
- self._snr_dB = options.snr
-
- self._noise_voltage = self.get_noise_voltage(self._snr_dB)
-
- # With new interface, sps does not get set by default, but
- # in the loopback, we don't recalculate it; so just force it here
- if(options.samples_per_symbol == None):
- options.samples_per_symbol = 2
-
- self.txpath = transmit_path(mod_class, options)
- self.throttle = gr.throttle(gr.sizeof_gr_complex, self.sample_rate())
- self.rxpath = receive_path(demod_class, rx_callback, options)
-
- # FIXME: do better exposure to lower issues for control
- self._gain_clock = self.rxpath.packet_receiver._demodulator._timing_alpha
- self._gain_phase = self.rxpath.packet_receiver._demodulator._phase_alpha
- self._gain_freq = self.rxpath.packet_receiver._demodulator._freq_alpha
-
- if channelon:
- self.channel = gr.channel_model(self._noise_voltage,
- self.frequency_offset(),
- self.timing_offset())
-
- if options.discontinuous:
- z = 20000*[0,]
- self.zeros = gr.vector_source_c(z, True)
- packet_size = 5*((4+8+4+1500+4) * 8)
- self.mux = gr.stream_mux(gr.sizeof_gr_complex, [packet_size-0, int(9e5)])
-
- # Connect components
- self.connect(self.txpath, self.throttle, (self.mux,0))
- self.connect(self.zeros, (self.mux,1))
- self.connect(self.mux, self.channel, self.rxpath)
-
- else:
- self.connect(self.txpath, self.throttle, self.channel, self.rxpath)
-
- if self.gui_on:
- self.qapp = QtGui.QApplication(sys.argv)
- fftsize = 2048
-
- self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, 1,
- "Tx", True, True, False, True, True)
- self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, 1,
- "Rx", True, True, False, True, True)
-
- self.snk_tx.set_frequency_axis(-80, 0)
- self.snk_rx.set_frequency_axis(-60, 20)
-
- self.freq_recov = self.rxpath.packet_receiver._demodulator.freq_recov
- self.phase_recov = self.rxpath.packet_receiver._demodulator.phase_recov
- self.time_recov = self.rxpath.packet_receiver._demodulator.time_recov
- self.freq_recov.set_alpha(self._gain_freq)
- self.freq_recov.set_beta(self._gain_freq/10.0)
- self.phase_recov.set_alpha(self._gain_phase)
- self.phase_recov.set_beta(0.25*self._gain_phase*self._gain_phase)
- self.time_recov.set_alpha(self._gain_clock)
- self.time_recov.set_beta(0.25*self._gain_clock*self._gain_clock)
-
- # Connect to the QT sinks
- # FIXME: make better exposure to receiver from rxpath
- self.connect(self.channel, self.snk_tx)
- self.connect(self.phase_recov, self.snk_rx)
- #self.connect(self.freq_recov, 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()
-
- else:
- # Connect components
- self.connect(self.txpath, self.throttle, self.rxpath)
-
-
-
- # System Parameters
- def sample_rate(self):
- return self._sample_rate
-
- def set_sample_rate(self, sr):
- self._sample_rate = sr
- #self.throttle.set_samples_per_second(self._sample_rate)
-
- # Channel Model Parameters
- def snr(self):
- return self._snr_dB
-
- def set_snr(self, snr):
- self._snr_dB = snr
- self._noise_voltage = self.get_noise_voltage(self._snr_dB)
- self.channel.set_noise_voltage(self._noise_voltage)
-
- def get_noise_voltage(self, SNR):
- snr = 10.0**(SNR/10.0)
- power_in_signal = abs(self._tx_amplitude)**2
- noise_power = power_in_signal/snr
- noise_voltage = math.sqrt(noise_power)
- return noise_voltage
-
- def frequency_offset(self):
- return self._frequency_offset * self.sample_rate()
-
- def set_frequency_offset(self, fo):
- self._frequency_offset = fo / self.sample_rate()
- self.channel.set_frequency_offset(self._frequency_offset)
-
- def timing_offset(self):
- return self._timing_offset
-
- def set_timing_offset(self, to):
- self._timing_offset = to
- self.channel.set_timing_offset(self._timing_offset)
-
-
- # Receiver Parameters
- def rx_gain_clock(self):
- return self._gain_clock
-
- def rx_gain_clock_beta(self):
- return self._gain_clock_beta
-
- def set_rx_gain_clock(self, gain):
- self._gain_clock = gain
- self._gain_clock_beta = .25 * self._gain_clock * self._gain_clock
- self.rxpath.packet_receiver._demodulator.time_recov.set_alpha(self._gain_clock)
- self.rxpath.packet_receiver._demodulator.time_recov.set_beta(self._gain_clock_beta)
-
- def rx_gain_phase(self):
- return self._gain_phase
-
- def rx_gain_phase_beta(self):
- return self._gain_phase_beta
-
- def set_rx_gain_phase(self, gain_phase):
- self._gain_phase = gain_phase
- self._gain_phase_beta = .25 * self._gain_phase * self._gain_phase
- self.rxpath.packet_receiver._demodulator.phase_recov.set_alpha(self._gain_phase)
- self.rxpath.packet_receiver._demodulator.phase_recov.set_beta(self._gain_phase_beta)
-
-
- def rx_gain_freq(self):
- return self._gain_freq
-
- def set_rx_gain_freq(self, gain_freq):
- self._gain_freq = gain_freq
- #self._gain_freq_beta = .25 * self._gain_freq * self._gain_freq
- self.rxpath.packet_receiver._demodulator.freq_recov.set_alpha(self._gain_freq)
- self.rxpath.packet_receiver._demodulator.freq_recov.set_beta(self._gain_freq/10.0)
- #self.rxpath.packet_receiver._demodulator.freq_recov.set_beta(self._gain_fre_beta)
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# Thread to handle the packet sending procedure
-# Operates in parallel with qApp.exec_()
-# /////////////////////////////////////////////////////////////////////////////
-
-
-
-class th_send(Thread):
- def __init__(self, send_fnc, megs, sz):
- Thread.__init__(self)
- self.send = send_fnc
- self.nbytes = int(1e6 * megs)
- self.pkt_size = int(sz)
-
- def run(self):
- # generate and send packets
- n = 0
- pktno = 0
-
- while n < self.nbytes:
- self.send(struct.pack('!H', pktno & 0xffff) +
- (self.pkt_size - 2) * chr(pktno & 0xff))
- n += self.pkt_size
- pktno += 1
-
- self.send(eof=True)
-
- def stop(self):
- self.nbytes = 0
-
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-
-
-def main():
-
- global n_rcvd, n_right, pktno
-
- n_rcvd = 0
- n_right = 0
- pktno = 0
-
- def rx_callback(ok, payload):
- global n_rcvd, n_right, pktno
- (pktno,) = struct.unpack('!H', payload[0:2])
- n_rcvd += 1
- if ok:
- n_right += 1
-
- if not options.gui:
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
-
-
- def send_pkt(payload='', eof=False):
- return tb.txpath.send_pkt(payload, eof)
-
- mods = modulation_utils2.type_1_mods()
- demods = modulation_utils2.type_1_demods()
-
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
- channel_grp = parser.add_option_group("Channel")
-
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
- default='dbpsk2',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
-
- parser.add_option("-s", "--size", type="eng_float", default=1500,
- 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 discontinous transmission (bursts of 5 packets)")
- parser.add_option("-G", "--gui", action="store_true", default=False,
- help="Turn on the GUI [default=%default]")
-
- channel_grp.add_option("", "--sample-rate", type="eng_float", default=1e5,
- help="set speed of channel/simulation rate to RATE [default=%default]")
- channel_grp.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB [default=%default]")
- channel_grp.add_option("", "--frequency-offset", type="eng_float", default=0,
- help="set frequency offset introduced by channel [default=%default]")
- channel_grp.add_option("", "--timing-offset", type="eng_float", default=1.0,
- help="set timing offset introduced by channel [default=%default]")
- channel_grp.add_option("", "--seed", action="store_true", default=False,
- help="use a random seed for AWGN noise [default=%default]")
-
- transmit_path.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
-
- for mod in mods.values():
- mod.add_options(expert_grp)
- for demod in demods.values():
- demod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- r = gr.enable_realtime_scheduling()
- if r != gr.RT_OK:
- print "Warning: failed to enable realtime scheduling"
-
- # Create an instance of a hierarchical block
- tb = my_top_block(mods[options.modulation],
- demods[options.modulation],
- rx_callback, options)
- tb.start()
-
- packet_sender = th_send(send_pkt, options.megabytes, options.size)
- packet_sender.start()
-
- if(options.gui):
- tb.qapp.exec_()
- packet_sender.stop()
- else:
- # Process until done; hack in to the join to stop on an interrupt
- while(packet_sender.isAlive()):
- try:
- packet_sender.join(1)
- except KeyboardInterrupt:
- packet_sender.stop()
-
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital/benchmark_qt_rx.py b/gnuradio-examples/python/digital/benchmark_qt_rx.py
deleted file mode 100755
index 0cbb68d23..000000000
--- a/gnuradio-examples/python/digital/benchmark_qt_rx.py
+++ /dev/null
@@ -1,443 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,2007,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, gru, modulation_utils
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-from gnuradio import usrp_options
-
-import random
-import struct
-import sys
-
-# from current dir
-from receive_path import receive_path
-from pick_bitrate import pick_rx_bitrate
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Please install gr-qtgui."
- sys.exit(1)
-
-try:
- from qt_rx_window import Ui_DigitalWindow
-except ImportError:
- print "Error: could not find qt_rx_window.py:"
- print "\tYou must first build this from qt_rx_window.ui with the following command:"
- print "\t\"pyuic4 qt_rx_window.ui -o qt_rx_window.py\""
- sys.exit(1)
-
-#import os
-#print os.getpid()
-#raw_input('Attach and press enter: ')
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-class dialog_box(QtGui.QMainWindow):
- def __init__(self, snkRxIn, snkRx, fg, parent=None):
-
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_DigitalWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- self.set_frequency(self.fg.frequency())
- self.set_gain(self.fg.gain())
- self.set_decim(self.fg.decim())
- self.set_gain_mu(self.fg.rx_gain_mu())
- self.set_alpha(self.fg.rx_alpha())
-
- # Add the qtsnk widgets to the hlayout box
- self.gui.sinkLayout.addWidget(snkRxIn)
- self.gui.sinkLayout.addWidget(snkRx)
-
-
- # Connect up some signals
- self.connect(self.gui.freqEdit, QtCore.SIGNAL("editingFinished()"),
- self.freqEditText)
- self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainEditText)
- self.connect(self.gui.decimEdit, QtCore.SIGNAL("editingFinished()"),
- self.decimEditText)
- self.connect(self.gui.gainMuEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainMuEditText)
- self.connect(self.gui.alphaEdit, QtCore.SIGNAL("editingFinished()"),
- self.alphaEditText)
-
- # Build a timer to update the packet number and PER fields
- self.update_delay = 250 # time between updating packet rate fields
- self.pkt_timer = QtCore.QTimer(self)
- self.connect(self.pkt_timer, QtCore.SIGNAL("timeout()"),
- self.updatePacketInfo)
- self.pkt_timer.start(self.update_delay)
-
-
- # Accessor functions for Gui to manipulate receiver parameters
- def set_frequency(self, fo):
- self.gui.freqEdit.setText(QtCore.QString("%1").arg(fo))
-
- def set_gain(self, gain):
- self.gui.gainEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_decim(self, decim):
- self.gui.decimEdit.setText(QtCore.QString("%1").arg(decim))
-
- def set_gain_mu(self, gain):
- self.gui.gainMuEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_alpha(self, alpha):
- self.gui.alphaEdit.setText(QtCore.QString("%1").arg(alpha))
-
- def freqEditText(self):
- try:
- freq = self.gui.freqEdit.text().toDouble()[0]
- self.fg.set_freq(freq)
- except RuntimeError:
- pass
-
- def gainEditText(self):
- try:
- gain = self.gui.gainEdit.text().toDouble()[0]
- self.fg.set_gain(gain)
- except RuntimeError:
- pass
-
- def decimEditText(self):
- try:
- decim = self.gui.decimEdit.text().toInt()[0]
- self.fg.set_decim(decim)
- except RuntimeError:
- pass
-
- def alphaEditText(self):
- try:
- alpha = self.gui.alphaEdit.text().toDouble()[0]
- self.fg.set_rx_alpha(alpha)
- except RuntimeError:
- pass
-
- def gainMuEditText(self):
- try:
- gain = self.gui.gainMuEdit.text().toDouble()[0]
- self.fg.set_rx_gain_mu(gain)
- except RuntimeError:
- pass
-
-
- # Accessor function for packet error reporting
- def updatePacketInfo(self):
- # Pull these globals in from the main thread
- global n_rcvd, n_right, pktno
-
- per = float(n_rcvd - n_right)/float(pktno)
- self.gui.pktsRcvdEdit.setText(QtCore.QString("%1").arg(n_rcvd))
- self.gui.pktsCorrectEdit.setText(QtCore.QString("%1").arg(n_right))
- self.gui.perEdit.setText(QtCore.QString("%1").arg(per))
-
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the GNU Radio Top Block
-# ////////////////////////////////////////////////////////////////////
-
-
-class my_top_block(gr.top_block):
- def __init__(self, demodulator, rx_callback, options):
- gr.top_block.__init__(self)
-
- self._rx_freq = options.rx_freq # receiver's center frequency
- self._rx_gain = options.rx_gain # receiver's gain
- self._rx_subdev_spec = options.rx_subdev_spec # daughterboard to use
- self._decim = options.decim # Decimating rate for the USRP (prelim)
- self._bitrate = options.bitrate
- self._samples_per_symbol = options.samples_per_symbol
- self._demod_class = demodulator
- self.gui_on = options.gui
-
- if self._rx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
- raise SystemExit
-
- # Set up USRP source
- self._setup_usrp_source(options)
-
- # copy the final answers back into options for use by demodulator
- options.samples_per_symbol = self._samples_per_symbol
- options.bitrate = self._bitrate
- options.decim = self._decim
-
- ok = self.set_freq(self._rx_freq)
- if not ok:
- print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(self._rx_freq))
- raise ValueError, eng_notation.num_to_str(self._rx_freq)
-
- self.set_gain(options.rx_gain)
-
- # Set up receive path
- self.rxpath = receive_path(demodulator, rx_callback, options)
-
- # FIXME: do better exposure to lower issues for control
- self._gain_mu = self.rxpath.packet_receiver._demodulator._mm_gain_mu
- self._alpha = self.rxpath.packet_receiver._demodulator._costas_alpha
-
- self.connect(self.u, self.rxpath)
-
- if self.gui_on:
- self.qapp = QtGui.QApplication(sys.argv)
- fftsize = 2048
-
- bw_in = self.u.adc_rate() / self.decim()
- self.snk_rxin = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- self._rx_freq, bw_in,
- "Received", True, True, False, True, True, False)
- self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._bitrate,
- "Post-Synchronizer", True, True, False, True, True, False)
-
- self.snk_rxin.set_frequency_axis(-60, 60)
- self.snk_rx.set_frequency_axis(-60, 20)
- self.snk_rxin.set_time_domain_axis(-2000,2000)
-
- # Connect to the QT sinks
- # FIXME: make better exposure to receiver from rxpath
- self.receiver = self.rxpath.packet_receiver._demodulator.receiver
- self.connect(self.u, self.snk_rxin)
- self.connect(self.receiver, self.snk_rx)
-
- pyRxInQt = self.snk_rxin.pyqwidget()
- pyRxIn = sip.wrapinstance(pyRxInQt, QtGui.QWidget)
-
- pyRxQt = self.snk_rx.pyqwidget()
- pyRx = sip.wrapinstance(pyRxQt, QtGui.QWidget)
-
- self.main_box = dialog_box(pyRxIn, pyRx, self)
- self.main_box.show()
-
- def _setup_usrp_source(self, options):
- self.u = usrp_options.create_usrp_source(options)
- adc_rate = self.u.adc_rate()
-
- self.u.set_decim(self._decim)
-
- (self._bitrate, self._samples_per_symbol, self._decim) = \
- pick_rx_bitrate(self._bitrate, self._demod_class.bits_per_symbol(), \
- self._samples_per_symbol, self._decim, adc_rate, \
- self.u.get_decim_rates())
-
- self.u.set_decim(self._decim)
- self.set_auto_tr(True) # enable Auto Transmit/Receive switching
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital up converter.
- """
- return self.u.set_center_freq(target_freq)
-
- def set_gain(self, gain):
- """
- Sets the analog gain in the USRP
- """
- if gain is None:
- r = self.u.gain_range()
- gain = (r[0] + r[1])/2 # set gain to midpoint
- self._rx_gain = gain
- return self.u.set_gain(self._rx_gain)
-
- def set_auto_tr(self, enable):
- return self.u.set_auto_tr(enable)
-
- def set_decim(self, decim):
- self._decim = decim
- self.u.set_decim(self._decim)
-
- if(self.gui_on):
- bw_in = self.u.adc_rate() / self._decim
- self._bitrate = bw_in / self._samples_per_symbol
- self.snk_rxin.set_frequency_range(0, -bw_in/2.0, bw_in/2.0)
- self.snk_rx.set_frequency_range(0, -self._bitrate/2.0, self._bitrate/2.0)
-
- def frequency(self):
- return self._rx_freq
-
- def gain(self):
- return self._rx_gain
-
- def decim(self):
- return self._decim
-
- 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 rx_alpha(self):
- return self._alpha
-
- def rx_beta(self):
- return self.beta
-
- def set_rx_alpha(self, alpha):
- self._alpha = alpha
- self.beta = .25 * self._alpha * self._alpha
- self.receiver.set_alpha(self._alpha)
- self.receiver.set_beta(self.beta)
-
- def add_options(normal, expert):
- """
- Adds usrp-specific options to the Options Parser
- """
- add_freq_option(normal)
- normal.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B")
- normal.add_option("", "--rx-gain", type="eng_float", default=None, metavar="GAIN",
- help="set receiver gain in dB [default=midpoint]. See also --show-rx-gain-range")
- normal.add_option("", "--show-rx-gain-range", action="store_true", default=False,
- help="print min and max Rx gain available on selected daughterboard")
- normal.add_option("-v", "--verbose", action="store_true", default=False)
- normal.add_option("-G", "--gui", action="store_true", default=False,
- help="Turn on the GUI [default=%default]")
-
- expert.add_option("", "--rx-freq", type="eng_float", default=None,
- help="set Rx frequency to FREQ [default=%default]", metavar="FREQ")
- expert.add_option("-d", "--decim", type="intx", default=128,
- help="set fpga decimation rate to DECIM [default=%default]")
- expert.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB [default=%default]")
-
-
- # Make a static method to call before instantiation
- add_options = staticmethod(add_options)
-
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-global n_rcvd, n_right
-
-def main():
- global n_rcvd, n_right, pktno
-
- n_rcvd = 0
- n_right = 0
- pktno = 1
-
- def rx_callback(ok, payload):
- global n_rcvd, n_right, pktno
- (pktno,) = struct.unpack('!H', payload[0:2])
- n_rcvd += 1
- if ok:
- n_right += 1
-
- if not options.gui:
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
-
-
- demods = modulation_utils.type_1_demods()
-
- # Create Options Parser:
- parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
-
- parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
- default='dbpsk',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(demods.keys()),))
-
- my_top_block.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
- usrp_options.add_rx_options(parser)
-
- for mod in demods.values():
- mod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help(sys.stderr)
- sys.exit(1)
-
- 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(demods[options.modulation], 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
-
- if(options.gui):
- tb.qapp.exec_()
- else:
- tb.wait() # wait for it to finish
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital/benchmark_qt_rx2.py b/gnuradio-examples/python/digital/benchmark_qt_rx2.py
deleted file mode 100755
index 0c37f4c6a..000000000
--- a/gnuradio-examples/python/digital/benchmark_qt_rx2.py
+++ /dev/null
@@ -1,475 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 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, gru, modulation_utils2
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-from gnuradio import usrp_options
-
-import random
-import struct
-import sys
-
-# from current dir
-from receive_path import receive_path
-from pick_bitrate2 import pick_rx_bitrate
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Please install gr-qtgui."
- sys.exit(1)
-
-try:
- from qt_rx_window2 import Ui_DigitalWindow
-except ImportError:
- print "Error: could not find qt_rx_window2.py:"
- print "\tYou must first build this from qt_rx_window2.ui with the following command:"
- print "\t\"pyuic4 qt_rx_window2.ui -o qt_rx_window2.py\""
- sys.exit(1)
-
-#import os
-#print os.getpid()
-#raw_input('Attach and press enter: ')
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-class dialog_box(QtGui.QMainWindow):
- def __init__(self, snkRxIn, snkRx, fg, parent=None):
-
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_DigitalWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- self.set_frequency(self.fg.frequency())
- self.set_gain(self.fg.gain())
- self.set_decim(self.fg.decim())
- self.set_gain_clock(self.fg.rx_gain_clock())
- self.set_gain_phase(self.fg.rx_gain_phase())
- self.set_gain_freq(self.fg.rx_gain_freq())
-
- # Add the qtsnk widgets to the hlayout box
- self.gui.sinkLayout.addWidget(snkRxIn)
- self.gui.sinkLayout.addWidget(snkRx)
-
-
- # Connect up some signals
- self.connect(self.gui.freqEdit, QtCore.SIGNAL("editingFinished()"),
- self.freqEditText)
- self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainEditText)
- self.connect(self.gui.decimEdit, QtCore.SIGNAL("editingFinished()"),
- self.decimEditText)
- self.connect(self.gui.gainClockEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainClockEditText)
- self.connect(self.gui.gainPhaseEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainPhaseEditText)
- self.connect(self.gui.gainFreqEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainFreqEditText)
-
- # Build a timer to update the packet number and PER fields
- self.update_delay = 250 # time between updating packet rate fields
- self.pkt_timer = QtCore.QTimer(self)
- self.connect(self.pkt_timer, QtCore.SIGNAL("timeout()"),
- self.updatePacketInfo)
- self.pkt_timer.start(self.update_delay)
-
-
- # Accessor functions for Gui to manipulate receiver parameters
- def set_frequency(self, fo):
- self.gui.freqEdit.setText(QtCore.QString("%1").arg(fo))
-
- def set_gain(self, gain):
- self.gui.gainEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_decim(self, decim):
- self.gui.decimEdit.setText(QtCore.QString("%1").arg(decim))
-
- def set_gain_clock(self, gain):
- self.gui.gainClockEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_gain_phase(self, gain_phase):
- self.gui.gainPhaseEdit.setText(QtCore.QString("%1").arg(gain_phase))
-
- def set_gain_freq(self, gain_freq):
- self.gui.gainFreqEdit.setText(QtCore.QString("%1").arg(gain_freq))
-
- def freqEditText(self):
- try:
- freq = self.gui.freqEdit.text().toDouble()[0]
- self.fg.set_freq(freq)
- except RuntimeError:
- pass
-
- def gainEditText(self):
- try:
- gain = self.gui.gainEdit.text().toDouble()[0]
- self.fg.set_gain(gain)
- except RuntimeError:
- pass
-
- def decimEditText(self):
- try:
- decim = self.gui.decimEdit.text().toInt()[0]
- self.fg.set_decim(decim)
- except RuntimeError:
- pass
-
- def gainPhaseEditText(self):
- try:
- gain_phase = self.gui.gainPhaseEdit.text().toDouble()[0]
- self.fg.set_rx_gain_phase(gain_phase)
- except RuntimeError:
- pass
-
- def gainClockEditText(self):
- try:
- gain = self.gui.gainClockEdit.text().toDouble()[0]
- self.fg.set_rx_gain_clock(gain)
- except RuntimeError:
- pass
-
- def gainFreqEditText(self):
- try:
- gain = self.gui.gainFreqEdit.text().toDouble()[0]
- self.fg.set_rx_gain_freq(gain)
- except RuntimeError:
- pass
-
-
- # Accessor function for packet error reporting
- def updatePacketInfo(self):
- # Pull these globals in from the main thread
- global n_rcvd, n_right, pktno
-
- per = float(n_rcvd - n_right)/float(pktno)
- self.gui.pktsRcvdEdit.setText(QtCore.QString("%1").arg(n_rcvd))
- self.gui.pktsCorrectEdit.setText(QtCore.QString("%1").arg(n_right))
- self.gui.perEdit.setText(QtCore.QString("%1").arg(per, 0, 'e', 4))
-
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the GNU Radio Top Block
-# ////////////////////////////////////////////////////////////////////
-
-
-class my_top_block(gr.top_block):
- def __init__(self, demodulator, rx_callback, options):
- gr.top_block.__init__(self)
-
- self._rx_freq = options.rx_freq # receiver's center frequency
- self._rx_gain = options.rx_gain # receiver's gain
- self._rx_subdev_spec = options.rx_subdev_spec # daughterboard to use
- self._decim = options.decim # Decimating rate for the USRP (prelim)
- self._bitrate = options.bitrate
- self._samples_per_symbol = options.samples_per_symbol
- self._demod_class = demodulator
- self.gui_on = options.gui
-
- if self._rx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
- raise SystemExit
-
- # Set up USRP source
- self._setup_usrp_source(options)
-
- # copy the final answers back into options for use by demodulator
- options.samples_per_symbol = self._samples_per_symbol
- options.bitrate = self._bitrate
- options.decim = self._decim
-
- ok = self.set_freq(self._rx_freq)
- if not ok:
- print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(self._rx_freq))
- raise ValueError, eng_notation.num_to_str(self._rx_freq)
-
- self.set_gain(options.rx_gain)
-
- # Set up receive path
- self.rxpath = receive_path(demodulator, rx_callback, options)
-
- # FIXME: do better exposure to lower issues for control
- self._gain_clock = self.rxpath.packet_receiver._demodulator._timing_alpha
- self._gain_phase = self.rxpath.packet_receiver._demodulator._phase_alpha
- self._gain_freq = self.rxpath.packet_receiver._demodulator._freq_alpha
-
- self.connect(self.u, self.rxpath)
-
- if self.gui_on:
- self.qapp = QtGui.QApplication(sys.argv)
- fftsize = 2048
-
- bw_in = self.u.adc_rate() / self.decim()
- self.snk_rxin = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- self._rx_freq, bw_in,
- "Received", True, True, False, True, True, False)
- self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._bitrate,
- "Post-Synchronizer", True, True, False, True, True, False)
-
- self.snk_rxin.set_frequency_axis(-140, 20)
- self.snk_rx.set_frequency_axis(-80, 20)
- self.snk_rxin.set_time_domain_axis(-2000,2000)
-
- # Connect to the QT sinks
- # FIXME: make better exposure to receiver from rxpath
- self.receiver = self.rxpath.packet_receiver._demodulator.phase_recov
- #self.receiver = self.rxpath.packet_receiver._demodulator.freq_recov
- self.connect(self.u, self.snk_rxin)
- self.connect(self.receiver, self.snk_rx)
-
- pyRxInQt = self.snk_rxin.pyqwidget()
- pyRxIn = sip.wrapinstance(pyRxInQt, QtGui.QWidget)
-
- pyRxQt = self.snk_rx.pyqwidget()
- pyRx = sip.wrapinstance(pyRxQt, QtGui.QWidget)
-
- self.snk_freq = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- 0, self._bitrate,
- "FLL", True, False, False, True, False, False)
-
- self.main_box = dialog_box(pyRxIn, pyRx, self)
- self.main_box.show()
-
- def _setup_usrp_source(self, options):
- self.u = usrp_options.create_usrp_source(options)
- adc_rate = self.u.adc_rate()
-
- self.u.set_decim(self._decim)
-
- (self._bitrate, self._samples_per_symbol, self._decim) = \
- pick_rx_bitrate(options.bitrate, self._demod_class.bits_per_symbol(), \
- options.samples_per_symbol, options.decim, \
- adc_rate, self.u.get_decim_rates())
-
- self.u.set_decim(self._decim)
- self.set_auto_tr(True) # enable Auto Transmit/Receive switching
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital up converter.
- """
- return self.u.set_center_freq(target_freq)
-
- def set_gain(self, gain):
- """
- Sets the analog gain in the USRP
- """
- if gain is None:
- r = self.u.gain_range()
- gain = (r[0] + r[1])/2 # set gain to midpoint
- self._rx_gain = gain
- ret = self.u.set_gain(self._rx_gain)
- return ret
-
- def set_auto_tr(self, enable):
- return self.u.set_auto_tr(enable)
-
- def set_decim(self, decim):
- self._decim = decim
- self.u.set_decim(self._decim)
-
- if(self.gui_on):
- bw_in = self.u.adc_rate() / self._decim
- self._bitrate = bw_in / self._samples_per_symbol
- self.snk_rxin.set_frequency_range(0, bw_in)
- self.snk_rx.set_frequency_range(0, self._bitrate)
-
- def frequency(self):
- return self._rx_freq
-
- def gain(self):
- return self._rx_gain
-
- def decim(self):
- return self._decim
-
- def rx_gain_clock(self):
- return self._gain_clock
-
- def rx_gain_clock_beta(self):
- return self._gain_clock_beta
-
- def set_rx_gain_clock(self, gain):
- self._gain_clock = gain
- self._gain_clock_beta = .25 * self._gain_clock * self._gain_clock
- self.rxpath.packet_receiver._demodulator.time_recov.set_alpha(self._gain_clock)
- self.rxpath.packet_receiver._demodulator.time_recov.set_beta(self._gain_clock_beta)
-
- def rx_gain_phase(self):
- return self._gain_phase
-
- def rx_gain_phase_beta(self):
- return self._gain_phase_beta
-
- def set_rx_gain_phase(self, gain_phase):
- self._gain_phase = gain_phase
- self._gain_phase_beta = .25 * self._gain_phase * self._gain_phase
- self.rxpath.packet_receiver._demodulator.phase_recov.set_alpha(self._gain_phase)
- self.rxpath.packet_receiver._demodulator.phase_recov.set_beta(self._gain_phase_beta)
-
-
- def rx_gain_freq(self):
- return self._gain_freq
-
- def set_rx_gain_freq(self, gain_freq):
- self._gain_freq = gain_freq
- #self._gain_freq_beta = .25 * self._gain_freq * self._gain_freq
- self.rxpath.packet_receiver._demodulator.freq_recov.set_alpha(self._gain_freq)
- self.rxpath.packet_receiver._demodulator.freq_recov.set_beta(self._gain_freq/10.0)
- #self.rxpath.packet_receiver._demodulator.freq_recov.set_beta(self._gain_fre_beta)
-
-
- def add_options(normal, expert):
- """
- Adds usrp-specific options to the Options Parser
- """
- add_freq_option(normal)
- normal.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B")
- normal.add_option("", "--rx-gain", type="eng_float", default=None, metavar="GAIN",
- help="set receiver gain in dB [default=midpoint]. See also --show-rx-gain-range")
- normal.add_option("", "--show-rx-gain-range", action="store_true", default=False,
- help="print min and max Rx gain available on selected daughterboard")
- normal.add_option("-v", "--verbose", action="store_true", default=False)
- normal.add_option("-G", "--gui", action="store_true", default=False,
- help="Turn on the GUI [default=%default]")
-
- expert.add_option("", "--rx-freq", type="eng_float", default=None,
- help="set Rx frequency to FREQ [default=%default]", metavar="FREQ")
- expert.add_option("-d", "--decim", type="intx", default=128,
- help="set fpga decimation rate to DECIM [default=%default]")
- expert.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB [default=%default]")
-
-
- # Make a static method to call before instantiation
- add_options = staticmethod(add_options)
-
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-global n_rcvd, n_right
-
-def main():
- global n_rcvd, n_right, pktno
-
- n_rcvd = 0
- n_right = 0
- pktno = 1
-
- def rx_callback(ok, payload):
- global n_rcvd, n_right, pktno
- (pktno,) = struct.unpack('!H', payload[0:2])
- n_rcvd += 1
- if ok:
- n_right += 1
-
- if not options.gui:
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
-
-
- demods = modulation_utils2.type_1_demods()
-
- # Create Options Parser:
- parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
-
- parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
- default='dbpsk2',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(demods.keys()),))
-
- my_top_block.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
- usrp_options.add_rx_options(parser)
-
- for mod in demods.values():
- mod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help(sys.stderr)
- sys.exit(1)
-
- 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(demods[options.modulation], 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
-
- if(options.gui):
- tb.qapp.exec_()
- else:
- tb.wait() # wait for it to finish
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital/benchmark_rx2.py b/gnuradio-examples/python/digital/benchmark_rx2.py
deleted file mode 100755
index fe422be83..000000000
--- a/gnuradio-examples/python/digital/benchmark_rx2.py
+++ /dev/null
@@ -1,114 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 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, gru, modulation_utils2
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-import random
-import struct
-import sys
-
-# from current dir
-import usrp_receive_path2
-
-#import os
-#print os.getpid()
-#raw_input('Attach and press enter: ')
-
-class my_top_block(gr.top_block):
- def __init__(self, demodulator, rx_callback, options):
- gr.top_block.__init__(self)
-
- # Set up receive path
- self.rxpath = usrp_receive_path2.usrp_receive_path(demodulator, rx_callback, options)
-
- self.connect(self.rxpath)
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-global n_rcvd, n_right
-
-def main():
- global n_rcvd, n_right
-
- n_rcvd = 0
- n_right = 0
-
- def rx_callback(ok, payload):
- global n_rcvd, n_right
- (pktno,) = struct.unpack('!H', payload[0:2])
- n_rcvd += 1
- if ok:
- n_right += 1
-
- print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
- ok, pktno, n_rcvd, n_right)
-
-
- demods = modulation_utils2.type_1_demods()
-
- # Create Options Parser:
- parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
-
- parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
- default='dbpsk2',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(demods.keys()),))
-
- usrp_receive_path2.add_options(parser, expert_grp)
-
- for mod in demods.values():
- mod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help(sys.stderr)
- sys.exit(1)
-
- 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(demods[options.modulation], 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/gnuradio-examples/python/digital/benchmark_tx2.py b/gnuradio-examples/python/digital/benchmark_tx2.py
deleted file mode 100755
index 6093dba61..000000000
--- a/gnuradio-examples/python/digital/benchmark_tx2.py
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 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, gru, modulation_utils2
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-import random, time, struct, sys
-
-# from current dir
-import usrp_transmit_path2
-
-#import os
-#print os.getpid()
-#raw_input('Attach and press enter')
-
-class my_top_block(gr.top_block):
- def __init__(self, modulator, options):
- gr.top_block.__init__(self)
-
- self.txpath = usrp_transmit_path2.usrp_transmit_path(modulator, options)
-
- self.connect(self.txpath)
-
-# /////////////////////////////////////////////////////////////////////////////
-# main
-# /////////////////////////////////////////////////////////////////////////////
-
-def main():
-
- def send_pkt(payload='', eof=False):
- return tb.txpath.send_pkt(payload, eof)
-
- def rx_callback(ok, payload):
- print "ok = %r, payload = '%s'" % (ok, payload)
-
- mods = modulation_utils2.type_1_mods()
-
- parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
- expert_grp = parser.add_option_group("Expert")
-
- parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
- default='dbpsk2',
- help="Select modulation from: %s [default=%%default]"
- % (', '.join(mods.keys()),))
-
- parser.add_option("-s", "--size", type="eng_float", default=1500,
- 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 discontinous transmission (bursts of 5 packets)")
- parser.add_option("","--from-file", default=None,
- help="use file for packet contents")
-
- usrp_transmit_path2.add_options(parser, expert_grp)
-
- for mod in mods.values():
- mod.add_options(expert_grp)
-
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- if 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)
-
- if options.from_file is not None:
- source_file = open(options.from_file, 'r')
-
- # build the graph
- tb = my_top_block(mods[options.modulation], 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)
-
- tb.wait() # wait for it to finish
-
-if __name__ == '__main__':
- try:
- main()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/digital/pick_bitrate.py b/gnuradio-examples/python/digital/pick_bitrate.py
deleted file mode 100644
index ce1e021c5..000000000
--- a/gnuradio-examples/python/digital/pick_bitrate.py
+++ /dev/null
@@ -1,153 +0,0 @@
-#
-# Copyright 2005,2006 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 eng_notation
-
-_default_bitrate = 500e3
-
-_valid_samples_per_symbol = (2,3,4,5,6,7)
-
-def _gen_tx_info(converter_rate, xrates):
- results = []
- for samples_per_symbol in _valid_samples_per_symbol:
- for interp in xrates:
- bitrate = converter_rate / interp / samples_per_symbol
- results.append((bitrate, samples_per_symbol, interp))
- results.sort()
- return results
-
-def _gen_rx_info(converter_rate, xrates):
- results = []
- for samples_per_symbol in _valid_samples_per_symbol:
- for decim in xrates:
- bitrate = converter_rate / decim / samples_per_symbol
- results.append((bitrate, samples_per_symbol, decim))
- results.sort()
- return results
-
-def _filter_info(info, samples_per_symbol, xrate):
- if samples_per_symbol is not None:
- info = [x for x in info if x[1] == samples_per_symbol]
- if xrate is not None:
- info = [x for x in info if x[2] == xrate]
- return info
-
-def _pick_best(target_bitrate, bits_per_symbol, info):
- """
- @returns tuple (bitrate, samples_per_symbol, interp_rate_or_decim_rate)
- """
- if len(info) == 0:
- raise RuntimeError, "info is zero length!"
-
- if target_bitrate is None: # return the fastest one
- return info[-1]
-
- # convert bit rate to symbol rate
- target_symbolrate = target_bitrate / bits_per_symbol
-
- # Find the closest matching symbol rate.
- # In the event of a tie, the one with the lowest samples_per_symbol wins.
- # (We already sorted them, so the first one is the one we take)
-
- best = info[0]
- best_delta = abs(target_symbolrate - best[0])
- for x in info[1:]:
- delta = abs(target_symbolrate - x[0])
- if delta < best_delta:
- best_delta = delta
- best = x
-
- # convert symbol rate back to bit rate
- return ((best[0] * bits_per_symbol),) + best[1:]
-
-def _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- xrate, converter_rate, xrates, gen_info):
- """
- @returns tuple (bitrate, samples_per_symbol, interp_rate_or_decim_rate)
- """
- if not isinstance(bits_per_symbol, int) or bits_per_symbol < 1:
- raise ValueError, "bits_per_symbol must be an int >= 1"
-
- if samples_per_symbol is not None and xrate is not None: # completely determined
- return (float(converter_rate) / xrate / samples_per_symbol,
- samples_per_symbol, xrate)
-
- if bitrate is None and samples_per_symbol is None and xrate is None:
- bitrate = _default_bitrate
-
- # now we have a target bitrate and possibly an xrate or
- # samples_per_symbol constraint, but not both of them.
-
- ret = _pick_best(bitrate, bits_per_symbol,
- _filter_info(gen_info(converter_rate, xrates), samples_per_symbol, xrate))
- print "Actual Bitrate:", eng_notation.num_to_str(ret[0])
- return ret
-
-# ---------------------------------------------------------------------------------------
-
-def pick_tx_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- interp_rate, converter_rate, possible_interps):
- """
- Given the 4 input parameters, return at configuration that matches
-
- @param bitrate: desired bitrate or None
- @type bitrate: number or None
- @param bits_per_symbol: E.g., BPSK -> 1, QPSK -> 2, 8-PSK -> 3
- @type bits_per_symbol: integer >= 1
- @param samples_per_symbol: samples/baud (aka samples/symbol)
- @type samples_per_symbol: number or None
- @param interp_rate: USRP interpolation factor
- @type interp_rate: integer or None
- @param converter_rate: converter sample rate in Hz
- @type converter_rate: number
- @param possible_interps: a list of possible rates
- @type possible_interps: a list of integers
-
- @returns tuple (bitrate, samples_per_symbol, interp_rate)
- """
- print "Requested TX Bitrate:", bitrate and eng_notation.num_to_str(bitrate) or 'Auto',
- return _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- interp_rate, converter_rate, possible_interps, _gen_tx_info)
-
-
-def pick_rx_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- decim_rate, converter_rate, possible_decims):
- """
- Given the 4 input parameters, return at configuration that matches
-
- @param bitrate: desired bitrate or None
- @type bitrate: number or None
- @param bits_per_symbol: E.g., BPSK -> 1, QPSK -> 2, 8-PSK -> 3
- @type bits_per_symbol: integer >= 1
- @param samples_per_symbol: samples/baud (aka samples/symbol)
- @type samples_per_symbol: number or None
- @param decim_rate: USRP decimation factor
- @type decim_rate: integer or None
- @param converter_rate: converter sample rate in Hz
- @type converter_rate: number
- @param possible_decims: a list of possible rates
- @type possible_decims: a list of integers
-
- @returns tuple (bitrate, samples_per_symbol, decim_rate)
- """
- print "Requested RX Bitrate:", bitrate and eng_notation.num_to_str(bitrate) or 'Auto'
- return _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- decim_rate, converter_rate, possible_decims, _gen_rx_info)
diff --git a/gnuradio-examples/python/digital/pick_bitrate2.py b/gnuradio-examples/python/digital/pick_bitrate2.py
deleted file mode 100644
index 92539560c..000000000
--- a/gnuradio-examples/python/digital/pick_bitrate2.py
+++ /dev/null
@@ -1,154 +0,0 @@
-#
-# Copyright 2010 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 eng_notation
-
-_default_bitrate = 500e3
-_sps_min = 2
-_sps_max = 100
-
-def _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- xrate, converter_rate, xrates):
- """
- @returns tuple (bitrate, samples_per_symbol, interp_rate_or_decim_rate)
- """
-
- if not isinstance(bits_per_symbol, int) or bits_per_symbol < 1:
- raise ValueError, "bits_per_symbol must be an int >= 1"
-
- converter_rate = float(converter_rate)
- bits_per_symbol = float(bits_per_symbol)
-
- # completely determined; if bitrate is specified, this overwrites it
- if (samples_per_symbol is not None) and (xrate is not None):
- bitrate = converter_rate / bits_per_symbol / xrate / samples_per_symbol
-
- # If only SPS is given
- if (bitrate is None) and (samples_per_symbol is not None) and (xrate is None):
- xrate = max(xrates)
- bitrate = converter_rate / bits_per_symbol / xrate / samples_per_symbol
-
- # If only xrate is given, just set SPS to 2 and calculate bitrate
- if (bitrate is None) and (samples_per_symbol is None) and (xrate is not None):
- samples_per_symbol = 2.0
- bitrate = converter_rate / bits_per_symbol / xrate / samples_per_symbol
-
- # If no parameters are give, use the default bit rate
- if (bitrate is None) and (samples_per_symbol is None) and (xrate is None):
- bitrate = _default_bitrate
-
- # If only bitrate is specified, return max xrate and appropriate
- # samples per symbol (minimum of 2.0) to reach bit rate
- if (samples_per_symbol is None) and (xrate is None):
- xrates.sort()
- for i in xrange(len(xrates)):
- if((converter_rate / bits_per_symbol / xrates[i]) >= 2*bitrate):
- rate = xrates[i]
- else:
- break
-
- try:
- xrate = rate
- except UnboundLocalError:
- raise ValueError("Requested bitrate out of bounds")
-
- samples_per_symbol = converter_rate / bits_per_symbol / rate / bitrate
- bitrate = converter_rate / bits_per_symbol / xrate / samples_per_symbol
-
- # If bitrate and xrate are specified
- if(samples_per_symbol is None):
- samples_per_symbol = converter_rate / xrate / bits_per_symbol / bitrate
-
- # If bitrate and SPS are specified
- if(xrate is None):
- xrate = converter_rate / samples_per_symbol / bits_per_symbol / bitrate
- if((xrate in xrates) == False):
- # Find the closest avaiable rate larger than the calculated one
- xrates.sort()
- for x in xrates:
- if(x > xrate):
- xrate = x
- break
- if(xrate > max(xrates)):
- xrate = max(xrates)
-
- bitrate = converter_rate / bits_per_symbol / xrate / samples_per_symbol
- print "Could not find suitable rate for specified SPS and Bitrate"
- print "Using rate = %d for bitrate of %sbps" % \
- (xrate, (eng_notation.num_to_str(bitrate)))
-
- if((xrate in xrates) == False):
- raise ValueError(("Invalid rate (rate = %d)" % xrate))
- if((samples_per_symbol < _sps_min) or (samples_per_symbol > _sps_max)):
- raise ValueError(("Invalid samples per symbol (sps = %.2f). Must be in [%.0f, %.0f]." \
- % (samples_per_symbol, _sps_min, _sps_max)))
-
- return (bitrate, samples_per_symbol, int(xrate))
-
-
-def pick_tx_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- interp_rate, converter_rate, possible_interps):
- """
- Given the 4 input parameters, return at configuration that matches
-
- @param bitrate: desired bitrate or None
- @type bitrate: number or None
- @param bits_per_symbol: E.g., BPSK -> 1, QPSK -> 2, 8-PSK -> 3
- @type bits_per_symbol: integer >= 1
- @param samples_per_symbol: samples/baud (aka samples/symbol)
- @type samples_per_symbol: number or None
- @param interp_rate: USRP interpolation factor
- @type interp_rate: integer or None
- @param converter_rate: converter sample rate in Hz
- @type converter_rate: number
- @param possible_interps: a list of possible rates
- @type possible_interps: a list of integers
-
- @returns tuple (bitrate, samples_per_symbol, interp_rate)
- """
-
- return _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- interp_rate, converter_rate, possible_interps)
-
-
-def pick_rx_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- decim_rate, converter_rate, possible_decims):
- """
- Given the 4 input parameters, return at configuration that matches
-
- @param bitrate: desired bitrate or None
- @type bitrate: number or None
- @param bits_per_symbol: E.g., BPSK -> 1, QPSK -> 2, 8-PSK -> 3
- @type bits_per_symbol: integer >= 1
- @param samples_per_symbol: samples/baud (aka samples/symbol)
- @type samples_per_symbol: number or None
- @param decim_rate: USRP decimation factor
- @type decim_rate: integer or None
- @param converter_rate: converter sample rate in Hz
- @type converter_rate: number
- @param possible_decims: a list of possible rates
- @type possible_decims: a list of integers
-
- @returns tuple (bitrate, samples_per_symbol, decim_rate)
- """
-
- return _pick_bitrate(bitrate, bits_per_symbol, samples_per_symbol,
- decim_rate, converter_rate, possible_decims)
diff --git a/gnuradio-examples/python/digital/qt_digital_window.py b/gnuradio-examples/python/digital/qt_digital_window.py
deleted file mode 100644
index b47ed0c2b..000000000
--- a/gnuradio-examples/python/digital/qt_digital_window.py
+++ /dev/null
@@ -1,239 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_digital_window.ui'
-#
-# Created: Tue May 11 20:58:35 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(1059, 754)
- self.centralwidget = QtGui.QWidget(DigitalWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.verticalLayout_4 = QtGui.QVBoxLayout(self.centralwidget)
- self.verticalLayout_4.setObjectName("verticalLayout_4")
- self.sinkLayout = QtGui.QHBoxLayout()
- self.sinkLayout.setObjectName("sinkLayout")
- self.verticalLayout_4.addLayout(self.sinkLayout)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.verticalLayout_2 = QtGui.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- self.sysBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sysBox.sizePolicy().hasHeightForWidth())
- self.sysBox.setSizePolicy(sizePolicy)
- self.sysBox.setMinimumSize(QtCore.QSize(240, 60))
- self.sysBox.setMaximumSize(QtCore.QSize(240, 16777215))
- self.sysBox.setObjectName("sysBox")
- self.formLayoutWidget = QtGui.QWidget(self.sysBox)
- self.formLayoutWidget.setGeometry(QtCore.QRect(10, 20, 211, 31))
- self.formLayoutWidget.setObjectName("formLayoutWidget")
- self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
- self.formLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout.setVerticalSpacing(20)
- self.formLayout.setObjectName("formLayout")
- self.sampleRateEdit = QtGui.QLineEdit(self.formLayoutWidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sampleRateEdit.sizePolicy().hasHeightForWidth())
- self.sampleRateEdit.setSizePolicy(sizePolicy)
- self.sampleRateEdit.setMinimumSize(QtCore.QSize(60, 26))
- self.sampleRateEdit.setMaximumSize(QtCore.QSize(80, 26))
- self.sampleRateEdit.setObjectName("sampleRateEdit")
- self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.sampleRateEdit)
- self.sampleRateLabel = QtGui.QLabel(self.formLayoutWidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sampleRateLabel.sizePolicy().hasHeightForWidth())
- self.sampleRateLabel.setSizePolicy(sizePolicy)
- self.sampleRateLabel.setMinimumSize(QtCore.QSize(0, 20))
- self.sampleRateLabel.setMaximumSize(QtCore.QSize(16777215, 20))
- self.sampleRateLabel.setObjectName("sampleRateLabel")
- self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.sampleRateLabel)
- self.verticalLayout_2.addWidget(self.sysBox)
- spacerItem = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- self.verticalLayout_2.addItem(spacerItem)
- self.horizontalLayout.addLayout(self.verticalLayout_2)
- self.channelModeBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.channelModeBox.sizePolicy().hasHeightForWidth())
- self.channelModeBox.setSizePolicy(sizePolicy)
- self.channelModeBox.setMinimumSize(QtCore.QSize(245, 130))
- self.channelModeBox.setMaximumSize(QtCore.QSize(245, 16777215))
- self.channelModeBox.setObjectName("channelModeBox")
- self.formLayoutWidget_2 = QtGui.QWidget(self.channelModeBox)
- self.formLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 221, 98))
- self.formLayoutWidget_2.setObjectName("formLayoutWidget_2")
- self.formLayout_2 = QtGui.QFormLayout(self.formLayoutWidget_2)
- self.formLayout_2.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout_2.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
- self.formLayout_2.setObjectName("formLayout_2")
- self.snrLabel = QtGui.QLabel(self.formLayoutWidget_2)
- self.snrLabel.setObjectName("snrLabel")
- self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.snrLabel)
- self.snrEdit = QtGui.QLineEdit(self.formLayoutWidget_2)
- self.snrEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.snrEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.snrEdit.setObjectName("snrEdit")
- self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.snrEdit)
- self.freqLabel = QtGui.QLabel(self.formLayoutWidget_2)
- self.freqLabel.setObjectName("freqLabel")
- self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.freqLabel)
- self.freqEdit = QtGui.QLineEdit(self.formLayoutWidget_2)
- self.freqEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.freqEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.freqEdit.setObjectName("freqEdit")
- self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.freqEdit)
- self.timeLabel = QtGui.QLabel(self.formLayoutWidget_2)
- self.timeLabel.setObjectName("timeLabel")
- self.formLayout_2.setWidget(2, QtGui.QFormLayout.LabelRole, self.timeLabel)
- self.timeEdit = QtGui.QLineEdit(self.formLayoutWidget_2)
- self.timeEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.timeEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.timeEdit.setObjectName("timeEdit")
- self.formLayout_2.setWidget(2, QtGui.QFormLayout.FieldRole, self.timeEdit)
- self.horizontalLayout.addWidget(self.channelModeBox)
- self.rxBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxBox.sizePolicy().hasHeightForWidth())
- self.rxBox.setSizePolicy(sizePolicy)
- self.rxBox.setMinimumSize(QtCore.QSize(220, 130))
- self.rxBox.setMaximumSize(QtCore.QSize(180, 16777215))
- self.rxBox.setObjectName("rxBox")
- self.formLayoutWidget_3 = QtGui.QWidget(self.rxBox)
- self.formLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 201, 101))
- self.formLayoutWidget_3.setObjectName("formLayoutWidget_3")
- self.formLayout_3 = QtGui.QFormLayout(self.formLayoutWidget_3)
- self.formLayout_3.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout_3.setObjectName("formLayout_3")
- self.gainMuLabel = QtGui.QLabel(self.formLayoutWidget_3)
- self.gainMuLabel.setObjectName("gainMuLabel")
- self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole, self.gainMuLabel)
- self.alphaLabel = QtGui.QLabel(self.formLayoutWidget_3)
- self.alphaLabel.setObjectName("alphaLabel")
- self.formLayout_3.setWidget(1, QtGui.QFormLayout.LabelRole, self.alphaLabel)
- self.gainMuEdit = QtGui.QLineEdit(self.formLayoutWidget_3)
- self.gainMuEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.gainMuEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.gainMuEdit.setObjectName("gainMuEdit")
- self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole, self.gainMuEdit)
- self.alphaEdit = QtGui.QLineEdit(self.formLayoutWidget_3)
- self.alphaEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.alphaEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.alphaEdit.setObjectName("alphaEdit")
- self.formLayout_3.setWidget(1, QtGui.QFormLayout.FieldRole, self.alphaEdit)
- self.horizontalLayout.addWidget(self.rxBox)
- self.rxBox_2 = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxBox_2.sizePolicy().hasHeightForWidth())
- self.rxBox_2.setSizePolicy(sizePolicy)
- self.rxBox_2.setMinimumSize(QtCore.QSize(220, 125))
- self.rxBox_2.setMaximumSize(QtCore.QSize(265, 125))
- self.rxBox_2.setObjectName("rxBox_2")
- self.formLayoutWidget_4 = QtGui.QWidget(self.rxBox_2)
- self.formLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 201, 91))
- self.formLayoutWidget_4.setObjectName("formLayoutWidget_4")
- self.formLayout_4 = QtGui.QFormLayout(self.formLayoutWidget_4)
- self.formLayout_4.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout_4.setObjectName("formLayout_4")
- self.pktsRcvdLabel = QtGui.QLabel(self.formLayoutWidget_4)
- self.pktsRcvdLabel.setObjectName("pktsRcvdLabel")
- self.formLayout_4.setWidget(0, QtGui.QFormLayout.LabelRole, self.pktsRcvdLabel)
- self.pktsCorrectLabel = QtGui.QLabel(self.formLayoutWidget_4)
- self.pktsCorrectLabel.setObjectName("pktsCorrectLabel")
- self.formLayout_4.setWidget(1, QtGui.QFormLayout.LabelRole, self.pktsCorrectLabel)
- self.perLabel = QtGui.QLabel(self.formLayoutWidget_4)
- self.perLabel.setObjectName("perLabel")
- self.formLayout_4.setWidget(2, QtGui.QFormLayout.LabelRole, self.perLabel)
- self.pktsRcvdEdit = QtGui.QLineEdit(self.formLayoutWidget_4)
- self.pktsRcvdEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.pktsRcvdEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pktsRcvdEdit.setObjectName("pktsRcvdEdit")
- self.formLayout_4.setWidget(0, QtGui.QFormLayout.FieldRole, self.pktsRcvdEdit)
- self.pktsCorrectEdit = QtGui.QLineEdit(self.formLayoutWidget_4)
- self.pktsCorrectEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.pktsCorrectEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pktsCorrectEdit.setObjectName("pktsCorrectEdit")
- self.formLayout_4.setWidget(1, QtGui.QFormLayout.FieldRole, self.pktsCorrectEdit)
- self.perEdit = QtGui.QLineEdit(self.formLayoutWidget_4)
- self.perEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.perEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.perEdit.setObjectName("perEdit")
- self.formLayout_4.setWidget(2, QtGui.QFormLayout.FieldRole, self.perEdit)
- self.horizontalLayout.addWidget(self.rxBox_2)
- spacerItem1 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setObjectName("verticalLayout")
- self.pauseButton = QtGui.QPushButton(self.centralwidget)
- self.pauseButton.setMinimumSize(QtCore.QSize(80, 0))
- self.pauseButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pauseButton.setObjectName("pauseButton")
- self.verticalLayout.addWidget(self.pauseButton)
- spacerItem2 = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- self.verticalLayout.addItem(spacerItem2)
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- self.closeButton.setMinimumSize(QtCore.QSize(80, 0))
- self.closeButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.closeButton.setObjectName("closeButton")
- self.verticalLayout.addWidget(self.closeButton)
- self.horizontalLayout.addLayout(self.verticalLayout)
- self.verticalLayout_4.addLayout(self.horizontalLayout)
- DigitalWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(DigitalWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1059, 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.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.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.gainMuLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Gain mu", None, QtGui.QApplication.UnicodeUTF8))
- self.alphaLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Alpha", None, QtGui.QApplication.UnicodeUTF8))
- self.rxBox_2.setTitle(QtGui.QApplication.translate("DigitalWindow", "Received Packet Info", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsRcvdLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Rcvd.", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsCorrectLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Correct", None, QtGui.QApplication.UnicodeUTF8))
- self.perLabel.setText(QtGui.QApplication.translate("DigitalWindow", "PER", 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/gnuradio-examples/python/digital/qt_digital_window.ui b/gnuradio-examples/python/digital/qt_digital_window.ui
deleted file mode 100644
index 4b3857d87..000000000
--- a/gnuradio-examples/python/digital/qt_digital_window.ui
+++ /dev/null
@@ -1,581 +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>1059</width>
- <height>754</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout_4">
- <item>
- <layout class="QHBoxLayout" name="sinkLayout"/>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QGroupBox" name="sysBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>240</width>
- <height>60</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>240</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>System Parameters</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>211</width>
- <height>31</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <property name="verticalSpacing">
- <number>20</number>
- </property>
- <item row="0" column="1">
- <widget class="QLineEdit" name="sampleRateEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>26</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>26</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="sampleRateLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>20</height>
- </size>
- </property>
- <property name="text">
- <string>Sample Rate (sps)</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QGroupBox" name="channelModeBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>245</width>
- <height>130</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>245</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>Channel Model Parameters</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget_2">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>221</width>
- <height>98</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout_2">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="snrLabel">
- <property name="text">
- <string>SNR (dB)</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="snrEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="freqLabel">
- <property name="text">
- <string>Frequency Offset (Hz)</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="freqEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="timeLabel">
- <property name="text">
- <string>Timing Offset</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="timeEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <zorder>formLayoutWidget_2</zorder>
- <zorder>sysBox</zorder>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="rxBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>220</width>
- <height>130</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>180</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>Receiver Parameters</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget_3">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>201</width>
- <height>101</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout_3">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="gainMuLabel">
- <property name="text">
- <string>Gain mu</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="alphaLabel">
- <property name="text">
- <string>Alpha</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="gainMuEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="alphaEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="rxBox_2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>220</width>
- <height>125</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>265</width>
- <height>125</height>
- </size>
- </property>
- <property name="title">
- <string>Received Packet Info</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget_4">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>201</width>
- <height>91</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout_4">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="pktsRcvdLabel">
- <property name="text">
- <string>Packets Rcvd.</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="pktsCorrectLabel">
- <property name="text">
- <string>Packets Correct</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="perLabel">
- <property name="text">
- <string>PER</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="pktsRcvdEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="pktsCorrectEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="perEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QPushButton" name="pauseButton">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Pause</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="closeButton">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <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>1059</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/gnuradio-examples/python/digital/qt_digital_window2.py b/gnuradio-examples/python/digital/qt_digital_window2.py
deleted file mode 100644
index 2d10e3a7f..000000000
--- a/gnuradio-examples/python/digital/qt_digital_window2.py
+++ /dev/null
@@ -1,248 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_digital_window2.ui'
-#
-# Created: Tue May 11 20:55:10 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(1059, 751)
- self.centralwidget = QtGui.QWidget(DigitalWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.verticalLayout_3 = QtGui.QVBoxLayout(self.centralwidget)
- self.verticalLayout_3.setObjectName("verticalLayout_3")
- self.sinkLayout = QtGui.QHBoxLayout()
- self.sinkLayout.setObjectName("sinkLayout")
- self.verticalLayout_3.addLayout(self.sinkLayout)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.verticalLayout_2 = QtGui.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- self.sysBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sysBox.sizePolicy().hasHeightForWidth())
- self.sysBox.setSizePolicy(sizePolicy)
- self.sysBox.setMinimumSize(QtCore.QSize(240, 60))
- self.sysBox.setMaximumSize(QtCore.QSize(240, 16777215))
- self.sysBox.setObjectName("sysBox")
- self.formLayoutWidget = QtGui.QWidget(self.sysBox)
- self.formLayoutWidget.setGeometry(QtCore.QRect(10, 20, 211, 31))
- self.formLayoutWidget.setObjectName("formLayoutWidget")
- self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
- self.formLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout.setVerticalSpacing(20)
- self.formLayout.setObjectName("formLayout")
- self.sampleRateEdit = QtGui.QLineEdit(self.formLayoutWidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sampleRateEdit.sizePolicy().hasHeightForWidth())
- self.sampleRateEdit.setSizePolicy(sizePolicy)
- self.sampleRateEdit.setMinimumSize(QtCore.QSize(60, 26))
- self.sampleRateEdit.setMaximumSize(QtCore.QSize(80, 26))
- self.sampleRateEdit.setObjectName("sampleRateEdit")
- self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.sampleRateEdit)
- self.sampleRateLabel = QtGui.QLabel(self.formLayoutWidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.sampleRateLabel.sizePolicy().hasHeightForWidth())
- self.sampleRateLabel.setSizePolicy(sizePolicy)
- self.sampleRateLabel.setMinimumSize(QtCore.QSize(0, 20))
- self.sampleRateLabel.setMaximumSize(QtCore.QSize(16777215, 20))
- self.sampleRateLabel.setObjectName("sampleRateLabel")
- self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.sampleRateLabel)
- self.verticalLayout_2.addWidget(self.sysBox)
- spacerItem = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- self.verticalLayout_2.addItem(spacerItem)
- self.horizontalLayout.addLayout(self.verticalLayout_2)
- self.channelModeBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.channelModeBox.sizePolicy().hasHeightForWidth())
- self.channelModeBox.setSizePolicy(sizePolicy)
- self.channelModeBox.setMinimumSize(QtCore.QSize(245, 130))
- self.channelModeBox.setMaximumSize(QtCore.QSize(245, 16777215))
- self.channelModeBox.setObjectName("channelModeBox")
- self.formLayoutWidget_2 = QtGui.QWidget(self.channelModeBox)
- self.formLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 221, 98))
- self.formLayoutWidget_2.setObjectName("formLayoutWidget_2")
- self.formLayout_2 = QtGui.QFormLayout(self.formLayoutWidget_2)
- self.formLayout_2.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout_2.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
- self.formLayout_2.setObjectName("formLayout_2")
- self.snrLabel = QtGui.QLabel(self.formLayoutWidget_2)
- self.snrLabel.setObjectName("snrLabel")
- self.formLayout_2.setWidget(0, QtGui.QFormLayout.LabelRole, self.snrLabel)
- self.snrEdit = QtGui.QLineEdit(self.formLayoutWidget_2)
- self.snrEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.snrEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.snrEdit.setObjectName("snrEdit")
- self.formLayout_2.setWidget(0, QtGui.QFormLayout.FieldRole, self.snrEdit)
- self.freqLabel = QtGui.QLabel(self.formLayoutWidget_2)
- self.freqLabel.setObjectName("freqLabel")
- self.formLayout_2.setWidget(1, QtGui.QFormLayout.LabelRole, self.freqLabel)
- self.freqEdit = QtGui.QLineEdit(self.formLayoutWidget_2)
- self.freqEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.freqEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.freqEdit.setObjectName("freqEdit")
- self.formLayout_2.setWidget(1, QtGui.QFormLayout.FieldRole, self.freqEdit)
- self.timeLabel = QtGui.QLabel(self.formLayoutWidget_2)
- self.timeLabel.setObjectName("timeLabel")
- self.formLayout_2.setWidget(2, QtGui.QFormLayout.LabelRole, self.timeLabel)
- self.timeEdit = QtGui.QLineEdit(self.formLayoutWidget_2)
- self.timeEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.timeEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.timeEdit.setObjectName("timeEdit")
- self.formLayout_2.setWidget(2, QtGui.QFormLayout.FieldRole, self.timeEdit)
- self.horizontalLayout.addWidget(self.channelModeBox)
- self.rxBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxBox.sizePolicy().hasHeightForWidth())
- self.rxBox.setSizePolicy(sizePolicy)
- self.rxBox.setMinimumSize(QtCore.QSize(220, 130))
- self.rxBox.setMaximumSize(QtCore.QSize(180, 16777215))
- self.rxBox.setObjectName("rxBox")
- self.formLayoutWidget_3 = QtGui.QWidget(self.rxBox)
- self.formLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 201, 101))
- self.formLayoutWidget_3.setObjectName("formLayoutWidget_3")
- self.formLayout_3 = QtGui.QFormLayout(self.formLayoutWidget_3)
- self.formLayout_3.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout_3.setObjectName("formLayout_3")
- self.gainClockLabel = QtGui.QLabel(self.formLayoutWidget_3)
- self.gainClockLabel.setObjectName("gainClockLabel")
- self.formLayout_3.setWidget(0, QtGui.QFormLayout.LabelRole, self.gainClockLabel)
- self.gainPhaseLabel = QtGui.QLabel(self.formLayoutWidget_3)
- self.gainPhaseLabel.setObjectName("gainPhaseLabel")
- self.formLayout_3.setWidget(2, QtGui.QFormLayout.LabelRole, self.gainPhaseLabel)
- self.gainClockEdit = QtGui.QLineEdit(self.formLayoutWidget_3)
- self.gainClockEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.gainClockEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.gainClockEdit.setObjectName("gainClockEdit")
- self.formLayout_3.setWidget(0, QtGui.QFormLayout.FieldRole, self.gainClockEdit)
- self.gainFreqEdit = QtGui.QLineEdit(self.formLayoutWidget_3)
- self.gainFreqEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.gainFreqEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.gainFreqEdit.setObjectName("gainFreqEdit")
- self.formLayout_3.setWidget(2, QtGui.QFormLayout.FieldRole, self.gainFreqEdit)
- self.gainPhaseEdit = QtGui.QLineEdit(self.formLayoutWidget_3)
- self.gainPhaseEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.gainPhaseEdit.setObjectName("gainPhaseEdit")
- self.formLayout_3.setWidget(1, QtGui.QFormLayout.FieldRole, self.gainPhaseEdit)
- self.gainPhaseLabel_2 = QtGui.QLabel(self.formLayoutWidget_3)
- self.gainPhaseLabel_2.setObjectName("gainPhaseLabel_2")
- self.formLayout_3.setWidget(1, QtGui.QFormLayout.LabelRole, self.gainPhaseLabel_2)
- self.horizontalLayout.addWidget(self.rxBox)
- self.rxBox_2 = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxBox_2.sizePolicy().hasHeightForWidth())
- self.rxBox_2.setSizePolicy(sizePolicy)
- self.rxBox_2.setMinimumSize(QtCore.QSize(220, 125))
- self.rxBox_2.setMaximumSize(QtCore.QSize(265, 125))
- self.rxBox_2.setObjectName("rxBox_2")
- self.formLayoutWidget_4 = QtGui.QWidget(self.rxBox_2)
- self.formLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 201, 91))
- self.formLayoutWidget_4.setObjectName("formLayoutWidget_4")
- self.formLayout_4 = QtGui.QFormLayout(self.formLayoutWidget_4)
- self.formLayout_4.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.formLayout_4.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
- self.formLayout_4.setObjectName("formLayout_4")
- self.pktsRcvdLabel = QtGui.QLabel(self.formLayoutWidget_4)
- self.pktsRcvdLabel.setObjectName("pktsRcvdLabel")
- self.formLayout_4.setWidget(0, QtGui.QFormLayout.LabelRole, self.pktsRcvdLabel)
- self.pktsRcvdEdit = QtGui.QLineEdit(self.formLayoutWidget_4)
- self.pktsRcvdEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.pktsRcvdEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pktsRcvdEdit.setObjectName("pktsRcvdEdit")
- self.formLayout_4.setWidget(0, QtGui.QFormLayout.FieldRole, self.pktsRcvdEdit)
- self.pktsCorrectLabel = QtGui.QLabel(self.formLayoutWidget_4)
- self.pktsCorrectLabel.setObjectName("pktsCorrectLabel")
- self.formLayout_4.setWidget(1, QtGui.QFormLayout.LabelRole, self.pktsCorrectLabel)
- self.pktsCorrectEdit = QtGui.QLineEdit(self.formLayoutWidget_4)
- self.pktsCorrectEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.pktsCorrectEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pktsCorrectEdit.setObjectName("pktsCorrectEdit")
- self.formLayout_4.setWidget(1, QtGui.QFormLayout.FieldRole, self.pktsCorrectEdit)
- self.perLabel = QtGui.QLabel(self.formLayoutWidget_4)
- self.perLabel.setObjectName("perLabel")
- self.formLayout_4.setWidget(2, QtGui.QFormLayout.LabelRole, self.perLabel)
- self.perEdit = QtGui.QLineEdit(self.formLayoutWidget_4)
- self.perEdit.setMinimumSize(QtCore.QSize(60, 0))
- self.perEdit.setMaximumSize(QtCore.QSize(80, 16777215))
- self.perEdit.setObjectName("perEdit")
- self.formLayout_4.setWidget(2, QtGui.QFormLayout.FieldRole, self.perEdit)
- self.horizontalLayout.addWidget(self.rxBox_2)
- spacerItem1 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.verticalLayout = QtGui.QVBoxLayout()
- self.verticalLayout.setObjectName("verticalLayout")
- self.pauseButton = QtGui.QPushButton(self.centralwidget)
- self.pauseButton.setMinimumSize(QtCore.QSize(80, 0))
- self.pauseButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.pauseButton.setObjectName("pauseButton")
- self.verticalLayout.addWidget(self.pauseButton)
- spacerItem2 = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- self.verticalLayout.addItem(spacerItem2)
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- self.closeButton.setMinimumSize(QtCore.QSize(80, 0))
- self.closeButton.setMaximumSize(QtCore.QSize(80, 16777215))
- self.closeButton.setObjectName("closeButton")
- self.verticalLayout.addWidget(self.closeButton)
- self.horizontalLayout.addLayout(self.verticalLayout)
- self.verticalLayout_3.addLayout(self.horizontalLayout)
- DigitalWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(DigitalWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1059, 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.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.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.gainClockLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Clock Loop Gain", None, QtGui.QApplication.UnicodeUTF8))
- self.gainPhaseLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Freq. Loop Gain", None, QtGui.QApplication.UnicodeUTF8))
- self.gainPhaseLabel_2.setText(QtGui.QApplication.translate("DigitalWindow", "Phase Loop Gain", None, QtGui.QApplication.UnicodeUTF8))
- self.rxBox_2.setTitle(QtGui.QApplication.translate("DigitalWindow", "Received Packet Info", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsRcvdLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Rcvd.", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsCorrectLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Correct", None, QtGui.QApplication.UnicodeUTF8))
- self.perLabel.setText(QtGui.QApplication.translate("DigitalWindow", "PER", 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/gnuradio-examples/python/digital/qt_digital_window2.ui b/gnuradio-examples/python/digital/qt_digital_window2.ui
deleted file mode 100644
index 544704668..000000000
--- a/gnuradio-examples/python/digital/qt_digital_window2.ui
+++ /dev/null
@@ -1,605 +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>1059</width>
- <height>751</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <layout class="QHBoxLayout" name="sinkLayout"/>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_2">
- <item>
- <widget class="QGroupBox" name="sysBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>240</width>
- <height>60</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>240</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>System Parameters</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>211</width>
- <height>31</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <property name="verticalSpacing">
- <number>20</number>
- </property>
- <item row="0" column="1">
- <widget class="QLineEdit" name="sampleRateEdit">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>26</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>26</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="sampleRateLabel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>16777215</width>
- <height>20</height>
- </size>
- </property>
- <property name="text">
- <string>Sample Rate (sps)</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QGroupBox" name="channelModeBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>245</width>
- <height>130</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>245</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>Channel Model Parameters</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget_2">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>221</width>
- <height>98</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout_2">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="snrLabel">
- <property name="text">
- <string>SNR (dB)</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="snrEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="freqLabel">
- <property name="text">
- <string>Frequency Offset (Hz)</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="freqEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="timeLabel">
- <property name="text">
- <string>Timing Offset</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="timeEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="rxBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>220</width>
- <height>130</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>180</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="title">
- <string>Receiver Parameters</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget_3">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>201</width>
- <height>101</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout_3">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="gainClockLabel">
- <property name="text">
- <string>Clock Loop Gain</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="gainPhaseLabel">
- <property name="text">
- <string>Freq. Loop Gain</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="gainClockEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="gainFreqEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="gainPhaseEdit">
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="gainPhaseLabel_2">
- <property name="text">
- <string>Phase Loop Gain</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QGroupBox" name="rxBox_2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>220</width>
- <height>125</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>265</width>
- <height>125</height>
- </size>
- </property>
- <property name="title">
- <string>Received Packet Info</string>
- </property>
- <widget class="QWidget" name="formLayoutWidget_4">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>20</y>
- <width>201</width>
- <height>91</height>
- </rect>
- </property>
- <layout class="QFormLayout" name="formLayout_4">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
- </property>
- <item row="0" column="0">
- <widget class="QLabel" name="pktsRcvdLabel">
- <property name="text">
- <string>Packets Rcvd.</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="pktsRcvdEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="pktsCorrectLabel">
- <property name="text">
- <string>Packets Correct</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="pktsCorrectEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="perLabel">
- <property name="text">
- <string>PER</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="perEdit">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
- <zorder>pktsRcvdLabel</zorder>
- <zorder>pktsCorrectLabel</zorder>
- <zorder>perLabel</zorder>
- <zorder>pktsRcvdEdit</zorder>
- <zorder>pktsCorrectEdit</zorder>
- <zorder>perEdit</zorder>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QPushButton" name="pauseButton">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Pause</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="closeButton">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
- </property>
- <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>1059</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/gnuradio-examples/python/digital/qt_rx_window.py b/gnuradio-examples/python/digital/qt_rx_window.py
deleted file mode 100644
index e2488eb3d..000000000
--- a/gnuradio-examples/python/digital/qt_rx_window.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_rx_window.ui'
-#
-# Created: Tue May 11 21:03:07 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(999, 519)
- self.centralwidget = QtGui.QWidget(DigitalWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
- self.verticalLayout.setObjectName("verticalLayout")
- self.sinkLayout = QtGui.QHBoxLayout()
- self.sinkLayout.setObjectName("sinkLayout")
- self.verticalLayout.addLayout(self.sinkLayout)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.rxBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxBox.sizePolicy().hasHeightForWidth())
- self.rxBox.setSizePolicy(sizePolicy)
- self.rxBox.setMinimumSize(QtCore.QSize(250, 190))
- self.rxBox.setMaximumSize(QtCore.QSize(250, 190))
- self.rxBox.setObjectName("rxBox")
- self.gainMuEdit = QtGui.QLineEdit(self.rxBox)
- self.gainMuEdit.setGeometry(QtCore.QRect(120, 120, 113, 23))
- self.gainMuEdit.setObjectName("gainMuEdit")
- self.gainMuLabel = QtGui.QLabel(self.rxBox)
- self.gainMuLabel.setGeometry(QtCore.QRect(10, 120, 111, 20))
- self.gainMuLabel.setObjectName("gainMuLabel")
- self.alphaEdit = QtGui.QLineEdit(self.rxBox)
- self.alphaEdit.setGeometry(QtCore.QRect(120, 150, 113, 23))
- self.alphaEdit.setObjectName("alphaEdit")
- self.alphaLabel = QtGui.QLabel(self.rxBox)
- self.alphaLabel.setGeometry(QtCore.QRect(10, 150, 111, 20))
- self.alphaLabel.setObjectName("alphaLabel")
- self.gainLabel = QtGui.QLabel(self.rxBox)
- self.gainLabel.setGeometry(QtCore.QRect(10, 60, 101, 17))
- self.gainLabel.setObjectName("gainLabel")
- self.freqEdit = QtGui.QLineEdit(self.rxBox)
- self.freqEdit.setGeometry(QtCore.QRect(120, 30, 113, 23))
- self.freqEdit.setObjectName("freqEdit")
- self.freqLabel = QtGui.QLabel(self.rxBox)
- self.freqLabel.setGeometry(QtCore.QRect(10, 30, 141, 17))
- self.freqLabel.setObjectName("freqLabel")
- self.gainEdit = QtGui.QLineEdit(self.rxBox)
- self.gainEdit.setGeometry(QtCore.QRect(120, 60, 113, 23))
- self.gainEdit.setObjectName("gainEdit")
- self.decimLabel = QtGui.QLabel(self.rxBox)
- self.decimLabel.setGeometry(QtCore.QRect(10, 90, 101, 17))
- self.decimLabel.setObjectName("decimLabel")
- self.decimEdit = QtGui.QLineEdit(self.rxBox)
- self.decimEdit.setGeometry(QtCore.QRect(120, 90, 113, 23))
- self.decimEdit.setObjectName("decimEdit")
- self.horizontalLayout.addWidget(self.rxBox)
- self.verticalLayout_3 = QtGui.QVBoxLayout()
- self.verticalLayout_3.setObjectName("verticalLayout_3")
- self.rxPacketBox = QtGui.QGroupBox(self.centralwidget)
- self.rxPacketBox.setEnabled(True)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxPacketBox.sizePolicy().hasHeightForWidth())
- self.rxPacketBox.setSizePolicy(sizePolicy)
- self.rxPacketBox.setMinimumSize(QtCore.QSize(250, 130))
- self.rxPacketBox.setMaximumSize(QtCore.QSize(250, 130))
- font = QtGui.QFont()
- font.setWeight(50)
- font.setBold(False)
- self.rxPacketBox.setFont(font)
- self.rxPacketBox.setObjectName("rxPacketBox")
- self.pktsRcvdEdit = QtGui.QLineEdit(self.rxPacketBox)
- self.pktsRcvdEdit.setGeometry(QtCore.QRect(120, 30, 113, 23))
- self.pktsRcvdEdit.setObjectName("pktsRcvdEdit")
- self.pktsRcvdLabel = QtGui.QLabel(self.rxPacketBox)
- self.pktsRcvdLabel.setGeometry(QtCore.QRect(10, 30, 111, 20))
- self.pktsRcvdLabel.setObjectName("pktsRcvdLabel")
- self.pktsCorrectEdit = QtGui.QLineEdit(self.rxPacketBox)
- self.pktsCorrectEdit.setGeometry(QtCore.QRect(120, 60, 113, 23))
- self.pktsCorrectEdit.setObjectName("pktsCorrectEdit")
- self.pktsCorrectLabel = QtGui.QLabel(self.rxPacketBox)
- self.pktsCorrectLabel.setGeometry(QtCore.QRect(10, 60, 111, 20))
- self.pktsCorrectLabel.setObjectName("pktsCorrectLabel")
- self.perLabel = QtGui.QLabel(self.rxPacketBox)
- self.perLabel.setGeometry(QtCore.QRect(10, 90, 111, 20))
- self.perLabel.setObjectName("perLabel")
- self.perEdit = QtGui.QLineEdit(self.rxPacketBox)
- self.perEdit.setGeometry(QtCore.QRect(120, 90, 113, 23))
- self.perEdit.setObjectName("perEdit")
- self.verticalLayout_3.addWidget(self.rxPacketBox)
- spacerItem = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- self.verticalLayout_3.addItem(spacerItem)
- self.horizontalLayout.addLayout(self.verticalLayout_3)
- spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.verticalLayout_5 = QtGui.QVBoxLayout()
- self.verticalLayout_5.setObjectName("verticalLayout_5")
- spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.verticalLayout_5.addItem(spacerItem2)
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.closeButton.sizePolicy().hasHeightForWidth())
- self.closeButton.setSizePolicy(sizePolicy)
- self.closeButton.setMinimumSize(QtCore.QSize(80, 30))
- self.closeButton.setMaximumSize(QtCore.QSize(80, 30))
- self.closeButton.setObjectName("closeButton")
- self.verticalLayout_5.addWidget(self.closeButton)
- self.horizontalLayout.addLayout(self.verticalLayout_5)
- self.verticalLayout.addLayout(self.horizontalLayout)
- DigitalWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(DigitalWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 999, 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.actionExit, QtCore.SIGNAL("triggered()"), DigitalWindow.close)
- QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), DigitalWindow.close)
- QtCore.QMetaObject.connectSlotsByName(DigitalWindow)
-
- def retranslateUi(self, DigitalWindow):
- DigitalWindow.setWindowTitle(QtGui.QApplication.translate("DigitalWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
- self.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.gainMuLabel.setText(QtGui.QApplication.translate("DigitalWindow", "mu\'s gain", None, QtGui.QApplication.UnicodeUTF8))
- self.alphaLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Alpha", None, QtGui.QApplication.UnicodeUTF8))
- self.gainLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Gain (dB)", None, QtGui.QApplication.UnicodeUTF8))
- self.freqLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Frequency (Hz)", None, QtGui.QApplication.UnicodeUTF8))
- self.decimLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Decimation", None, QtGui.QApplication.UnicodeUTF8))
- self.rxPacketBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Received Packet Info", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsRcvdLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Rcvd.", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsCorrectLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Correct", None, QtGui.QApplication.UnicodeUTF8))
- self.perLabel.setText(QtGui.QApplication.translate("DigitalWindow", "PER", 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/gnuradio-examples/python/digital/qt_rx_window.ui b/gnuradio-examples/python/digital/qt_rx_window.ui
deleted file mode 100644
index f5a074876..000000000
--- a/gnuradio-examples/python/digital/qt_rx_window.ui
+++ /dev/null
@@ -1,407 +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>999</width>
- <height>519</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QHBoxLayout" name="sinkLayout"/>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <item>
- <widget class="QGroupBox" name="rxBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>250</width>
- <height>190</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>250</width>
- <height>190</height>
- </size>
- </property>
- <property name="title">
- <string>Receiver Parameters</string>
- </property>
- <widget class="QLineEdit" name="gainMuEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>120</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="gainMuLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>120</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>mu's gain</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="alphaEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>150</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="alphaLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>150</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>Alpha</string>
- </property>
- </widget>
- <widget class="QLabel" name="gainLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>60</y>
- <width>101</width>
- <height>17</height>
- </rect>
- </property>
- <property name="text">
- <string>Gain (dB)</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="freqEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>30</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="freqLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>30</y>
- <width>141</width>
- <height>17</height>
- </rect>
- </property>
- <property name="text">
- <string>Frequency (Hz)</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="gainEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>60</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="decimLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>90</y>
- <width>101</width>
- <height>17</height>
- </rect>
- </property>
- <property name="text">
- <string>Decimation</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="decimEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>90</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QGroupBox" name="rxPacketBox">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>250</width>
- <height>130</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>250</width>
- <height>130</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <property name="title">
- <string>Received Packet Info</string>
- </property>
- <widget class="QLineEdit" name="pktsRcvdEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>30</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="pktsRcvdLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>30</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>Packets Rcvd.</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="pktsCorrectEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>60</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="pktsCorrectLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>60</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>Packets Correct</string>
- </property>
- </widget>
- <widget class="QLabel" name="perLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>90</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>PER</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="perEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>90</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </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_5">
- <item>
- <spacer name="verticalSpacer_3">
- <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="closeButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>30</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>30</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>999</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>
- <resources/>
- <connections>
- <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>
- <connection>
- <sender>closeButton</sender>
- <signal>clicked()</signal>
- <receiver>DigitalWindow</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>960</x>
- <y>694</y>
- </hint>
- <hint type="destinationlabel">
- <x>66</x>
- <y>561</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/gnuradio-examples/python/digital/qt_rx_window2.py b/gnuradio-examples/python/digital/qt_rx_window2.py
deleted file mode 100644
index 2fd719ce1..000000000
--- a/gnuradio-examples/python/digital/qt_rx_window2.py
+++ /dev/null
@@ -1,166 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_rx_window2.ui'
-#
-# Created: Tue May 11 21:01:39 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(1000, 523)
- self.centralwidget = QtGui.QWidget(DigitalWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
- self.verticalLayout.setObjectName("verticalLayout")
- self.sinkLayout = QtGui.QHBoxLayout()
- self.sinkLayout.setObjectName("sinkLayout")
- self.verticalLayout.addLayout(self.sinkLayout)
- self.horizontalLayout = QtGui.QHBoxLayout()
- self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.rxBox = QtGui.QGroupBox(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxBox.sizePolicy().hasHeightForWidth())
- self.rxBox.setSizePolicy(sizePolicy)
- self.rxBox.setMinimumSize(QtCore.QSize(250, 190))
- self.rxBox.setMaximumSize(QtCore.QSize(250, 250))
- self.rxBox.setObjectName("rxBox")
- self.formLayout = QtGui.QFormLayout(self.rxBox)
- self.formLayout.setObjectName("formLayout")
- self.freqLabel = QtGui.QLabel(self.rxBox)
- self.freqLabel.setObjectName("freqLabel")
- self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.freqLabel)
- self.freqEdit = QtGui.QLineEdit(self.rxBox)
- self.freqEdit.setObjectName("freqEdit")
- self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.freqEdit)
- self.gainLabel = QtGui.QLabel(self.rxBox)
- self.gainLabel.setObjectName("gainLabel")
- self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.gainLabel)
- self.gainEdit = QtGui.QLineEdit(self.rxBox)
- self.gainEdit.setObjectName("gainEdit")
- self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.gainEdit)
- self.decimLabel = QtGui.QLabel(self.rxBox)
- self.decimLabel.setObjectName("decimLabel")
- self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.decimLabel)
- self.decimEdit = QtGui.QLineEdit(self.rxBox)
- self.decimEdit.setObjectName("decimEdit")
- self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.decimEdit)
- self.gainClockLabel = QtGui.QLabel(self.rxBox)
- self.gainClockLabel.setObjectName("gainClockLabel")
- self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.gainClockLabel)
- self.gainClockEdit = QtGui.QLineEdit(self.rxBox)
- self.gainClockEdit.setObjectName("gainClockEdit")
- self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.gainClockEdit)
- self.gainPhaseLabel = QtGui.QLabel(self.rxBox)
- self.gainPhaseLabel.setObjectName("gainPhaseLabel")
- self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.gainPhaseLabel)
- self.gainPhaseEdit = QtGui.QLineEdit(self.rxBox)
- self.gainPhaseEdit.setObjectName("gainPhaseEdit")
- self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.gainPhaseEdit)
- self.gainFreqEdit = QtGui.QLineEdit(self.rxBox)
- self.gainFreqEdit.setObjectName("gainFreqEdit")
- self.formLayout.setWidget(5, QtGui.QFormLayout.FieldRole, self.gainFreqEdit)
- self.gainFreqLabel = QtGui.QLabel(self.rxBox)
- self.gainFreqLabel.setObjectName("gainFreqLabel")
- self.formLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.gainFreqLabel)
- self.horizontalLayout.addWidget(self.rxBox)
- self.verticalLayout_3 = QtGui.QVBoxLayout()
- self.verticalLayout_3.setObjectName("verticalLayout_3")
- self.rxPacketBox = QtGui.QGroupBox(self.centralwidget)
- self.rxPacketBox.setEnabled(True)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.rxPacketBox.sizePolicy().hasHeightForWidth())
- self.rxPacketBox.setSizePolicy(sizePolicy)
- self.rxPacketBox.setMinimumSize(QtCore.QSize(250, 130))
- self.rxPacketBox.setMaximumSize(QtCore.QSize(250, 130))
- font = QtGui.QFont()
- font.setWeight(50)
- font.setBold(False)
- self.rxPacketBox.setFont(font)
- self.rxPacketBox.setObjectName("rxPacketBox")
- self.pktsRcvdEdit = QtGui.QLineEdit(self.rxPacketBox)
- self.pktsRcvdEdit.setGeometry(QtCore.QRect(120, 30, 113, 23))
- self.pktsRcvdEdit.setObjectName("pktsRcvdEdit")
- self.pktsRcvdLabel = QtGui.QLabel(self.rxPacketBox)
- self.pktsRcvdLabel.setGeometry(QtCore.QRect(10, 30, 111, 20))
- self.pktsRcvdLabel.setObjectName("pktsRcvdLabel")
- self.pktsCorrectEdit = QtGui.QLineEdit(self.rxPacketBox)
- self.pktsCorrectEdit.setGeometry(QtCore.QRect(120, 60, 113, 23))
- self.pktsCorrectEdit.setObjectName("pktsCorrectEdit")
- self.pktsCorrectLabel = QtGui.QLabel(self.rxPacketBox)
- self.pktsCorrectLabel.setGeometry(QtCore.QRect(10, 60, 111, 20))
- self.pktsCorrectLabel.setObjectName("pktsCorrectLabel")
- self.perLabel = QtGui.QLabel(self.rxPacketBox)
- self.perLabel.setGeometry(QtCore.QRect(10, 90, 111, 20))
- self.perLabel.setObjectName("perLabel")
- self.perEdit = QtGui.QLineEdit(self.rxPacketBox)
- self.perEdit.setGeometry(QtCore.QRect(120, 90, 113, 23))
- self.perEdit.setObjectName("perEdit")
- self.verticalLayout_3.addWidget(self.rxPacketBox)
- spacerItem = QtGui.QSpacerItem(20, 60, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
- self.verticalLayout_3.addItem(spacerItem)
- self.horizontalLayout.addLayout(self.verticalLayout_3)
- spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.verticalLayout_5 = QtGui.QVBoxLayout()
- self.verticalLayout_5.setObjectName("verticalLayout_5")
- spacerItem2 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
- self.verticalLayout_5.addItem(spacerItem2)
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.closeButton.sizePolicy().hasHeightForWidth())
- self.closeButton.setSizePolicy(sizePolicy)
- self.closeButton.setMinimumSize(QtCore.QSize(80, 30))
- self.closeButton.setMaximumSize(QtCore.QSize(80, 30))
- self.closeButton.setObjectName("closeButton")
- self.verticalLayout_5.addWidget(self.closeButton)
- self.horizontalLayout.addLayout(self.verticalLayout_5)
- self.verticalLayout.addLayout(self.horizontalLayout)
- DigitalWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(DigitalWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1000, 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.actionExit, QtCore.SIGNAL("triggered()"), DigitalWindow.close)
- QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), DigitalWindow.close)
- QtCore.QMetaObject.connectSlotsByName(DigitalWindow)
-
- def retranslateUi(self, DigitalWindow):
- DigitalWindow.setWindowTitle(QtGui.QApplication.translate("DigitalWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
- self.rxBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Receiver Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.freqLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Frequency (Hz)", None, QtGui.QApplication.UnicodeUTF8))
- self.gainLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Gain (dB)", None, QtGui.QApplication.UnicodeUTF8))
- self.decimLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Decimation", None, QtGui.QApplication.UnicodeUTF8))
- self.gainClockLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Clock Loop Gain", None, QtGui.QApplication.UnicodeUTF8))
- self.gainPhaseLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Phase Loop Gain", None, QtGui.QApplication.UnicodeUTF8))
- self.gainFreqLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Freq. Loop Gain", None, QtGui.QApplication.UnicodeUTF8))
- self.rxPacketBox.setTitle(QtGui.QApplication.translate("DigitalWindow", "Received Packet Info", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsRcvdLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Rcvd.", None, QtGui.QApplication.UnicodeUTF8))
- self.pktsCorrectLabel.setText(QtGui.QApplication.translate("DigitalWindow", "Packets Correct", None, QtGui.QApplication.UnicodeUTF8))
- self.perLabel.setText(QtGui.QApplication.translate("DigitalWindow", "PER", 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/gnuradio-examples/python/digital/qt_rx_window2.ui b/gnuradio-examples/python/digital/qt_rx_window2.ui
deleted file mode 100644
index 745af8fb8..000000000
--- a/gnuradio-examples/python/digital/qt_rx_window2.ui
+++ /dev/null
@@ -1,354 +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>1000</width>
- <height>523</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget">
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QHBoxLayout" name="sinkLayout"/>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="sizeConstraint">
- <enum>QLayout::SetFixedSize</enum>
- </property>
- <item>
- <widget class="QGroupBox" name="rxBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>250</width>
- <height>190</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>250</width>
- <height>250</height>
- </size>
- </property>
- <property name="title">
- <string>Receiver Parameters</string>
- </property>
- <layout class="QFormLayout" name="formLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="freqLabel">
- <property name="text">
- <string>Frequency (Hz)</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="freqEdit"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="gainLabel">
- <property name="text">
- <string>Gain (dB)</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QLineEdit" name="gainEdit"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="decimLabel">
- <property name="text">
- <string>Decimation</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1">
- <widget class="QLineEdit" name="decimEdit"/>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="gainClockLabel">
- <property name="text">
- <string>Clock Loop Gain</string>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QLineEdit" name="gainClockEdit"/>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="gainPhaseLabel">
- <property name="text">
- <string>Phase Loop Gain</string>
- </property>
- </widget>
- </item>
- <item row="4" column="1">
- <widget class="QLineEdit" name="gainPhaseEdit"/>
- </item>
- <item row="5" column="1">
- <widget class="QLineEdit" name="gainFreqEdit"/>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="gainFreqLabel">
- <property name="text">
- <string>Freq. Loop Gain</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_3">
- <item>
- <widget class="QGroupBox" name="rxPacketBox">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>250</width>
- <height>130</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>250</width>
- <height>130</height>
- </size>
- </property>
- <property name="font">
- <font>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <property name="title">
- <string>Received Packet Info</string>
- </property>
- <widget class="QLineEdit" name="pktsRcvdEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>30</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="pktsRcvdLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>30</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>Packets Rcvd.</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="pktsCorrectEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>60</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="pktsCorrectLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>60</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>Packets Correct</string>
- </property>
- </widget>
- <widget class="QLabel" name="perLabel">
- <property name="geometry">
- <rect>
- <x>10</x>
- <y>90</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text">
- <string>PER</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="perEdit">
- <property name="geometry">
- <rect>
- <x>120</x>
- <y>90</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- </widget>
- </item>
- <item>
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>60</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </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_5">
- <item>
- <spacer name="verticalSpacer_3">
- <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="closeButton">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>30</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>80</width>
- <height>30</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>1000</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>
- <resources/>
- <connections>
- <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>
- <connection>
- <sender>closeButton</sender>
- <signal>clicked()</signal>
- <receiver>DigitalWindow</receiver>
- <slot>close()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>960</x>
- <y>694</y>
- </hint>
- <hint type="destinationlabel">
- <x>66</x>
- <y>561</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/gnuradio-examples/python/digital/usrp_receive_path.py b/gnuradio-examples/python/digital/usrp_receive_path.py
deleted file mode 100644
index a8f16e28a..000000000
--- a/gnuradio-examples/python/digital/usrp_receive_path.py
+++ /dev/null
@@ -1,96 +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
-from gnuradio import usrp_options
-import receive_path
-from pick_bitrate import pick_rx_bitrate
-from gnuradio import eng_notation
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-def add_options(parser, expert):
- add_freq_option(parser)
- usrp_options.add_rx_options(parser)
- receive_path.receive_path.add_options(parser, expert)
- expert.add_option("", "--rx-freq", type="eng_float", default=None,
- help="set Rx frequency to FREQ [default=%default]", metavar="FREQ")
- parser.add_option("-v", "--verbose", action="store_true", default=False)
-
-class usrp_receive_path(gr.hier_block2):
-
- def __init__(self, demod_class, rx_callback, options):
- '''
- See below for what options should hold
- '''
- gr.hier_block2.__init__(self, "usrp_receive_path",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
- if options.rx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
- raise SystemExit
-
- #setup usrp
- self._demod_class = demod_class
- self._setup_usrp_source(options)
-
- rx_path = receive_path.receive_path(demod_class, rx_callback, options)
- for attr in dir(rx_path): #forward the methods
- if not attr.startswith('_') and not hasattr(self, attr):
- setattr(self, attr, getattr(rx_path, attr))
-
- #connect
- self.connect(self.u, rx_path)
-
- def _setup_usrp_source(self, options):
- self.u = usrp_options.create_usrp_source(options)
- adc_rate = self.u.adc_rate()
- self.rs_rate = options.bitrate
-
- (self._bitrate, self._samples_per_symbol, self._decim) = \
- pick_rx_bitrate(options.bitrate, self._demod_class.bits_per_symbol(), \
- options.samples_per_symbol, options.decim,
- adc_rate, self.u.get_decim_rates())
-
- if options.verbose:
- print 'USRP Source:', self.u
- print 'Decimation: ', self._decim
-
- options.samples_per_symbol = self._samples_per_symbol
- options.decim = self._decim
-
- self.u.set_decim(self._decim)
-
- if not self.u.set_center_freq(options.rx_freq):
- print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.rx_freq))
- raise ValueError, eng_notation.num_to_str(options.rx_freq)
diff --git a/gnuradio-examples/python/digital/usrp_receive_path2.py b/gnuradio-examples/python/digital/usrp_receive_path2.py
deleted file mode 100644
index d20017204..000000000
--- a/gnuradio-examples/python/digital/usrp_receive_path2.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#
-# Copyright 2010 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 usrp_options
-import receive_path
-from pick_bitrate2 import pick_rx_bitrate
-from gnuradio import eng_notation
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-def add_options(parser, expert):
- add_freq_option(parser)
- usrp_options.add_rx_options(parser)
- receive_path.receive_path.add_options(parser, expert)
- expert.add_option("", "--rx-freq", type="eng_float", default=None,
- help="set Rx frequency to FREQ [default=%default]", metavar="FREQ")
- parser.add_option("-v", "--verbose", action="store_true", default=False)
-
-class usrp_receive_path(gr.hier_block2):
-
- def __init__(self, demod_class, rx_callback, options):
- '''
- See below for what options should hold
- '''
- gr.hier_block2.__init__(self, "usrp_receive_path",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
- if options.rx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
- raise SystemExit
-
- #setup usrp
- self._demod_class = demod_class
- self._setup_usrp_source(options)
-
- rx_path = receive_path.receive_path(demod_class, rx_callback, options)
- for attr in dir(rx_path): #forward the methods
- if not attr.startswith('_') and not hasattr(self, attr):
- setattr(self, attr, getattr(rx_path, attr))
-
- #connect
- self.connect(self.u, rx_path)
-
- def _setup_usrp_source(self, options):
- self.u = usrp_options.create_usrp_source(options)
- adc_rate = self.u.adc_rate()
- self.rs_rate = options.bitrate
-
- (self._bitrate, self._samples_per_symbol, self._decim) = \
- pick_rx_bitrate(options.bitrate, self._demod_class.bits_per_symbol(), \
- options.samples_per_symbol, options.decim,
- adc_rate, self.u.get_decim_rates())
-
- if options.verbose:
- print 'USRP Source:', self.u
- print 'Decimation: ', self._decim
-
- options.samples_per_symbol = self._samples_per_symbol
- options.decim = self._decim
-
- self.u.set_decim(self._decim)
-
- if not self.u.set_center_freq(options.rx_freq):
- print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.rx_freq))
- raise ValueError, eng_notation.num_to_str(options.rx_freq)
diff --git a/gnuradio-examples/python/digital/usrp_transmit_path.py b/gnuradio-examples/python/digital/usrp_transmit_path.py
deleted file mode 100644
index f0f467599..000000000
--- a/gnuradio-examples/python/digital/usrp_transmit_path.py
+++ /dev/null
@@ -1,101 +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
-from gnuradio import usrp_options
-import transmit_path
-from pick_bitrate import pick_tx_bitrate
-from gnuradio import eng_notation
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-def add_options(parser, expert):
- add_freq_option(parser)
- usrp_options.add_tx_options(parser)
- transmit_path.transmit_path.add_options(parser, expert)
- expert.add_option("", "--tx-freq", type="eng_float", default=None,
- help="set transmit frequency to FREQ [default=%default]", metavar="FREQ")
- parser.add_option("-v", "--verbose", action="store_true", default=False)
-
-class usrp_transmit_path(gr.hier_block2):
- def __init__(self, modulator_class, options):
- '''
- See below for what options should hold
- '''
- gr.hier_block2.__init__(self, "usrp_transmit_path",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
- if options.tx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --tx-freq FREQ must be specified\n")
- raise SystemExit
-
- #setup usrp
- self._modulator_class = modulator_class
- self._setup_usrp_sink(options)
-
- tx_path = transmit_path.transmit_path(modulator_class, options)
- for attr in dir(tx_path): #forward the methods
- if not attr.startswith('_') and not hasattr(self, attr):
- setattr(self, attr, getattr(tx_path, attr))
-
- #connect
- self.connect(tx_path, self.u)
-
- def _setup_usrp_sink(self, options):
- """
- Creates a USRP sink, determines the settings for best bitrate,
- and attaches to the transmitter's subdevice.
- """
- self.u = usrp_options.create_usrp_sink(options)
- dac_rate = self.u.dac_rate()
- self.rs_rate = options.bitrate # Store requested bit rate
-
- (self._bitrate, self._samples_per_symbol, self._interp) = \
- pick_tx_bitrate(options.bitrate, self._modulator_class.bits_per_symbol(),
- options.samples_per_symbol, options.interp,
- dac_rate, self.u.get_interp_rates())
-
- options.interp = self._interp
- options.samples_per_symbol = self._samples_per_symbol
- options.bitrate = self._bitrate
-
- if options.verbose:
- print 'USRP Sink:', self.u
- print "Interpolation Rate: ", self._interp
-
- self.u.set_interp(self._interp)
- self.u.set_auto_tr(True)
-
- if not self.u.set_center_freq(options.tx_freq):
- print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.tx_freq))
- raise ValueError, eng_notation.num_to_str(options.tx_freq)
diff --git a/gnuradio-examples/python/digital/usrp_transmit_path2.py b/gnuradio-examples/python/digital/usrp_transmit_path2.py
deleted file mode 100644
index 54930e5a0..000000000
--- a/gnuradio-examples/python/digital/usrp_transmit_path2.py
+++ /dev/null
@@ -1,101 +0,0 @@
-#
-# Copyright 2010 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 usrp_options
-import transmit_path
-from pick_bitrate2 import pick_tx_bitrate
-from gnuradio import eng_notation
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-def add_options(parser, expert):
- add_freq_option(parser)
- usrp_options.add_tx_options(parser)
- transmit_path.transmit_path.add_options(parser, expert)
- expert.add_option("", "--tx-freq", type="eng_float", default=None,
- help="set transmit frequency to FREQ [default=%default]", metavar="FREQ")
- parser.add_option("-v", "--verbose", action="store_true", default=False)
-
-class usrp_transmit_path(gr.hier_block2):
- def __init__(self, modulator_class, options):
- '''
- See below for what options should hold
- '''
- gr.hier_block2.__init__(self, "usrp_transmit_path",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
- if options.tx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --tx-freq FREQ must be specified\n")
- raise SystemExit
-
- #setup usrp
- self._modulator_class = modulator_class
- self._setup_usrp_sink(options)
-
- tx_path = transmit_path.transmit_path(modulator_class, options)
- for attr in dir(tx_path): #forward the methods
- if not attr.startswith('_') and not hasattr(self, attr):
- setattr(self, attr, getattr(tx_path, attr))
-
- #connect
- self.connect(tx_path, self.u)
-
- def _setup_usrp_sink(self, options):
- """
- Creates a USRP sink, determines the settings for best bitrate,
- and attaches to the transmitter's subdevice.
- """
- self.u = usrp_options.create_usrp_sink(options)
- dac_rate = self.u.dac_rate()
- self.rs_rate = options.bitrate # Store requested bit rate
-
- (self._bitrate, self._samples_per_symbol, self._interp) = \
- pick_tx_bitrate(options.bitrate, self._modulator_class.bits_per_symbol(),
- options.samples_per_symbol, options.interp,
- dac_rate, self.u.get_interp_rates())
-
- options.interp = self._interp
- options.samples_per_symbol = self._samples_per_symbol
- options.bitrate = self._bitrate
-
- if options.verbose:
- print 'USRP Sink:', self.u
- print "Interpolation Rate: ", self._interp
-
- self.u.set_interp(self._interp)
- self.u.set_auto_tr(True)
-
- if not self.u.set_center_freq(options.tx_freq):
- print "Failed to set Rx frequency to %s" % (eng_notation.num_to_str(options.tx_freq))
- raise ValueError, eng_notation.num_to_str(options.tx_freq)
diff --git a/gnuradio-examples/python/digital_voice/.gitignore b/gnuradio-examples/python/digital_voice/.gitignore
deleted file mode 100644
index c400497f5..000000000
--- a/gnuradio-examples/python/digital_voice/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.pyc
-/*.pyo
diff --git a/gnuradio-examples/python/digital_voice/cvsd_test.py b/gnuradio-examples/python/digital_voice/cvsd_test.py
deleted file mode 100755
index f8f1b9cce..000000000
--- a/gnuradio-examples/python/digital_voice/cvsd_test.py
+++ /dev/null
@@ -1,63 +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.
-#
-
-from gnuradio import gr, blks2
-from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-def main():
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-I", "--audio-input", type="string", default="",
- help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-O", "--audio-output", type="string", default="",
- help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-r", "--sample-rate", type="eng_float", default="32000",
- help="Audio sampling rate [defaul=%default]")
- parser.add_option("-S", "--resample-rate", type="int", default="8",
- help="Resampling rate in CVSD [default=%default]")
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help()
- raise SystemExit, 1
-
- tb = gr.top_block()
-
- src = audio.source(int(options.sample_rate), options.audio_input)
- tx = blks2.cvsd_encode(options.resample_rate)
-
- # todo: add noise
-
- rx = blks2.cvsd_decode(options.resample_rate)
- dst = audio.sink(int(options.sample_rate), options.audio_output)
-
- tb.connect(src, tx, rx, dst)
- tb.run()
-
-if __name__ == '__main__':
- print "Enter CTRL-C to exit"
- try:
- main()
- except KeyboardInterrupt:
- pass
-
diff --git a/gnuradio-examples/python/digital_voice/encdec.py b/gnuradio-examples/python/digital_voice/encdec.py
deleted file mode 100755
index e87d57e2b..000000000
--- a/gnuradio-examples/python/digital_voice/encdec.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-from gnuradio import gr, blks2
-from gnuradio import audio
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-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="",
- help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
- parser.add_option("-O", "--audio-output", type="string", 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 = 8000
- src = audio.source(sample_rate, options.audio_input)
- tx = blks2.digital_voice_tx(self)
- if_gain = gr.multiply_const_cc(10000)
- # channel simulator here...
- rx = blks2.digital_voice_rx(self)
- dst = audio.sink(sample_rate, options.audio_output)
-
- self.connect(src, tx, if_gain, rx, dst)
-
-
-if __name__ == '__main__':
- try:
- my_top_block().run()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/multi-antenna/.gitignore b/gnuradio-examples/python/multi-antenna/.gitignore
deleted file mode 100644
index ff40c06f3..000000000
--- a/gnuradio-examples/python/multi-antenna/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.pyc
-/*.pyo
-/*.dat
diff --git a/gnuradio-examples/python/multi-antenna/multi_fft.py b/gnuradio-examples/python/multi-antenna/multi_fft.py
deleted file mode 100755
index 544445860..000000000
--- a/gnuradio-examples/python/multi-antenna/multi_fft.py
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/usr/bin/env python
-
-from gnuradio import gr, gru, eng_notation
-from gnuradio import usrp
-from gnuradio.eng_option import eng_option
-from gnuradio import eng_notation
-from gnuradio import optfir
-from optparse import OptionParser
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
-import wx
-from usrpm import usrp_dbid
-import time
-import os.path
-import sys
-
-# required FPGA that can do 4 rx channels.
-
-
-class my_graph(stdgui2.std_top_block):
-
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser (option_class=eng_option)
- #parser.add_option("-S", "--subdev", type="subdev", default=(0, None),
- # help="select USRP Rx side A or B (default=A)")
- parser.add_option("-d", "--decim", type="int", default=128,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=146.585e6,
- help="set frequency to FREQ [default=%default])", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=20,
- help="set gain in dB [default=%default]")
- parser.add_option("-F", "--filter", action="store_true", default=True,
- help="Enable channel filter")
- (options, args) = parser.parse_args()
-
- if len(args) != 0:
- parser.print_help()
- raise SystemExit
-
- nchan = 4
-
- if options.filter:
- sw_decim = 4
- else:
- sw_decim = 1
-
- self.u = usrp.source_c(0, options.decim, fpga_filename="std_4rx_0tx.rbf")
- if self.u.nddcs() < nchan:
- sys.stderr.write('This code requires an FPGA build with %d DDCs. This FPGA has only %d.\n' % (
- nchan, self.u.nddcs()))
- raise SystemExit
-
- if not self.u.set_nchannels(nchan):
- sys.stderr.write('set_nchannels(%d) failed\n' % (nchan,))
- raise SystemExit
-
- input_rate = self.u.adc_freq() / self.u.decim_rate()
- print "USB data rate = %s" % (eng_notation.num_to_str(input_rate),)
- print "Scope data rate = %s" % (eng_notation.num_to_str(input_rate/sw_decim),)
-
- self.subdev = self.u.db(0) + self.u.db(1)
-
- if (len (self.subdev) < 4 or
- self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX or
- self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX):
- sys.stderr.write('This code requires a Basic Rx board on Sides A & B\n')
- sys.exit(1)
-
- self.u.set_mux(gru.hexint(0xf3f2f1f0))
-
- # deinterleave four channels from FPGA
- di = gr.deinterleave(gr.sizeof_gr_complex)
-
- self.connect(self.u, di)
-
-
-
- # taps for channel filter
- chan_filt_coeffs = optfir.low_pass (1, # gain
- input_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
-
- for i in range(nchan):
- scope = fftsink2.fft_sink_c(panel, sample_rate=input_rate/sw_decim,
- title="Input %d" % (i,),
- ref_level=80, y_per_div=20)
- vbox.Add(scope.win, 10, wx.EXPAND)
-
- if options.filter:
- chan_filt = gr.fir_filter_ccf(sw_decim, chan_filt_coeffs)
- self.connect((di, i), chan_filt, scope)
- else:
- self.connect((di, i), scope)
-
-
- self.set_gain(options.gain)
- self.set_freq(options.freq)
-
- def set_gain(self, gain):
- for i in range(len(self.subdev)):
- self.subdev[i].set_gain(gain)
-
- def set_freq(self, target_freq):
- ok = True
- for i in range(len(self.subdev)):
- r = usrp.tune(self.u, i, self.subdev[i], target_freq)
- if not r:
- ok = False
- print "set_freq: failed to set subdev[%d] freq to %f" % (
- i, target_freq)
-
- return ok
-
-
-def main ():
- app = stdgui2.stdapp(my_graph, "Multi Scope", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gnuradio-examples/python/usrp/.gitignore b/gnuradio-examples/python/usrp/.gitignore
deleted file mode 100644
index c400497f5..000000000
--- a/gnuradio-examples/python/usrp/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.pyc
-/*.pyo
diff --git a/gnuradio-examples/python/usrp/Makefile.am b/gnuradio-examples/python/usrp/Makefile.am
deleted file mode 100644
index 0ede005a0..000000000
--- a/gnuradio-examples/python/usrp/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright 2004,2005,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-ourdatadir = $(exampledir)/usrp
-
-dist_ourdata_SCRIPTS = \
- fm_tx_2_daughterboards.py \
- fm_tx4.py \
- max_power.py \
- test_dft_analysis.py \
- test_dft_synth.py \
- usrp_benchmark_usb.py \
- usrp_nbfm_ptt.py \
- usrp_nbfm_rcv.py \
- usrp_spectrum_sense.py \
- usrp_test_loop_lfsr.py \
- usrp_tv_rcv_nogui.py \
- usrp_tv_rcv.py \
- usrp_wfm_rcv.py \
- usrp_wfm_rcv_nogui.py \
- usrp_wfm_rcv_fmdet.py \
- usrp_wfm_rcv_pll.py \
- usrp_wfm_rcv_sca.py \
- usrp_wfm_rcv2_nogui.py \
- usrp_wxapt_rcv.py \
- usrp_am_mw_rcv.py
diff --git a/gnuradio-examples/python/usrp/max_power.py b/gnuradio-examples/python/usrp/max_power.py
deleted file mode 100755
index 91005e530..000000000
--- a/gnuradio-examples/python/usrp/max_power.py
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,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.
-#
-
-"""
-Setup USRP for maximum power consumption.
-"""
-
-
-from gnuradio import gr
-from gnuradio import usrp
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-def ramp_source ():
- period = 2**16
- src = gr.vector_source_s (range (-period/2, period/2, 1), True)
- return src
-
-def build_block (tx_enable, rx_enable):
- max_usb_rate = 8e6 # 8 MS/sec
- dac_freq = 128e6
- adc_freq = 64e6
-
- tx_nchan = 2
- tx_mux = 0x0000ba98
- tx_interp = int (dac_freq / (max_usb_rate/2 * tx_nchan)) # 16
-
- rx_nchan = 2
- rx_mux = 0x00003210
- rx_decim = int ((adc_freq * rx_nchan) / (max_usb_rate/2)) # 32
-
- tb = gr.top_block ()
-
- if tx_enable:
- tx_src0 = gr.sig_source_c (dac_freq/tx_interp, gr.GR_CONST_WAVE, 0, 16e3, 0)
- usrp_tx = usrp.sink_c (0, tx_interp, tx_nchan, tx_mux)
- usrp_tx.set_tx_freq (0, 10e6)
- usrp_tx.set_tx_freq (1, 9e6)
- tb.connect (tx_src0, usrp_tx)
-
- if rx_enable:
- usrp_rx = usrp.source_c (0, rx_decim, rx_nchan, rx_mux)
- usrp_rx.set_rx_freq (0, 5.5e6)
- usrp_rx.set_rx_freq (1, 6.5e6)
- rx_dst0 = gr.null_sink (gr.sizeof_gr_complex)
- tb.connect (usrp_rx, rx_dst0)
-
- return tb
-
-def main ():
- parser = OptionParser (option_class=eng_option)
- parser.add_option ("-t", action="store_true", dest="tx_enable",
- default=False, help="enable Tx path")
- parser.add_option ("-r", action="store_true", dest="rx_enable",
- default=False, help="enable Rx path")
- (options, args) = parser.parse_args ()
- tb = build_block (options.tx_enable, options.rx_enable)
-
- tb.start ()
- raw_input ('Press Enter to quit: ')
- tb.stop ()
-
-if __name__ == '__main__':
- main ()
diff --git a/gnuradio-examples/python/usrp/test_dft_analysis.py b/gnuradio-examples/python/usrp/test_dft_analysis.py
deleted file mode 100755
index 49db6bf2a..000000000
--- a/gnuradio-examples/python/usrp/test_dft_analysis.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-
-from gnuradio import gr, gru, blks2
-from gnuradio.wxgui import stdgui2, fftsink2, slider
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import wx
-
-class test_graph (stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- parser = OptionParser (option_class=eng_option)
- (options, args) = parser.parse_args ()
-
- sample_rate = 16e3
- mpoints = 4
- ampl = 1000
- freq = 0
-
- lo_freq = 1e6
- lo_ampl = 1
-
- vbox.Add(slider.slider(panel,
- -sample_rate/2, sample_rate/2,
- self.set_lo_freq), 0, wx.ALIGN_CENTER)
-
-
- src = gr.sig_source_c(sample_rate, gr.GR_CONST_WAVE,
- freq, ampl, 0)
-
- self.lo = gr.sig_source_c(sample_rate, gr.GR_SIN_WAVE,
- lo_freq, lo_ampl, 0)
-
- mixer = gr.multiply_cc()
- self.connect(src, (mixer, 0))
- self.connect(self.lo, (mixer, 1))
-
- # We add these throttle blocks so that this demo doesn't
- # suck down all the CPU available. Normally you wouldn't use these.
- thr = gr.throttle(gr.sizeof_gr_complex, sample_rate)
-
- taps = gr.firdes.low_pass(1, # gain
- 1, # rate
- 1.0/mpoints * 0.4, # cutoff
- 1.0/mpoints * 0.1, # trans width
- gr.firdes.WIN_HANN)
- print len(taps)
- analysis = blks2.analysis_filterbank(mpoints, taps)
-
- self.connect(mixer, thr)
- self.connect(thr, analysis)
-
- for i in range(mpoints):
- fft = fftsink2.fft_sink_c(frame, fft_size=128,
- sample_rate=sample_rate/mpoints,
- fft_rate=5,
- title="Ch %d" % (i,))
- self.connect((analysis, i), fft)
- vbox.Add(fft.win, 1, wx.EXPAND)
-
- def set_lo_freq(self, freq):
- self.lo.set_frequency(freq)
-
-
-
-def main ():
- app = stdgui2.stdapp (test_graph, "Test DFT filterbank")
- app.MainLoop ()
-
-if __name__ == '__main__':
- main ()
diff --git a/gnuradio-examples/python/usrp/test_dft_synth.py b/gnuradio-examples/python/usrp/test_dft_synth.py
deleted file mode 100755
index 99b1c4923..000000000
--- a/gnuradio-examples/python/usrp/test_dft_synth.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/env python
-
-from gnuradio import gr, gru, blks2
-from gnuradio.wxgui import stdgui2, fftsink2
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import wx
-import random
-
-
-def make_random_complex_tuple(L, gain=1):
- result = []
- for x in range(L):
- result.append(gain * complex(random.gauss(0, 1),random.gauss(0, 1)))
-
- return tuple(result)
-
-def random_noise_c(gain=1):
- src = gr.vector_source_c(make_random_complex_tuple(32*1024, gain), True)
- return src
-
-
-class test_graph (stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- parser = OptionParser (option_class=eng_option)
- (options, args) = parser.parse_args ()
-
- sample_rate = 16e6
- mpoints = 16
- ampl = 1000
-
- enable = mpoints/2 * [1, 0]
- enable[0] = 1
-
- taps = gr.firdes.low_pass(1, # gain
- 1, # rate
- 1.0/mpoints * 0.4, # cutoff
- 1.0/mpoints * 0.1, # trans width
- gr.firdes.WIN_HANN)
-
- synth = blks2.synthesis_filterbank(mpoints, taps)
-
- null_source = gr.null_source(gr.sizeof_gr_complex)
-
- if 1:
- for i in range(mpoints):
- s = gr.sig_source_c(sample_rate/mpoints, gr.GR_SIN_WAVE,
- 300e3, ampl * enable[i], 0)
- self.connect(s, (synth, i))
-
- else:
- for i in range(mpoints):
- if i == 1:
- #s = gr.sig_source_c(sample_rate/mpoints, gr.GR_SIN_WAVE,
- # 300e3, ampl * enable[i], 0)
- s = random_noise_c(ampl)
- self.connect(s, (synth, i))
- else:
- self.connect(null_source, (synth, i))
-
-
- # We add these throttle blocks so that this demo doesn't
- # suck down all the CPU available. Normally you wouldn't use these.
- thr = gr.throttle(gr.sizeof_gr_complex, sample_rate)
- fft = fftsink2.fft_sink_c(frame, fft_size=1024,sample_rate=sample_rate)
- vbox.Add(fft.win, 1, wx.EXPAND)
-
- self.connect(synth, thr, fft)
-
-
-def main ():
- app = stdgui2.stdapp (test_graph, "Test DFT filterbank")
- app.MainLoop ()
-
-if __name__ == '__main__':
- main ()
diff --git a/gnuradio-examples/python/usrp/usrp_benchmark_usb.py b/gnuradio-examples/python/usrp/usrp_benchmark_usb.py
deleted file mode 100755
index 4ea84f764..000000000
--- a/gnuradio-examples/python/usrp/usrp_benchmark_usb.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005 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.
-#
-
-"""
-Benchmark the USB/USRP throughput. Finds the maximum full-duplex speed
-the USRP/USB combination can sustain without errors.
-
-This program does not currently give reliable results. Sorry about that...
-"""
-
-from gnuradio import gr
-from gnuradio import usrp
-from gnuradio import eng_notation
-
-import sys
-
-def run_test (usb_throughput, verbose):
- # usb_throughput is in bytes/sec.
- #
- # Returns True or False
-
- nsec = 1
- stream_length = int (usb_throughput/2 * nsec) # length of stream to examine
-
- adc_freq = 64e6
- dac_freq = 128e6
- sizeof_sample = 2 * gr.sizeof_short
-
- usb_throughput_in_samples = usb_throughput / sizeof_sample
-
- # allocate usb throughput 50/50 between Tx and Rx
-
- tx_interp = int (dac_freq) / int (usb_throughput_in_samples / 2)
- rx_decim = int (adc_freq) / int (usb_throughput_in_samples / 2)
-
- # print "tx_interp =", tx_interp, "rx_decim =", rx_decim
- assert (tx_interp == 2 * rx_decim)
-
- tb = gr.top_block ()
-
- # Build the Tx pipeline
- data_src = gr.lfsr_32k_source_s ()
- src_head = gr.head (gr.sizeof_short, int (stream_length * 2))
- usrp_tx = usrp.sink_s (0, tx_interp)
- tb.connect (data_src, src_head, usrp_tx)
-
- # and the Rx pipeline
- usrp_rx = usrp.source_s (0, rx_decim, 1, 0x32103210, usrp.FPGA_MODE_LOOPBACK)
- head = gr.head (gr.sizeof_short, stream_length)
- check = gr.check_lfsr_32k_s ()
- tb.connect (usrp_rx, head, check)
-
- tb.run ()
-
- ntotal = check.ntotal ()
- nright = check.nright ()
- runlength = check.runlength ()
-
- if verbose:
- print "usb_throughput =", eng_notation.num_to_str (usb_throughput)
- print "ntotal =", ntotal
- print "nright =", nright
- print "runlength =", runlength
- print "delta =", ntotal - runlength
-
- return runlength >= stream_length - 80000
-
-def main ():
- verbose = True
- best_rate = 0
- usb_rate = [ 2e6, 4e6, 8e6, 16e6, 32e6 ]
- #usb_rate = [ 32e6, 32e6, 32e6, 32e6, 32e6 ]
- # usb_rate.reverse ()
- for rate in usb_rate:
- sys.stdout.write ("Testing %sB/sec... " % (eng_notation.num_to_str (rate)))
- sys.stdout.flush ()
- ok = run_test (rate, verbose)
- if ok:
- best_rate = max (best_rate, rate)
- sys.stdout.write ("OK\n")
- else:
- sys.stdout.write ("FAILED\n")
-
- print "Max USB/USRP throughput = %sB/sec" % (eng_notation.num_to_str (best_rate),)
-
-if __name__ == '__main__':
- main ()
diff --git a/gnuradio-examples/python/usrp/usrp_test_loop_lfsr.py b/gnuradio-examples/python/usrp/usrp_test_loop_lfsr.py
deleted file mode 100755
index 696c1a24c..000000000
--- a/gnuradio-examples/python/usrp/usrp_test_loop_lfsr.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,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.
-#
-
-"""
-Digital loopback (Tx to Rx) for the USRP Rev1.
-"""
-
-from gnuradio import gr
-from gnuradio import usrp
-
-
-def build_graph ():
- tx_interp = 32 # tx should be twice rx
- rx_decim = 16
-
- tb = gr.top_block ()
-
- data_src = gr.lfsr_32k_source_s ()
-
- # usrp_tx = usrp.sink_s (0, tx_interp, 1, 0x98)
- usrp_tx = usrp.sink_s (0, tx_interp)
-
- tb.connect (data_src, usrp_tx)
-
- usrp_rx = usrp.source_s (0, rx_decim, 1, 0x32103210, usrp.FPGA_MODE_LOOPBACK)
-
- sink = gr.check_lfsr_32k_s ()
- tb.connect (usrp_rx, sink)
-
- # file_sink = gr.file_sink (gr.sizeof_short, "loopback.dat")
- # tb.connect (usrp_rx, file_sink)
-
- return tb
-
-def main ():
- tb = build_graph ()
- try:
- tb.run()
- except KeyboardInterrupt:
- pass
-
-if __name__ == '__main__':
- main ()
diff --git a/gnuradio-examples/python/usrp/usrp_wfm_rcv2_nogui.py b/gnuradio-examples/python/usrp/usrp_wfm_rcv2_nogui.py
deleted file mode 100755
index edfbc3657..000000000
--- a/gnuradio-examples/python/usrp/usrp_wfm_rcv2_nogui.py
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,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.
-#
-
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-from usrpm import usrp_dbid
-import sys
-import math
-
-def calc_dxc_freq(target_freq, baseband_freq, fs):
- dxc_temp = (target_freq - baseband_freq) % fs
-
- if dxc_temp < fs/2.0:
- dxc_freq = - dxc_temp
- inverted = False
- else:
- dxc_freq = fs - dxc_temp
- inverted = True
-
- return (dxc_freq, inverted)
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
-
-class wfm_rx_block (gr.top_block):
-
- def __init__(self):
- gr.top_block.__init__(self)
-
- parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
- parser.add_option("", "--f1", type="eng_float", default=100.7e6,
- help="set 1st station frequency to FREQ", metavar="FREQ")
- parser.add_option("", "--f2", type="eng_float", default=102.5e6,
- help="set 2nd station freq to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=40,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-O", "--audio-output", type="string", default="",
- help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- if abs(options.f1) < 1e6:
- options.f1 *= 1e6
-
- if abs(options.f2) < 1e6:
- options.f2 *= 1e6
-
- if abs(options.f1 - options.f2) > 5.5e6:
- print "Sorry, two stations must be within 5.5MHz of each other"
- raise SystemExit
-
- f = (options.f1, options.f2)
-
- self.vol = .1
- self.state = "FREQ"
-
- # build graph
-
- self.u = usrp.source_c(0, nchan=2) # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = demod_rate / audio_decimation # 32 kHz
-
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- mv = usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec)
- mv |= (mv << 8) & 0xff00 # both DDC inputs setup same way
- self.u.set_mux(mv)
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-
-
- # deinterleave two channels from FPGA
- di = gr.deinterleave(gr.sizeof_gr_complex)
-
- # wire up the head of the chain
- self.connect(self.u, di)
-
- # sound card as final sink
- audio_sink = audio.sink(int(audio_rate), options.audio_output)
-
- # taps for channel filter
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
-
- mid_freq = (f[0] + f[1]) / 2
- # set front end PLL to middle frequency
- tune_result = self.subdev.set_freq(mid_freq)
-
- for n in range(2):
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
- guts = blks2.wfm_rcv (demod_rate, audio_decimation)
- volume_control = gr.multiply_const_ff(self.vol)
- self.connect((di, n), chan_filt)
- self.connect(chan_filt, guts, volume_control)
- self.connect(volume_control, (audio_sink, n))
- dxc_freq, inverted = calc_dxc_freq(f[n], tune_result.baseband_freq,
- self.u.converter_rate())
- self.u.set_rx_freq(n, dxc_freq)
-
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
-
-
- # set initial values
- self.set_gain(options.gain)
-
-
- def set_vol (self, vol):
- self.vol = vol
- self.volume_control.set_k(self.vol)
-
-
- def set_gain(self, gain):
- self.subdev.set_gain(gain)
-
- def __del__(self):
- # Avoid weak-reference error
- del self.subdev
-
-if __name__ == '__main__':
- tb = wfm_rx_block()
- try:
- tb.run()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/usrp/usrp_wfm_rcv_nogui.py b/gnuradio-examples/python/usrp/usrp_wfm_rcv_nogui.py
deleted file mode 100755
index 217f207c5..000000000
--- a/gnuradio-examples/python/usrp/usrp_wfm_rcv_nogui.py
+++ /dev/null
@@ -1,177 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,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.
-#
-
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-from usrpm import usrp_dbid
-import sys
-import math
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
-
-class wfm_rx_block (gr.top_block):
-
- def __init__(self):
- gr.top_block.__init__(self)
-
- parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
- parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-O", "--audio-output", type="string", default="",
- help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- self.vol = .1
- self.state = "FREQ"
- self.freq = 0
-
- # build graph
-
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = demod_rate / audio_decimation # 32 kHz
-
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-
-
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
-
- self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
-
- self.volume_control = gr.multiply_const_ff(self.vol)
-
- # sound card as final sink
- audio_sink = audio.sink(int(audio_rate),
- options.audio_output,
- False) # ok_to_block
-
- # now wire it all together
- self.connect (self.u, chan_filt, self.guts, self.volume_control, audio_sink)
-
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
-
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
-
- # set initial values
-
- self.set_gain(options.gain)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
- def set_vol (self, vol):
- self.vol = vol
- self.volume_control.set_k(self.vol)
- self.update_status_bar ()
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.tune(0, self.subdev, target_freq)
-
- if r:
- self.freq = target_freq
- self.update_status_bar()
- self._set_status_msg("OK", 0)
- return True
-
- self._set_status_msg("Failed", 0)
- return False
-
- def set_gain(self, gain):
- self.subdev.set_gain(gain)
-
- def update_status_bar (self):
- msg = "Freq: %s Volume:%f Setting:%s" % (
- eng_notation.num_to_str(self.freq), self.vol, self.state)
- self._set_status_msg(msg, 1)
-
- def _set_status_msg(self, msg, which=0):
- print msg
-
-
-if __name__ == '__main__':
- tb = wfm_rx_block()
- try:
- tb.run()
- except KeyboardInterrupt:
- pass
diff --git a/gnuradio-examples/python/usrp2/qt_wfm_interface.py b/gnuradio-examples/python/usrp2/qt_wfm_interface.py
deleted file mode 100644
index 4c4367ed0..000000000
--- a/gnuradio-examples/python/usrp2/qt_wfm_interface.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'qt_wfm_interface.ui'
-#
-# Created: Thu Jun 18 23:41:03 2009
-# by: PyQt4 UI code generator 4.4.3
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt4 import QtCore, QtGui
-
-class Ui_InterfaceWindow(object):
- def setupUi(self, InterfaceWindow):
- InterfaceWindow.setObjectName("InterfaceWindow")
- InterfaceWindow.resize(909, 711)
- self.centralwidget = QtGui.QWidget(InterfaceWindow)
- self.centralwidget.setObjectName("centralwidget")
- self.closeButton = QtGui.QPushButton(self.centralwidget)
- self.closeButton.setGeometry(QtCore.QRect(790, 580, 101, 31))
- self.closeButton.setObjectName("closeButton")
- self.sinkFrame = QtGui.QFrame(self.centralwidget)
- self.sinkFrame.setGeometry(QtCore.QRect(10, 10, 891, 501))
- self.sinkFrame.setFrameShape(QtGui.QFrame.StyledPanel)
- self.sinkFrame.setFrameShadow(QtGui.QFrame.Raised)
- self.sinkFrame.setObjectName("sinkFrame")
- self.horizontalLayoutWidget = QtGui.QWidget(self.sinkFrame)
- self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 871, 481))
- self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
- self.sinkLayout = QtGui.QHBoxLayout(self.horizontalLayoutWidget)
- self.sinkLayout.setObjectName("sinkLayout")
- self.channelModeBox = QtGui.QGroupBox(self.centralwidget)
- self.channelModeBox.setGeometry(QtCore.QRect(10, 520, 261, 131))
- self.channelModeBox.setObjectName("channelModeBox")
- self.bandwidthabel = QtGui.QLabel(self.channelModeBox)
- self.bandwidthabel.setGeometry(QtCore.QRect(10, 90, 101, 17))
- self.bandwidthabel.setObjectName("bandwidthabel")
- self.bandwidthEdit = QtGui.QLineEdit(self.channelModeBox)
- self.bandwidthEdit.setGeometry(QtCore.QRect(130, 90, 113, 23))
- self.bandwidthEdit.setObjectName("bandwidthEdit")
- self.gainEdit = QtGui.QLineEdit(self.channelModeBox)
- self.gainEdit.setGeometry(QtCore.QRect(130, 60, 113, 23))
- self.gainEdit.setObjectName("gainEdit")
- self.gainLabel = QtGui.QLabel(self.channelModeBox)
- self.gainLabel.setGeometry(QtCore.QRect(10, 60, 111, 20))
- self.gainLabel.setObjectName("gainLabel")
- self.freqEdit = QtGui.QLineEdit(self.channelModeBox)
- self.freqEdit.setGeometry(QtCore.QRect(130, 30, 113, 23))
- self.freqEdit.setObjectName("freqEdit")
- self.freqLabel = QtGui.QLabel(self.channelModeBox)
- self.freqLabel.setGeometry(QtCore.QRect(10, 30, 111, 17))
- self.freqLabel.setObjectName("freqLabel")
- self.pauseButton = QtGui.QPushButton(self.centralwidget)
- self.pauseButton.setGeometry(QtCore.QRect(790, 520, 101, 31))
- self.pauseButton.setObjectName("pauseButton")
- self.fmBox = QtGui.QGroupBox(self.centralwidget)
- self.fmBox.setGeometry(QtCore.QRect(290, 520, 251, 131))
- self.fmBox.setObjectName("fmBox")
- self.volumeEdit = QtGui.QLineEdit(self.fmBox)
- self.volumeEdit.setGeometry(QtCore.QRect(130, 20, 113, 23))
- self.volumeEdit.setObjectName("volumeEdit")
- self.volumeLabel = QtGui.QLabel(self.fmBox)
- self.volumeLabel.setGeometry(QtCore.QRect(10, 20, 111, 17))
- self.volumeLabel.setObjectName("volumeLabel")
- InterfaceWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtGui.QMenuBar(InterfaceWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 909, 24))
- self.menubar.setObjectName("menubar")
- self.menuFile = QtGui.QMenu(self.menubar)
- self.menuFile.setObjectName("menuFile")
- InterfaceWindow.setMenuBar(self.menubar)
- self.statusbar = QtGui.QStatusBar(InterfaceWindow)
- self.statusbar.setObjectName("statusbar")
- InterfaceWindow.setStatusBar(self.statusbar)
- self.actionExit = QtGui.QAction(InterfaceWindow)
- self.actionExit.setObjectName("actionExit")
- self.menuFile.addAction(self.actionExit)
- self.menubar.addAction(self.menuFile.menuAction())
-
- self.retranslateUi(InterfaceWindow)
- QtCore.QObject.connect(self.closeButton, QtCore.SIGNAL("clicked()"), InterfaceWindow.close)
- QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), InterfaceWindow.close)
- QtCore.QMetaObject.connectSlotsByName(InterfaceWindow)
- InterfaceWindow.setTabOrder(self.closeButton, self.gainEdit)
- InterfaceWindow.setTabOrder(self.gainEdit, self.freqEdit)
- InterfaceWindow.setTabOrder(self.freqEdit, self.bandwidthEdit)
-
- def retranslateUi(self, InterfaceWindow):
- InterfaceWindow.setWindowTitle(QtGui.QApplication.translate("InterfaceWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
- self.closeButton.setText(QtGui.QApplication.translate("InterfaceWindow", "Close", None, QtGui.QApplication.UnicodeUTF8))
- self.channelModeBox.setTitle(QtGui.QApplication.translate("InterfaceWindow", "USRP Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.bandwidthabel.setText(QtGui.QApplication.translate("InterfaceWindow", "Bandwidth (Hz)", None, QtGui.QApplication.UnicodeUTF8))
- self.gainLabel.setText(QtGui.QApplication.translate("InterfaceWindow", "Gain (dB)", None, QtGui.QApplication.UnicodeUTF8))
- self.freqLabel.setText(QtGui.QApplication.translate("InterfaceWindow", "Frequency", None, QtGui.QApplication.UnicodeUTF8))
- self.pauseButton.setText(QtGui.QApplication.translate("InterfaceWindow", "Pause", None, QtGui.QApplication.UnicodeUTF8))
- self.fmBox.setTitle(QtGui.QApplication.translate("InterfaceWindow", "FM Tuner Parameters", None, QtGui.QApplication.UnicodeUTF8))
- self.volumeLabel.setText(QtGui.QApplication.translate("InterfaceWindow", "Volume", None, QtGui.QApplication.UnicodeUTF8))
- self.menuFile.setTitle(QtGui.QApplication.translate("InterfaceWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
- self.actionExit.setText(QtGui.QApplication.translate("InterfaceWindow", "E&xit", None, QtGui.QApplication.UnicodeUTF8))
-
diff --git a/gnuradio-examples/python/usrp2/qt_wfm_interface.ui b/gnuradio-examples/python/usrp2/qt_wfm_interface.ui
deleted file mode 100644
index 16902d9f4..000000000
--- a/gnuradio-examples/python/usrp2/qt_wfm_interface.ui
+++ /dev/null
@@ -1,253 +0,0 @@
-<ui version="4.0" >
- <class>InterfaceWindow</class>
- <widget class="QMainWindow" name="InterfaceWindow" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>909</width>
- <height>711</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget" >
- <widget class="QPushButton" name="closeButton" >
- <property name="geometry" >
- <rect>
- <x>790</x>
- <y>580</y>
- <width>101</width>
- <height>31</height>
- </rect>
- </property>
- <property name="text" >
- <string>Close</string>
- </property>
- </widget>
- <widget class="QFrame" name="sinkFrame" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>10</y>
- <width>891</width>
- <height>501</height>
- </rect>
- </property>
- <property name="frameShape" >
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Raised</enum>
- </property>
- <widget class="QWidget" name="horizontalLayoutWidget" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>10</y>
- <width>871</width>
- <height>481</height>
- </rect>
- </property>
- <layout class="QHBoxLayout" name="sinkLayout" />
- </widget>
- </widget>
- <widget class="QGroupBox" name="channelModeBox" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>520</y>
- <width>261</width>
- <height>131</height>
- </rect>
- </property>
- <property name="title" >
- <string>USRP Parameters</string>
- </property>
- <widget class="QLabel" name="bandwidthabel" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>90</y>
- <width>101</width>
- <height>17</height>
- </rect>
- </property>
- <property name="text" >
- <string>Bandwidth (Hz)</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="bandwidthEdit" >
- <property name="geometry" >
- <rect>
- <x>130</x>
- <y>90</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLineEdit" name="gainEdit" >
- <property name="geometry" >
- <rect>
- <x>130</x>
- <y>60</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="gainLabel" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>60</y>
- <width>111</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Gain (dB)</string>
- </property>
- </widget>
- <widget class="QLineEdit" name="freqEdit" >
- <property name="geometry" >
- <rect>
- <x>130</x>
- <y>30</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="freqLabel" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>30</y>
- <width>111</width>
- <height>17</height>
- </rect>
- </property>
- <property name="text" >
- <string>Frequency</string>
- </property>
- </widget>
- </widget>
- <widget class="QPushButton" name="pauseButton" >
- <property name="geometry" >
- <rect>
- <x>790</x>
- <y>520</y>
- <width>101</width>
- <height>31</height>
- </rect>
- </property>
- <property name="text" >
- <string>Pause</string>
- </property>
- </widget>
- <widget class="QGroupBox" name="fmBox" >
- <property name="geometry" >
- <rect>
- <x>290</x>
- <y>520</y>
- <width>251</width>
- <height>131</height>
- </rect>
- </property>
- <property name="title" >
- <string>FM Tuner Parameters</string>
- </property>
- <widget class="QLineEdit" name="volumeEdit" >
- <property name="geometry" >
- <rect>
- <x>130</x>
- <y>20</y>
- <width>113</width>
- <height>23</height>
- </rect>
- </property>
- </widget>
- <widget class="QLabel" name="volumeLabel" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>111</width>
- <height>17</height>
- </rect>
- </property>
- <property name="text" >
- <string>Volume</string>
- </property>
- </widget>
- </widget>
- </widget>
- <widget class="QMenuBar" name="menubar" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>909</width>
- <height>24</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>closeButton</tabstop>
- <tabstop>gainEdit</tabstop>
- <tabstop>freqEdit</tabstop>
- <tabstop>bandwidthEdit</tabstop>
- </tabstops>
- <resources/>
- <connections>
- <connection>
- <sender>closeButton</sender>
- <signal>clicked()</signal>
- <receiver>InterfaceWindow</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>InterfaceWindow</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/gnuradio-examples/python/usrp2/usrp2_wfm_qt.py b/gnuradio-examples/python/usrp2/usrp2_wfm_qt.py
deleted file mode 100755
index 0c7476921..000000000
--- a/gnuradio-examples/python/usrp2/usrp2_wfm_qt.py
+++ /dev/null
@@ -1,355 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,2007,2008,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, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp2
-from gnuradio import blks2
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import sys
-import math
-
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Please install gr-qtgui."
- sys.exit(1)
-
-try:
- from qt_wfm_interface import Ui_InterfaceWindow
-except ImportError:
- print "Error: could not find qt_wfm_interface.py:"
- print "\tPlease run: \"pyuic4 qt_wfm_interface.ui -o qt_wfm_interface.py\""
- sys.exit(1)
-
-print "This program is not in a proper working state. Comment this out if you want to play."
-sys.exit(1)
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-class dialog_box(QtGui.QMainWindow):
- def __init__(self, snk_usrp, snk_vol, fg, parent=None):
-
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_InterfaceWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- # Set USRP parameters
- self.set_bw(self.fg.usrp_bw())
- self.set_freq(self.fg.freq())
- self.set_gain(self.fg.gain())
- self.set_volume(self.fg.volume())
-
- # Add the qtsnk widgets to the hlayout box
- self.gui.sinkLayout.addWidget(snk_usrp)
- self.gui.sinkLayout.addWidget(snk_vol)
-
-
- # Connect up some signals
- self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
- self.pauseFg)
-
- self.connect(self.gui.bandwidthEdit, QtCore.SIGNAL("editingFinished()"),
- self.bwEditText)
- self.connect(self.gui.freqEdit, QtCore.SIGNAL("editingFinished()"),
- self.freqEditText)
- self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainEditText)
-
- self.connect(self.gui.volumeEdit, QtCore.SIGNAL("editingFinished()"),
- self.volumeEditText)
-
-
- 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 USRP
- def set_bw(self, bw):
- self.gui.bandwidthEdit.setText(QtCore.QString("%1").arg(bw))
-
- def set_freq(self, freq):
- self.gui.freqEdit.setText(QtCore.QString("%1").arg(freq))
-
- def set_gain(self, gain):
- self.gui.gainEdit.setText(QtCore.QString("%1").arg(gain))
-
- def set_volume(self, vol):
- self.gui.volumeEdit.setText(QtCore.QString("%1").arg(vol))
-
- def bwEditText(self):
- try:
- bw = self.gui.bandwidthEdit.text().toDouble()[0]
- self.fg.set_usrp_bw(bw)
- except RuntimeError:
- pass
-
- def freqEditText(self):
- try:
- freq = self.gui.freqEdit.text().toDouble()[0]
- self.fg.set_freq(freq)
- except RuntimeError:
- pass
-
- def gainEditText(self):
- try:
- gain = self.gui.gainEdit.text().toDouble()[0]
- self.fg.set_gain(gain)
- except RuntimeError:
- pass
-
- def volumeEditText(self):
- try:
- vol = self.gui.volumeEdit.text().toDouble()[0]
- self.fg.set_volume(vol)
- except RuntimeError:
- pass
-
-
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the GNU Radio Top Block
-# ////////////////////////////////////////////////////////////////////
-
-
-class wfm_rx_block (gr.top_block):
- def __init__(self):
- gr.top_block.__init__(self)
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-e", "--interface", type="string", default="eth0",
- help="select Ethernet interface, default is eth0")
- parser.add_option("-m", "--mac-addr", type="string", default="",
- help="select USRP by MAC address, default is auto-select")
- #parser.add_option("-A", "--antenna", default=None,
- # help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-f", "--freq", type="eng_float", default=100.1,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-V", "--volume", type="eng_float", default=None,
- help="set volume (default is midpoint)")
- parser.add_option("-O", "--audio-output", type="string", default="",
- help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- self._volume = options.volume
- self._usrp_freq = options.freq
- self._usrp_gain = options.gain
- self._audio_rate = int(32e3)
-
- # build graph
-
- self.u = usrp2.source_32fc(options.interface, options.mac_addr)
-
- # calculate decimation values to get USRP BW at 320 kHz
- self.calculate_usrp_bw(320e3)
-
- self.set_decim(self._usrp_decim)
-
- #FIXME: need named constants and text descriptions available to (gr-)usrp2 even
- #when usrp(1) module is not built. A usrp_common module, perhaps?
- dbid = self.u.daughterboard_id()
- print "Using RX d'board 0x%04X" % (dbid,)
- #if not (dbid == 0x0001 or #usrp_dbid.BASIC_RX
- # dbid == 0x0003 or #usrp_dbid.TV_RX
- # dbid == 0x000c or #usrp_dbid.TV_RX_REV_2
- # dbid == 0x0040 or #usrp_dbid.TV_RX_REV_3
- # dbid == 0x0043 or #usrp_dbid.TV_RX_MIMO
- # dbid == 0x0044 or #usrp_dbid.TV_RX_REV_2_MIMO
- # dbid == 0x0045 ): #usrp_dbid.TV_RX_REV_3_MIMO
- # print "This daughterboard does not cover the required frequency range"
- # print "for this application. Please use a BasicRX or TVRX daughterboard."
- # raw_input("Press ENTER to continue anyway, or Ctrl-C to exit.")
-
- chan_filt_coeffs = optfir.low_pass (1, # gain
- self._usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (self._chanfilt_decim, chan_filt_coeffs)
-
- self.guts = blks2.wfm_rcv (self._demod_rate, self._audio_decim)
-
- self.volume_control = gr.multiply_const_ff(1)
-
- # sound card as final sink
- #audio_sink = audio.sink (int (audio_rate),
- # options.audio_output,
- # False) # ok_to_block
- audio_sink = audio.sink (self._audio_rate,
- options.audio_output)
-
-
- if self._usrp_gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.u.gain_range()
- print "Gain range: ", g
- self._usrp_gain = float(g[0]+g[1])/2
-
- if self._volume is None:
- g = self.volume_range()
- self._volume = float(g[0]+g[1])/2
-
- if abs(self._usrp_freq) < 1e6:
- self._usrp_freq *= 1e6
-
- # set initial values
- self.set_gain(self._usrp_gain)
- self.set_volume(self._volume)
- if not(self.set_freq(self._usrp_freq)):
- print ("Failed to set initial frequency")
-
-
- # Define a GUI sink to display the received signal
- self.qapp = QtGui.QApplication(sys.argv)
- fftsize = 2048
-
- self.usrp_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- -self._usrp_rate/2.0, self._usrp_rate/2.0,
- "Received Signal", True, True, False, True, False,
- use_openGL=False)
- self.usrp_rx2 = qtgui.sink_f(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- -self._usrp_rate/2.0, self._usrp_rate/2.0,
- "Received Signal", True, True, False, True, False)
-
- # now wire it all together
- self.connect (self.u, chan_filt, self.guts, self.volume_control, audio_sink)
- self.connect (self.u, self.usrp_rx)
- self.connect (self.volume_control, self.usrp_rx2)
-
- usrp_rx_widget = sip.wrapinstance(self.usrp_rx.pyqwidget(), QtGui.QWidget)
- usrp_rx2_widget = sip.wrapinstance(self.usrp_rx2.pyqwidget(), QtGui.QWidget)
-
- self.main_box = dialog_box(usrp_rx_widget, usrp_rx2_widget, self)
- self.main_box.show()
-
-
- def calculate_usrp_bw(self, bw):
- """
- Calculate the different decimation rates that make the USRP BW equal to the
- input bandwidth parameter 'bw' and the audio bandwidth equal to the system-
- wide bandwidth 'self._audio_rate'
- """
-
- adc_rate = self.u.adc_rate()
- d_usrp = int(adc_rate/bw)
- bw_real = adc_rate / float(d_usrp)
-
- d_chan = 1
- demod_rate = bw_real / d_chan
-
- d_audio = int(bw_real / self._audio_rate)
- audio_rate = demod_rate / d_audio
-
- self._usrp_decim = d_usrp
- self._chanfilt_decim = d_chan
- self._audio_decim = d_audio
- self._demod_rate = demod_rate
- self._usrp_rate = bw_real
-
- print "USRP Decimation: ", self._usrp_decim
- print "USRP Bandwidth: ", bw_real
- print "Audio Decimation: ", self._audio_decim
- print "Audio Bandwidth: ", audio_rate
-
- def set_volume (self, vol):
- g = self.volume_range()
- self._volume = max(g[0], min(g[1], vol))
- self.volume_control.set_k(10**(self._volume/10))
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.set_center_freq(target_freq)
- if r:
- self._usrp_freq = target_freq
- return True
- return False
-
- def set_usrp_bw(self, bw):
- self.calculate_usrp_bw(bw)
-
- def set_gain(self, gain):
- self._usrp_gain = gain
- self.u.set_gain(gain)
-
- def set_decim(self, decim):
- self._usrp_decim = int(decim)
- self.u.set_decim(self._usrp_decim)
-
- def volume(self):
- return self._volume
-
- def freq(self):
- return self._usrp_freq
-
- def usrp_bw(self):
- return self._usrp_rate
-
- def gain(self):
- return self._usrp_gain
-
- def decim(self):
- return self._usrp_decim
-
- def volume_range(self):
- return (-20.0, 0.0, 0.5)
-
-
-if __name__ == '__main__':
- tb = wfm_rx_block()
- tb.start()
- tb.qapp.exec_()
-
diff --git a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py b/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
deleted file mode 100755
index 2b94c458e..000000000
--- a/gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py
+++ /dev/null
@@ -1,289 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,2007,2008,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, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp2
-from gnuradio import blks2
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import slider, powermate
-from gnuradio.wxgui import stdgui2, fftsink2, form
-from optparse import OptionParser
-import sys
-import math
-import wx
-
-class wfm_rx_block (stdgui2.std_top_block):
- def __init__(self,frame,panel,vbox,argv):
- stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-e", "--interface", type="string", default="eth0",
- help="select Ethernet interface, default is eth0")
- parser.add_option("-m", "--mac-addr", type="string", default="",
- help="select USRP by MAC address, default is auto-select")
- #parser.add_option("-A", "--antenna", default=None,
- # help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-f", "--freq", type="eng_float", default=100.1,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-V", "--volume", type="eng_float", default=None,
- help="set volume (default is midpoint)")
- parser.add_option("-O", "--audio-output", type="string", default="",
- help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- self.frame = frame
- self.panel = panel
-
- self.vol = 0
- self.state = "FREQ"
- self.freq = 0
-
- # build graph
-
- self.u = usrp2.source_32fc(options.interface, options.mac_addr)
-
- adc_rate = self.u.adc_rate() # 100 MS/s
- usrp_decim = 312
- self.u.set_decim(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # ~320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = demod_rate / audio_decimation # ~32 kHz
-
- #FIXME: need named constants and text descriptions available to (gr-)usrp2 even
- #when usrp(1) module is not built. A usrp_common module, perhaps?
- dbid = self.u.daughterboard_id()
- print "Using RX d'board 0x%04X" % (dbid,)
- if not (dbid == 0x0001 or #usrp_dbid.BASIC_RX
- dbid == 0x0003 or #usrp_dbid.TV_RX
- dbid == 0x000c or #usrp_dbid.TV_RX_REV_2
- dbid == 0x0040 or #usrp_dbid.TV_RX_REV_3
- dbid == 0x0043 or #usrp_dbid.TV_RX_MIMO
- dbid == 0x0044 or #usrp_dbid.TV_RX_REV_2_MIMO
- dbid == 0x0045 or #usrp_dbid.TV_RX_REV_3_MIMO
- dbid == 0x0053 ): #usrp_dbid.WBX
- print "This daughterboard does not cover the required frequency range"
- print "for this application. Please use a BasicRX or TVRX daughterboard."
- raw_input("Press ENTER to continue anyway, or Ctrl-C to exit.")
-
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
-
- self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
-
- self.volume_control = gr.multiply_const_ff(self.vol)
-
- # sound card as final sink
- audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
-
- # now wire it all together
- self.connect (self.u, chan_filt, self.guts, self.volume_control, audio_sink)
-
- self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.u.gain_range()
- options.gain = float(g[0]+g[1])/2
-
- if options.volume is None:
- g = self.volume_range()
- options.volume = float(g[0]+g[1])/2
-
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
-
- # set initial values
-
- self.set_gain(options.gain)
- self.set_vol(options.volume)
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
-
- def _set_status_msg(self, msg, which=0):
- self.frame.GetStatusBar().SetStatusText(msg, which)
-
-
- def _build_gui(self, vbox, usrp_rate, demod_rate, audio_rate):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
-
- if 1:
- self.src_fft = fftsink2.fft_sink_c(self.panel, title="Data from USRP2",
- fft_size=512, sample_rate=usrp_rate,
- ref_scale=1.0, ref_level=0, y_divs=12)
- self.connect (self.u, self.src_fft)
- vbox.Add (self.src_fft.win, 4, wx.EXPAND)
-
- if 1:
- post_filt_fft = fftsink2.fft_sink_f(self.panel, title="Post Demod",
- fft_size=1024, sample_rate=usrp_rate,
- y_per_div=10, ref_level=0)
- self.connect (self.guts.fm_demod, post_filt_fft)
- vbox.Add (post_filt_fft.win, 4, wx.EXPAND)
-
- if 0:
- post_deemph_fft = fftsink2.fft_sink_f(self.panel, title="Post Deemph",
- fft_size=512, sample_rate=audio_rate,
- y_per_div=10, ref_level=-20)
- self.connect (self.guts.deemph, post_deemph_fft)
- vbox.Add (post_deemph_fft.win, 4, wx.EXPAND)
-
-
- # control area form at bottom
- self.myform = myform = form.form()
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0)
- myform['freq_slider'] = \
- form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(87.9e6, 108.1e6, 0.1e6),
- callback=self.set_freq)
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['volume'] = \
- form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Volume",
- weight=3, range=self.volume_range(),
- callback=self.set_vol)
- hbox.Add((5,0), 1)
-
- myform['gain'] = \
- form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.u.gain_range(),
- callback=self.set_gain)
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- try:
- self.knob = powermate.powermate(self.frame)
- self.rot = 0
- powermate.EVT_POWERMATE_ROTATE (self.frame, self.on_rotate)
- powermate.EVT_POWERMATE_BUTTON (self.frame, self.on_button)
- except:
- pass
- #print "FYI: No Powermate or Contour Knob found"
-
-
- def on_rotate (self, event):
- self.rot += event.delta
- if (self.state == "FREQ"):
- if self.rot >= 3:
- self.set_freq(self.freq + .1e6)
- self.rot -= 3
- elif self.rot <=-3:
- self.set_freq(self.freq - .1e6)
- self.rot += 3
- else:
- step = self.volume_range()[2]
- if self.rot >= 3:
- self.set_vol(self.vol + step)
- self.rot -= 3
- elif self.rot <=-3:
- self.set_vol(self.vol - step)
- self.rot += 3
-
- def on_button (self, event):
- if event.value == 0: # button up
- return
- self.rot = 0
- if self.state == "FREQ":
- self.state = "VOL"
- else:
- self.state = "FREQ"
- self.update_status_bar ()
-
-
- def set_vol (self, vol):
- g = self.volume_range()
- self.vol = max(g[0], min(g[1], vol))
- self.volume_control.set_k(10**(self.vol/10))
- self.myform['volume'].set_value(self.vol)
- self.update_status_bar ()
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.set_center_freq(target_freq)
- if r:
- self.freq = target_freq
- self.myform['freq'].set_value(target_freq) # update displayed value
- self.myform['freq_slider'].set_value(target_freq) # update displayed value
- self.update_status_bar()
- self._set_status_msg("OK", 0)
- return True
-
- self._set_status_msg("Failed", 0)
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- self.u.set_gain(gain)
-
- def update_status_bar (self):
- msg = "Volume:%r Setting:%s" % (self.vol, self.state)
- self._set_status_msg(msg, 1)
- self.src_fft.set_baseband_freq(self.freq)
-
- def volume_range(self):
- return (-20.0, 0.0, 0.5)
-
-
-if __name__ == '__main__':
- app = stdgui2.stdapp (wfm_rx_block, "USRP2 WFM RX")
- app.MainLoop ()
diff --git a/gr-atsc/src/lib/Makefile.swig.gen b/gr-atsc/src/lib/Makefile.swig.gen
index 7dbb98b46..67f9c094a 100644
--- a/gr-atsc/src/lib/Makefile.swig.gen
+++ b/gr-atsc/src/lib/Makefile.swig.gen
@@ -105,7 +105,7 @@ _atsc_la_CXXFLAGS = \
$(atsc_la_swig_cxxflags)
python/atsc.cc: atsc.py
-atsc.py: atsc.i
+atsc.py: atsc.i
# Include the python dependencies for this file
-include python/atsc.d
diff --git a/gr-audio/Makefile.am b/gr-audio/Makefile.am
index cde1702f2..da4106c23 100644
--- a/gr-audio/Makefile.am
+++ b/gr-audio/Makefile.am
@@ -21,7 +21,7 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = include lib examples
+SUBDIRS = include lib examples doc
if PYTHON
SUBDIRS += grc swig
diff --git a/gcell/include/gcell/.gitignore b/gr-audio/doc/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gcell/include/gcell/.gitignore
+++ b/gr-audio/doc/.gitignore
diff --git a/gr-radar-mono/src/fpga/Makefile.am b/gr-audio/doc/Makefile.am
index fb2a09c9c..959a9044f 100644
--- a/gr-radar-mono/src/fpga/Makefile.am
+++ b/gr-audio/doc/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,4 +21,7 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = lib top tb models
+SUBDIRS =
+
+dist_gr_doc_DATA = \
+ README.audio
diff --git a/gr-audio/doc/README.audio b/gr-audio/doc/README.audio
new file mode 100644
index 000000000..ebd0fe5d7
--- /dev/null
+++ b/gr-audio/doc/README.audio
@@ -0,0 +1,20 @@
+This is the gr-audio package. This package includes all of the
+supported audio interfaces, including:
+ - alsa
+ - oss
+ - jack
+ - portaudio
+ - osx
+ - windows
+
+Typically, the audio package will auto-detect the proper driver to use
+based on the system it is run on. Import this package with:
+
+ from gnuradio import audio
+
+See the Doxygen documentation for details about the blocks available
+in this package. A quick listing of the details can be found in Python
+after importing by using:
+
+ help(audio)
+
diff --git a/gr-audio/doc/audio.dox b/gr-audio/doc/audio.dox
new file mode 100644
index 000000000..3a0cb5e48
--- /dev/null
+++ b/gr-audio/doc/audio.dox
@@ -0,0 +1,51 @@
+/*! \page page_audio Audio Interface
+
+\section Introduction
+
+This is the gr-audio package. This package includes all of the
+supported audio interfaces, including:
+
+\li alsa
+\li oss
+\li jack
+\li portaudio
+\li osx
+\li windows
+
+\code
+ from gnuradio import audio
+\endcode
+
+See the Doxygen documentation for details about the blocks available
+in this package. The relevant blocks are listed in the \ref audio_blk group.
+
+A quick listing of the details can be found in Python after importing
+by using:
+
+\code
+ help(digital)
+\endcode
+
+
+\section Usage
+For an audio source, a typical OptionParser option and it's use looks
+like:
+
+\code
+ parser.add_option("-O", "--audio-output", type="string", 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
+its use would look like:
+
+\code
+ parser.add_option("-I", "--audio-input", type="string", 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)
+\endcode
+
+*/
diff --git a/gr-audio/include/gr_audio_sink.h b/gr-audio/include/gr_audio_sink.h
index ca3b15a37..ec064b64b 100644
--- a/gr-audio/include/gr_audio_sink.h
+++ b/gr-audio/include/gr_audio_sink.h
@@ -25,6 +25,19 @@
#include <gr_audio_api.h>
#include <gr_sync_block.h>
+/*!
+ * \brief Creates a sink from an audio device.
+ * \ingroup audio_blk
+ *
+ * Creates a sink from an audio device at a specified
+ * sample_rate. The specific audio device to use can be specified as
+ * the device_name parameter. Typical choices are:
+ * \li pulse
+ * \li hw:0,0
+ * \li plughw:0,0
+ * \li surround51
+ * \li /dev/dsp
+ */
class GR_AUDIO_API audio_sink : virtual public gr_sync_block{
public:
typedef boost::shared_ptr<audio_sink> sptr;
diff --git a/gr-audio/include/gr_audio_source.h b/gr-audio/include/gr_audio_source.h
index b8ae2ca5f..eca22e3eb 100644
--- a/gr-audio/include/gr_audio_source.h
+++ b/gr-audio/include/gr_audio_source.h
@@ -25,6 +25,19 @@
#include <gr_audio_api.h>
#include <gr_sync_block.h>
+/*!
+ * \brief Creates a source from an audio device.
+ * \ingroup audio_blk
+ *
+ * Creates a source from an audio device at a specified
+ * sample_rate. The specific audio device to use can be specified as
+ * the device_name parameter. Typical choices are:
+ * \li pulse
+ * \li hw:0,0
+ * \li plughw:0,0
+ * \li surround51
+ * \li /dev/dsp
+ */
class GR_AUDIO_API audio_source : virtual public gr_sync_block{
public:
typedef boost::shared_ptr<audio_source> sptr;
diff --git a/gr-audio/lib/alsa/audio_alsa_sink.h b/gr-audio/lib/alsa/audio_alsa_sink.h
index 23e406d6b..b33b84644 100644
--- a/gr-audio/lib/alsa/audio_alsa_sink.h
+++ b/gr-audio/lib/alsa/audio_alsa_sink.h
@@ -34,6 +34,7 @@
/*!
* \brief audio sink using ALSA
+ * \ingroup audio_blk
*
* The sink has N input streams of floats, where N depends
* on the hardware characteristics of the selected device.
diff --git a/gr-audio/lib/alsa/audio_alsa_source.h b/gr-audio/lib/alsa/audio_alsa_source.h
index e38af3872..142ae711a 100644
--- a/gr-audio/lib/alsa/audio_alsa_source.h
+++ b/gr-audio/lib/alsa/audio_alsa_source.h
@@ -37,6 +37,7 @@ typedef boost::shared_ptr<audio_alsa_source> audio_alsa_source_sptr;
/*!
* \brief audio source using ALSA
+ * \ingroup audio_blk
*
* The source has between 1 and N input streams of floats, where N is
* depends on the hardware characteristics of the selected device.
diff --git a/gr-audio/lib/jack/audio_jack_sink.h b/gr-audio/lib/jack/audio_jack_sink.h
index a11863ee0..5500b3641 100644
--- a/gr-audio/lib/jack/audio_jack_sink.h
+++ b/gr-audio/lib/jack/audio_jack_sink.h
@@ -32,6 +32,7 @@ int jack_sink_process (jack_nframes_t nframes, void *arg);
/*!
* \brief audio sink using JACK
+ * \ingroup audio_blk
*
* The sink has one input stream of floats.
*
diff --git a/gr-audio/lib/jack/audio_jack_source.h b/gr-audio/lib/jack/audio_jack_source.h
index 858f34528..a155bf95b 100644
--- a/gr-audio/lib/jack/audio_jack_source.h
+++ b/gr-audio/lib/jack/audio_jack_source.h
@@ -32,6 +32,7 @@ int jack_source_process (jack_nframes_t nframes, void *arg);
/*!
* \brief audio source using JACK
+ * \ingroup audio_blk
*
* The source has one input stream of floats.
*
diff --git a/gr-audio/lib/oss/audio_oss_sink.h b/gr-audio/lib/oss/audio_oss_sink.h
index 0d7280c2f..47b1407d3 100644
--- a/gr-audio/lib/oss/audio_oss_sink.h
+++ b/gr-audio/lib/oss/audio_oss_sink.h
@@ -28,6 +28,7 @@
/*!
* \brief audio sink using OSS
+ * \ingroup audio_blk
*
* input signature is one or two streams of floats.
* Input samples must be in the range [-1,1].
diff --git a/gr-audio/lib/oss/audio_oss_source.h b/gr-audio/lib/oss/audio_oss_source.h
index b20ef5c05..df9f68e42 100644
--- a/gr-audio/lib/oss/audio_oss_source.h
+++ b/gr-audio/lib/oss/audio_oss_source.h
@@ -28,6 +28,7 @@
/*!
* \brief audio source using OSS
+ * \ingroup audio_blk
*
* Output signature is one or two streams of floats.
* Output samples will be in the range [-1,1].
diff --git a/gr-audio/lib/osx/audio_osx_sink.h b/gr-audio/lib/osx/audio_osx_sink.h
index 13bd95d53..e7598097d 100644
--- a/gr-audio/lib/osx/audio_osx_sink.h
+++ b/gr-audio/lib/osx/audio_osx_sink.h
@@ -31,6 +31,7 @@
/*!
* \brief audio sink using OSX
+ * \ingroup audio_blk
*
* input signature is one or two streams of floats.
* Input samples must be in the range [-1,1].
diff --git a/gr-audio/lib/osx/audio_osx_source.h b/gr-audio/lib/osx/audio_osx_source.h
index a373ea94f..435172a2c 100644
--- a/gr-audio/lib/osx/audio_osx_source.h
+++ b/gr-audio/lib/osx/audio_osx_source.h
@@ -31,6 +31,7 @@
/*!
* \brief audio source using OSX
+ * \ingroup audio_blk
*
* Input signature is one or two streams of floats.
* Samples must be in the range [-1,1].
diff --git a/gr-audio/lib/portaudio/audio_portaudio_sink.h b/gr-audio/lib/portaudio/audio_portaudio_sink.h
index 6426a32ac..04a881f7e 100644
--- a/gr-audio/lib/portaudio/audio_portaudio_sink.h
+++ b/gr-audio/lib/portaudio/audio_portaudio_sink.h
@@ -34,7 +34,8 @@ PaStreamCallback portaudio_sink_callback;
/*!
- * \ Audio sink using PORTAUDIO
+ * \brief Audio sink using PORTAUDIO
+ * \ingroup audio_blk
*
* Input samples must be in the range [-1,1].
*/
diff --git a/gr-audio/lib/portaudio/audio_portaudio_source.h b/gr-audio/lib/portaudio/audio_portaudio_source.h
index 245b3410b..b555bc759 100644
--- a/gr-audio/lib/portaudio/audio_portaudio_source.h
+++ b/gr-audio/lib/portaudio/audio_portaudio_source.h
@@ -33,7 +33,8 @@ PaStreamCallback portaudio_source_callback;
/*!
- * \ Audio source using PORTAUDIO
+ * \brief Audio source using PORTAUDIO
+ * \ingroup audio_blk
*
* Input samples must be in the range [-1,1].
*/
diff --git a/gr-audio/lib/windows/audio_windows_sink.h b/gr-audio/lib/windows/audio_windows_sink.h
index 6819bd448..d4ca259b3 100644
--- a/gr-audio/lib/windows/audio_windows_sink.h
+++ b/gr-audio/lib/windows/audio_windows_sink.h
@@ -34,6 +34,7 @@
/*!
* \brief audio sink using winmm mmsystem (win32 only)
+ * \ingroup audio_blk
*
* input signature is one or two streams of floats.
* Input samples must be in the range [-1,1].
diff --git a/gr-audio/lib/windows/audio_windows_source.h b/gr-audio/lib/windows/audio_windows_source.h
index 36311968d..9cb789576 100644
--- a/gr-audio/lib/windows/audio_windows_source.h
+++ b/gr-audio/lib/windows/audio_windows_source.h
@@ -28,6 +28,7 @@
/*!
* \brief audio source using winmm mmsystem (win32 only)
+ * \ingroup audio_blk
*
* Output signature is one or two streams of floats.
* Output samples will be in the range [-1,1].
diff --git a/gr-audio/swig/Makefile.swig.gen b/gr-audio/swig/Makefile.swig.gen
index 7cdf04665..14322c0e5 100644
--- a/gr-audio/swig/Makefile.swig.gen
+++ b/gr-audio/swig/Makefile.swig.gen
@@ -1,6 +1,6 @@
# -*- Makefile -*-
#
-# Copyright 2011 Free Software Foundation, Inc.
+# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -105,7 +105,7 @@ _audio_swig_la_CXXFLAGS = \
$(audio_swig_la_swig_cxxflags)
python/audio_swig.cc: audio_swig.py
-audio_swig.py: audio_swig.i
+audio_swig.py: audio_swig.i
# Include the python dependencies for this file
-include python/audio_swig.d
diff --git a/gr-cvsd-vocoder/src/Makefile.am b/gr-cvsd-vocoder/src/Makefile.am
deleted file mode 100644
index be38b7c1a..000000000
--- a/gr-cvsd-vocoder/src/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright 2004 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.
-#
-
-SUBDIRS = lib
-if PYTHON
-SUBDIRS += python
-endif
diff --git a/gr-cvsd-vocoder/src/lib/Makefile.am b/gr-cvsd-vocoder/src/lib/Makefile.am
deleted file mode 100644
index 9c8c96b96..000000000
--- a/gr-cvsd-vocoder/src/lib/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Copyright 2004,2005,2008,2009,2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-include $(top_srcdir)/Makefile.swig
-
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
-
-# These headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS = \
- cvsd_decode_bs.h \
- cvsd_encode_sb.h
-
-lib_LTLIBRARIES = libgnuradio-cvsd-vocoder.la
-
-libgnuradio_cvsd_vocoder_la_SOURCES = \
- cvsd_decode_bs.cc \
- cvsd_encode_sb.cc
-
-libgnuradio_cvsd_vocoder_la_LIBADD = \
- $(GNURADIO_CORE_LA)
-
-libgnuradio_cvsd_vocoder_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-###################################
-# SWIG interface and library
-
-TOP_SWIG_IFILES = \
- cvsd_vocoder.i
-
-# Install so that they end up available as:
-# import gnuradio.vocoder.cvsd_vocoder
-# This ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
-cvsd_vocoder_pythondir_category = \
- gnuradio/vocoder
-
-# additional libraries for linking with the SWIG-generated library
-cvsd_vocoder_la_swig_libadd = \
- libgnuradio-cvsd-vocoder.la
diff --git a/gr-cvsd-vocoder/src/lib/cvsd_vocoder.i b/gr-cvsd-vocoder/src/lib/cvsd_vocoder.i
deleted file mode 100644
index 82662e84e..000000000
--- a/gr-cvsd-vocoder/src/lib/cvsd_vocoder.i
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2007,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.
- */
-
-%include "gnuradio.i"
-
-%{
-#include "cvsd_encode_sb.h"
-#include "cvsd_decode_bs.h"
-%}
-
-GR_SWIG_BLOCK_MAGIC(cvsd,encode_sb);
-
-cvsd_encode_sb_sptr cvsd_make_encode_sb (short min_step=10,
- short max_step=1280,
- double step_decay=0.9990234375,
- double accum_decay= 0.96875,
- int K=32,
- int J=4,
- short pos_accum_max=32767,
- short neg_accum_max=-32767);
-
-class cvsd_encode_sb : public gr_sync_decimator
-{
-private:
- cvsd_encode_sb (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max);
-
-
- public:
- short min_step() { return d_min_step; }
- short max_step() { return d_max_step; }
- double step_decay() { return d_step_decay; }
- double accum_decay() { return d_accum_decay; }
- int K() { return d_K; }
- int J() { return d_J; }
- short pos_accum_max() { return d_pos_accum_max; }
- short neg_accum_max() { return d_neg_accum_max; }
-};
-
-// ----------------------------------------------------------------
-
-GR_SWIG_BLOCK_MAGIC(cvsd,decode_bs);
-
-cvsd_decode_bs_sptr cvsd_make_decode_bs (short min_step=10,
- short max_step=1280,
- double step_decay=0.9990234375,
- double accum_decay= 0.96875,
- int K=32,
- int J=4,
- short pos_accum_max=32767,
- short neg_accum_max=-32767);
-
-class cvsd_decode_bs : public gr_sync_interpolator
-{
-private:
- cvsd_decode_bs (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max);
-
- public:
-};
-
-#if SWIGGUILE
-%scheme %{
-(load-extension-global "libguile-gnuradio-cvsd_vocoder" "scm_init_gnuradio_cvsd_vocoder_module")
-%}
-
-%goops %{
-(use-modules (gnuradio gnuradio_core_runtime))
-%}
-#endif
diff --git a/gr-cvsd-vocoder/src/python/run_tests.in b/gr-cvsd-vocoder/src/python/run_tests.in
deleted file mode 100644
index be969e287..000000000
--- a/gr-cvsd-vocoder/src/python/run_tests.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# 1st parameter is absolute path to component source directory
-# 2nd parameter is absolute path to component build directory
-# 3rd parameter is path to Python QA directory
-
-@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-cvsd-vocoder \
- @abs_top_builddir@/gr-cvsd-vocoder \
- @srcdir@
diff --git a/gr-msdd6000/.gitignore b/gr-digital/.gitignore
index a37fc0c1a..37c287f40 100644
--- a/gr-msdd6000/.gitignore
+++ b/gr-digital/.gitignore
@@ -1,3 +1,3 @@
/Makefile
/Makefile.in
-/*.pc
+gnuradio-digital.pc
diff --git a/gr-cvsd-vocoder/Makefile.am b/gr-digital/Makefile.am
index 48807a34b..85a9bbbde 100644
--- a/gr-cvsd-vocoder/Makefile.am
+++ b/gr-digital/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,11 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = src
+SUBDIRS = include lib doc
+
+if PYTHON
+SUBDIRS += swig python apps grc examples
+endif
pkgconfigdir = $(libdir)/pkgconfig
-dist_pkgconfig_DATA = gnuradio-cvsd-vocoder.pc
+dist_pkgconfig_DATA = gnuradio-digital.pc
diff --git a/gr-digital/README b/gr-digital/README
new file mode 100644
index 000000000..af2005c97
--- /dev/null
+++ b/gr-digital/README
@@ -0,0 +1,4 @@
+This GNU Radio component for implementing digitial modulators and demodulators.
+
+
+FIXME: just fixme. \ No newline at end of file
diff --git a/gr-digital/apps/.gitignore b/gr-digital/apps/.gitignore
new file mode 100644
index 000000000..282522db0
--- /dev/null
+++ b/gr-digital/apps/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/gr-radar-mono/src/Makefile.am b/gr-digital/apps/Makefile.am
index d546da7f8..7373a0719 100644
--- a/gr-radar-mono/src/Makefile.am
+++ b/gr-digital/apps/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,13 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = fpga lib
if PYTHON
-SUBDIRS += python
+
+dist_bin_SCRIPTS =
+
+noinst_PYTHON =
+
endif
+
+EXTRA_DIST +=
+
diff --git a/gnuradio-examples/python/apps/.gitignore b/gr-digital/doc/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gnuradio-examples/python/apps/.gitignore
+++ b/gr-digital/doc/.gitignore
diff --git a/gr-gpio/Makefile.am b/gr-digital/doc/Makefile.am
index d800383ef..dbfe1d5a2 100644
--- a/gr-gpio/Makefile.am
+++ b/gr-digital/doc/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,4 +21,7 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = src
+SUBDIRS =
+
+dist_gr_doc_DATA = \
+ README.digital
diff --git a/gr-digital/doc/README.digital b/gr-digital/doc/README.digital
new file mode 100644
index 000000000..f4d40f3a0
--- /dev/null
+++ b/gr-digital/doc/README.digital
@@ -0,0 +1,13 @@
+This is the gr-digital package. It contains all of the digital
+modulation blocks, utilities, and examples. To use the digital blocks,
+the Python namespaces is in gnuradio.digital, which would be normally
+imported as:
+
+ from gnuradio import digital
+
+See the Doxygen documentation for details about the blocks available
+in this package. A quick listing of the details can be found in Python
+after importing by using:
+
+ help(digital)
+
diff --git a/gr-digital/doc/digital.dox b/gr-digital/doc/digital.dox
new file mode 100644
index 000000000..110dcb677
--- /dev/null
+++ b/gr-digital/doc/digital.dox
@@ -0,0 +1,23 @@
+/*! \page page_digital Digital Modulation
+
+\section Introduction
+This is the gr-digital package. It contains all of the digital
+modulation blocks, utilities, and examples. To use the digital blocks,
+the Python namespaces is in gnuradio.digital, which would be normally
+imported as:
+
+\code
+ from gnuradio import digital
+\endcode
+
+See the Doxygen documentation for details about the blocks available
+in this package. The relevant blocks are listed in the \ref digital group.
+
+A quick listing of the details can be found in Python after importing
+by using:
+
+\code
+ help(digital)
+\endcode
+
+*/
diff --git a/gr-digital/examples/.gitignore b/gr-digital/examples/.gitignore
new file mode 100644
index 000000000..d7028d40d
--- /dev/null
+++ b/gr-digital/examples/.gitignore
@@ -0,0 +1,8 @@
+/Makefile
+/Makefile.in
+/*.8b
+/*.16s
+/*.16i
+/*.32f
+/*.32fc
+/*.16sc
diff --git a/gnuradio-examples/python/digital/Makefile.am b/gr-digital/examples/Makefile.am
index e32180cd4..dc8aba6ca 100644
--- a/gnuradio-examples/python/digital/Makefile.am
+++ b/gr-digital/examples/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2004,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -23,26 +23,22 @@ include $(top_srcdir)/Makefile.common
ourdatadir = $(exampledir)/digital
-dist_ourdata_DATA = \
- README \
- pick_bitrate.py \
- qt_digital_window.ui \
- qt_digital_window.py \
- qt_rx_window.ui \
- qt_rx_window.py \
- receive_path.py \
- transmit_path.py \
- usrp_receive_path.py \
- usrp_transmit_path.py
+noinst_PYTHON = \
+ example_costas.py \
+ example_fll.py \
+ example_timing.py
-dist_ourdata_SCRIPTS = \
- benchmark_loopback.py \
- benchmark_rx.py \
+dist_ourdata_SCRIPTS = \
+ transmit_path.py \
+ receive_path.py \
+ uhd_interface.py \
benchmark_tx.py \
- benchmark_qt_rx.py \
- benchmark_qt_loopback.py\
- gen_whitener.py \
+ benchmark_rx.py \
+ tx_voice.py \
rx_voice.py \
run_length.py \
- tunnel.py \
- tx_voice.py
+ gen_whitener.py \
+ digital_bert_rx.py \
+ digital_bert_tx.py \
+ tunnel.py
+
diff --git a/gnuradio-examples/python/digital/README b/gr-digital/examples/README
index 904a64895..1c50ad69b 100644
--- a/gnuradio-examples/python/digital/README
+++ b/gr-digital/examples/README
@@ -82,3 +82,72 @@ useful as a diagnostic tool when experimenting with line coding or
whitening algorithms.
+
+**********************************************************************
+**********************************************************************
+
+
+BERT testing example scripts
+
+benchmark_tx.py
+
+This sets up a BPSK transmitter that is modulated with a pseudorandom
+sequence of bits. The PN code is generated by sending an all 1s
+sequence through a 7-bit scrambler. The transmitter performs the BPSK
+modulation, then passes the complex baseband waveform through a
+root-raised-cosine filter and onto the USRP.
+
+The --sps parameter controls how many baseband samples per symbol
+are created and passed through the RRC filter, prior to going to the
+USRP over the USB for interpolation to the final DAC rate.
+
+The baseband bit rate is controlled by -r or --rate. This value, when
+multiplied by the --sps parameter, must result in valid interpolation
+rate for the USRP. For example, if the baseband rate is 250k bits/sec,
+and the samples per symbol is 4, then the final rate is 1M samples/sec,
+which results in an interpolation rate of 128. The valid interpolation
+rates for the USRP are multiples of 4 between 16 and 512.
+
+Finally, the RRC excess bandwidth may be specified by --excess-bw.
+(See ./benchmark_tx.py -h for additional parameters.)
+
+
+benchmark_rx.py
+
+This sets up a BPSK receiver to demodulate the received waveform. It
+accepts a similar set of parameters as the transmitter, except that one
+specifies the USRP decimation rate desired. The resulting sample stream
+rate must be an integral number of baseband symbols. For example, the
+parameters corresponding to the above transmitter would be to use a
+decimation rate of 8 (32 sps), 16 (16 sps), 32 (8 sps), 64, (4 sps), or
+128 (2 sps). The lower the USRP decimation, the more CPU is required to
+demodulate the signal, so not all valid decimation rates will work.
+
+The baseband signal from the USRP is first passed through an AGC to
+establish an average power of 1.0. It is then passed through a matched
+filter (another RRC), a Costas phase-locked loop, and a Mueller and
+Muller bit timing recovery loop. The resulting constellation has an SNR
+estimation probe attached, and is then sliced into a bit stream.
+
+The recovered bits are then passed through a 7-bit descrambler. If
+there are no channel errors, the all 1s sequence is recovered. In the
+event of a channel error, there will be a 0 in the bit stream for each
+feedback tap in the descrambler. In this case, the CCSDS descrambler is
+using 3 feedback taps.
+
+Finally, the signal is passed into a bit density measurement probe. The
+channel BER is measured by dividing the 0s density by three. This
+measurement is inaccurate at high BER rates (>10%) as the error 0s
+begin to overlap.
+
+The benchmark script will, once per second, output the Costas loop
+frequency offset, the recovered timing error, the estimated SNR, and the
+average BER.
+
+NOTE: The particular SNR estimator used is inaccurate below about 7dB,
+and will report erroneously high values even for random noise.
+
+There are a variety of Costas and M&M loop parameters one can adjust.
+See ./benchmark_rx.py -h for the full set.
+
+
diff --git a/gr-digital/examples/benchmark_add_channel.py b/gr-digital/examples/benchmark_add_channel.py
new file mode 100755
index 000000000..def1f8267
--- /dev/null
+++ b/gr-digital/examples/benchmark_add_channel.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+#
+# Copyright 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,
+# 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 random, math, sys
+
+class my_top_block(gr.top_block):
+ def __init__(self, ifile, ofile, options):
+ gr.top_block.__init__(self)
+
+ SNR = 10.0**(options.snr/10.0)
+ frequency_offset = options.frequency_offset
+ time_offset = options.time_offset
+ phase_offset = options.phase_offset*(math.pi/180.0)
+
+ # calculate noise voltage from SNR
+ # FIXME: normalize to signal amplitude
+ power_in_signal = abs(1.0)**2
+ noise_power = power_in_signal/SNR
+ noise_voltage = math.sqrt(noise_power)
+ print noise_voltage
+
+ self.src = gr.file_source(gr.sizeof_gr_complex, ifile)
+ #self.throttle = gr.throttle(gr.sizeof_gr_complex, options.sample_rate)
+ self.channel = gr.channel_model(noise_voltage, frequency_offset,
+ time_offset, noise_seed=random.randint(0,100000))
+ self.phase = gr.multiply_const_cc(complex(math.cos(phase_offset),
+ math.sin(phase_offset)))
+ self.snk = gr.file_sink(gr.sizeof_gr_complex, ofile)
+
+ self.connect(self.src, self.channel, self.phase, self.snk)
+
+
+# /////////////////////////////////////////////////////////////////////////////
+# main
+# /////////////////////////////////////////////////////////////////////////////
+
+def main():
+ # Create Options Parser:
+ usage = "benchmack_add_channel.py [options] <input file> <output file>"
+ parser = OptionParser (usage=usage, option_class=eng_option, conflict_handler="resolve")
+ parser.add_option("-n", "--snr", type="eng_float", default=30,
+ help="set the SNR of the channel in dB [default=%default]")
+ parser.add_option("", "--seed", action="store_true", default=False,
+ help="use a random seed for AWGN noise [default=%default]")
+ parser.add_option("-f", "--frequency-offset", type="eng_float", default=0,
+ help="set frequency offset introduced by channel [default=%default]")
+ parser.add_option("-t", "--time-offset", type="eng_float", default=1.0,
+ help="set timing offset between Tx and Rx [default=%default]")
+ parser.add_option("-p", "--phase-offset", type="eng_float", default=0,
+ help="set phase offset (in degrees) between Tx and Rx [default=%default]")
+ parser.add_option("-m", "--use-multipath", action="store_true", default=False,
+ help="Use a multipath channel [default=%default]")
+
+ (options, args) = parser.parse_args ()
+
+ if len(args) != 2:
+ parser.print_help(sys.stderr)
+ sys.exit(1)
+
+ ifile = args[0]
+ ofile = args[1]
+
+ # build the graph
+ tb = my_top_block(ifile, ofile, 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/gnuradio-examples/python/digital/benchmark_rx.py b/gr-digital/examples/benchmark_rx.py
index ccb0c8963..c586cc8fe 100755
--- a/gnuradio-examples/python/digital/benchmark_rx.py
+++ b/gr-digital/examples/benchmark_rx.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
+# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,19 +20,22 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, modulation_utils
-from gnuradio import usrp
+from gnuradio import gr, gru
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
+# From gr-digital
+from gnuradio import digital
+
+# from current dir
+from receive_path import receive_path
+from uhd_interface import uhd_receiver
+
import random
import struct
import sys
-# from current dir
-import usrp_receive_path
-
#import os
#print os.getpid()
#raw_input('Attach and press enter: ')
@@ -41,10 +44,25 @@ class my_top_block(gr.top_block):
def __init__(self, demodulator, rx_callback, options):
gr.top_block.__init__(self)
+ if(options.rx_freq is not None):
+ self.source = uhd_receiver(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.rx_freq, options.rx_gain,
+ options.antenna, options.verbose)
+ options.samples_per_symbol = self.source._sps
+
+ elif(options.from_file is not None):
+ self.source = gr.file_source(gr.sizeof_gr_complex, options.from_file)
+ else:
+ self.source = gr.null_source(gr.sizeof_gr_complex)
+
# Set up receive path
- self.rxpath = usrp_receive_path.usrp_receive_path(demodulator, rx_callback, options)
+ # do this after for any adjustments to the options that may
+ # occur in the sinks (specifically the UHD sink)
+ self.rxpath = receive_path(demodulator, rx_callback, options)
+
+ self.connect(self.source, self.rxpath)
- self.connect(self.rxpath)
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -68,19 +86,21 @@ def main():
print "ok = %5s pktno = %4d n_rcvd = %4d n_right = %4d" % (
ok, pktno, n_rcvd, n_right)
-
- demods = modulation_utils.type_1_demods()
+ demods = digital.modulation_utils2.type_1_demods()
# Create Options Parser:
parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
- default='gmsk',
+ default='psk',
help="Select modulation from: %s [default=%%default]"
% (', '.join(demods.keys()),))
+ parser.add_option("","--from-file", default=None,
+ help="input file of samples to demod")
- usrp_receive_path.add_options(parser, expert_grp)
+ receive_path.add_options(parser, expert_grp)
+ uhd_receiver.add_options(parser)
for mod in demods.values():
mod.add_options(expert_grp)
@@ -91,10 +111,11 @@ def main():
parser.print_help(sys.stderr)
sys.exit(1)
- 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)
+ 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
diff --git a/gnuradio-examples/python/digital/benchmark_tx.py b/gr-digital/examples/benchmark_tx.py
index 73c4a3901..a4396dd98 100755
--- a/gnuradio-examples/python/digital/benchmark_tx.py
+++ b/gr-digital/examples/benchmark_tx.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
+# Copyright 2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,16 +20,19 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, modulation_utils
-from gnuradio import usrp
+from gnuradio import gr
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-import random, time, struct, sys
+# From gr-digital
+from gnuradio import digital
# from current dir
-import usrp_transmit_path
+from transmit_path import transmit_path
+from uhd_interface import uhd_transmitter
+
+import random, time, struct, sys
#import os
#print os.getpid()
@@ -39,9 +42,23 @@ class my_top_block(gr.top_block):
def __init__(self, modulator, options):
gr.top_block.__init__(self)
- self.txpath = usrp_transmit_path.usrp_transmit_path(modulator, options)
+ if(options.tx_freq is not None):
+ self.sink = uhd_transmitter(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.tx_freq, options.tx_gain,
+ options.antenna, options.verbose)
+ options.samples_per_symbol = self.sink._sps
+
+ elif(options.to_file is not None):
+ self.sink = gr.file_sink(gr.sizeof_gr_complex, options.to_file)
+ else:
+ self.sink = gr.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(modulator, options)
- self.connect(self.txpath)
+ self.connect(self.txpath, self.sink)
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -55,13 +72,13 @@ def main():
def rx_callback(ok, payload):
print "ok = %r, payload = '%s'" % (ok, payload)
- mods = modulation_utils.type_1_mods()
+ mods = digital.modulation_utils2.type_1_mods()
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
- default='gmsk',
+ default='psk',
help="Select modulation from: %s [default=%%default]"
% (', '.join(mods.keys()),))
@@ -72,9 +89,12 @@ def main():
parser.add_option("","--discontinuous", action="store_true", default=False,
help="enable discontinous transmission (bursts of 5 packets)")
parser.add_option("","--from-file", default=None,
- help="use file for packet contents")
+ help="use intput file for packet contents")
+ parser.add_option("","--to-file", default=None,
+ help="Output file for modulated samples")
- usrp_transmit_path.add_options(parser, expert_grp)
+ transmit_path.add_options(parser, expert_grp)
+ uhd_transmitter.add_options(parser)
for mod in mods.values():
mod.add_options(expert_grp)
@@ -84,12 +104,7 @@ def main():
if len(args) != 0:
parser.print_help()
sys.exit(1)
-
- if 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)
-
+
if options.from_file is not None:
source_file = open(options.from_file, 'r')
diff --git a/gr-digital/examples/digital_bert_rx.py b/gr-digital/examples/digital_bert_rx.py
new file mode 100755
index 000000000..9ee1f5ee8
--- /dev/null
+++ b/gr-digital/examples/digital_bert_rx.py
@@ -0,0 +1,209 @@
+#!/usr/bin/env python
+#
+# Copyright 2008,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, eng_notation
+from optparse import OptionParser
+from gnuradio.eng_option import eng_option
+import gnuradio.gr.gr_threading as _threading
+import sys, time, math
+
+from gnuradio import digital
+
+# from current dir
+from uhd_interface import uhd_receiver
+
+n2s = eng_notation.num_to_str
+
+class status_thread(_threading.Thread):
+ def __init__(self, tb):
+ _threading.Thread.__init__(self)
+ self.setDaemon(1)
+ self.tb = tb
+ self.done = False
+ self.start()
+
+ def run(self):
+ while not self.done:
+ print "Freq. Offset: {0:5.0f} Hz Timing Offset: {1:10.1f} ppm Estimated SNR: {2:4.1f} dB BER: {3:g}".format(
+ tb.frequency_offset(), tb.timing_offset()*1e6, tb.snr(), tb.ber())
+ try:
+ time.sleep(1.0)
+ except KeyboardInterrupt:
+ self.done = True
+
+
+
+class bert_receiver(gr.hier_block2):
+ def __init__(self, bitrate,
+ constellation, samples_per_symbol,
+ differential, excess_bw, gray_coded,
+ freq_bw, timing_bw, phase_bw,
+ verbose, log):
+
+ gr.hier_block2.__init__(self, "bert_receive",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(0, 0, 0)) # Output signature
+
+ self._bitrate = bitrate
+
+ self._demod = digital.generic_demod(constellation, samples_per_symbol,
+ differential, excess_bw, gray_coded,
+ freq_bw, timing_bw, phase_bw,
+ verbose, log)
+
+ self._symbol_rate = self._bitrate * self._demod.bits_per_symbol()
+ self._sample_rate = self._symbol_rate * samples_per_symbol
+
+ # Add an SNR probe on the demodulated constellation
+ self._snr_probe = gr.probe_mpsk_snr_c(10.0/self._symbol_rate)
+ self.connect(self._demod.time_recov, self._snr_probe)
+
+ # Descramble BERT sequence. A channel error will create 3 incorrect bits
+ self._descrambler = gr.descrambler_bb(0x8A, 0x7F, 7) # CCSDS 7-bit descrambler
+
+ # Measure BER by the density of 0s in the stream
+ self._ber = gr.probe_density_b(1.0/self._symbol_rate)
+
+ self.connect(self, self._demod, self._descrambler, self._ber)
+
+ def frequency_offset(self):
+ return self._demod.freq_recov.get_frequency()*self._sample_rate/(2*math.pi)
+
+ def timing_offset(self):
+ return self._demod.time_recov.get_clock_rate()
+
+ def snr(self):
+ return self._snr_probe.snr()
+
+ def ber(self):
+ return (1.0-self._ber.density())/3.0
+
+
+
+class rx_psk_block(gr.top_block):
+ def __init__(self, demod, options):
+
+ gr.top_block.__init__(self, "rx_mpsk")
+
+ self._demodulator_class = demod
+
+ # Get demod_kwargs
+ demod_kwargs = self._demodulator_class.extract_kwargs_from_options(options)
+
+ # demodulator
+ self._demodulator = self._demodulator_class(**demod_kwargs)
+
+ if(options.rx_freq is not None):
+ self._source = uhd_receiver(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.rx_freq, options.rx_gain,
+ options.antenna, options.verbose)
+ options.samples_per_symbol = self._source._sps
+
+ elif(options.from_file is not None):
+ self._source = gr.file_source(gr.sizeof_gr_complex, options.from_file)
+ else:
+ self._source = gr.null_source(gr.sizeof_gr_complex)
+
+ # Create the BERT receiver
+ self._receiver = bert_receiver(options.bitrate,
+ self._demodulator._constellation,
+ options.samples_per_symbol,
+ options.differential,
+ options.excess_bw,
+ gray_coded=True,
+ freq_bw=options.freq_bw,
+ timing_bw=options.timing_bw,
+ phase_bw=options.phase_bw,
+ verbose=options.verbose,
+ log=options.log)
+
+ self.connect(self._source, self._receiver)
+
+ def snr(self):
+ return self._receiver.snr()
+
+ def mag(self):
+ return self._receiver.signal_mean()
+
+ def var(self):
+ return self._receiver.noise_variance()
+
+ def ber(self):
+ return self._receiver.ber()
+
+ def frequency_offset(self):
+ return self._receiver.frequency_offset()
+
+ def timing_offset(self):
+ return self._receiver.timing_offset()
+
+
+def get_options(demods):
+ parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
+ parser.add_option("","--from-file", default=None,
+ help="input file of samples to demod")
+ parser.add_option("-m", "--modulation", type="choice", choices=demods.keys(),
+ default='psk',
+ help="Select modulation from: %s [default=%%default]"
+ % (', '.join(demods.keys()),))
+ parser.add_option("-r", "--bitrate", type="eng_float", default=250e3,
+ help="Select modulation bit rate (default=%default)")
+ parser.add_option("-S", "--samples-per-symbol", type="float", default=2,
+ help="set samples/symbol [default=%default]")
+ if not parser.has_option("--verbose"):
+ parser.add_option("-v", "--verbose", action="store_true", default=False)
+ if not parser.has_option("--log"):
+ parser.add_option("", "--log", action="store_true", default=False,
+ help="Log all parts of flow graph to files (CAUTION: lots of data)")
+
+ uhd_receiver.add_options(parser)
+
+ demods = digital.modulation_utils2.type_1_demods()
+ for mod in demods.values():
+ mod.add_options(parser)
+
+ (options, args) = parser.parse_args()
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ return (options, args)
+
+
+if __name__ == "__main__":
+ demods = digital.modulation_utils2.type_1_demods()
+
+ (options, args) = get_options(demods)
+
+ demod = demods[options.modulation]
+ tb = rx_psk_block(demod, options)
+
+ print "\n*** SNR estimator is inaccurate below about 7dB"
+ print "*** BER estimator is inaccurate above about 10%\n"
+ updater = status_thread(tb)
+
+ try:
+ tb.run()
+ except KeyboardInterrupt:
+ updater.done = True
+ updater = None
diff --git a/gr-digital/examples/digital_bert_tx.py b/gr-digital/examples/digital_bert_tx.py
new file mode 100755
index 000000000..6b544c7f7
--- /dev/null
+++ b/gr-digital/examples/digital_bert_tx.py
@@ -0,0 +1,135 @@
+#!/usr/bin/env python
+#
+# Copyright 2008,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, eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+import sys
+
+from gnuradio import digital
+
+# from current dir
+from uhd_interface import uhd_transmitter
+
+n2s = eng_notation.num_to_str
+
+class bert_transmit(gr.hier_block2):
+ def __init__(self, constellation, samples_per_symbol,
+ differential, excess_bw, gray_coded,
+ verbose, log):
+
+ gr.hier_block2.__init__(self, "bert_transmit",
+ gr.io_signature(0, 0, 0), # Output signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Input signature
+
+ # Create BERT data bit stream
+ self._bits = gr.vector_source_b([1,], True) # Infinite stream of ones
+ self._scrambler = gr.scrambler_bb(0x8A, 0x7F, 7) # CCSDS 7-bit scrambler
+
+ self._mod = digital.generic_mod(constellation, samples_per_symbol,
+ differential, excess_bw, gray_coded,
+ verbose, log)
+
+ self._pack = gr.unpacked_to_packed_bb(self._mod.bits_per_symbol(), gr.GR_MSB_FIRST)
+
+ self.connect(self._bits, self._scrambler, self._pack, self._mod, self)
+
+
+class tx_psk_block(gr.top_block):
+ def __init__(self, mod, options):
+ gr.top_block.__init__(self, "tx_mpsk")
+
+ self._modulator_class = mod
+
+ # Get mod_kwargs
+ mod_kwargs = self._modulator_class.extract_kwargs_from_options(options)
+
+ # transmitter
+ self._modulator = self._modulator_class(**mod_kwargs)
+
+ if(options.tx_freq is not None):
+ self._sink = uhd_transmitter(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.tx_freq, options.tx_gain,
+ options.antenna, options.verbose)
+ options.samples_per_symbol = self._sink._sps
+
+ elif(options.to_file is not None):
+ self._sink = gr.file_sink(gr.sizeof_gr_complex, options.to_file)
+ else:
+ self._sink = gr.null_sink(gr.sizeof_gr_complex)
+
+
+ self._transmitter = bert_transmit(self._modulator._constellation,
+ options.samples_per_symbol,
+ options.differential,
+ options.excess_bw,
+ gray_coded=True,
+ verbose=options.verbose,
+ log=options.log)
+
+ self.connect(self._transmitter, self._sink)
+
+
+def get_options(mods):
+ parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
+ parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
+ default='psk',
+ help="Select modulation from: %s [default=%%default]"
+ % (', '.join(mods.keys()),))
+ parser.add_option("", "--amplitude", type="eng_float", default=0.2,
+ help="set Tx amplitude (0-1) (default=%default)")
+ parser.add_option("-r", "--bitrate", type="eng_float", default=250e3,
+ help="Select modulation bit rate (default=%default)")
+ parser.add_option("-S", "--samples-per-symbol", type="float", default=2,
+ help="set samples/symbol [default=%default]")
+ parser.add_option("","--to-file", default=None,
+ help="Output file for modulated samples")
+ if not parser.has_option("--verbose"):
+ parser.add_option("-v", "--verbose", action="store_true", default=False)
+ if not parser.has_option("--log"):
+ parser.add_option("", "--log", action="store_true", default=False)
+
+ uhd_transmitter.add_options(parser)
+
+ for mod in mods.values():
+ mod.add_options(parser)
+
+ (options, args) = parser.parse_args()
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ return (options, args)
+
+if __name__ == "__main__":
+ mods = digital.modulation_utils2.type_1_mods()
+
+ (options, args) = get_options(mods)
+
+ mod = mods[options.modulation]
+ tb = tx_psk_block(mod, options)
+
+ try:
+ tb.run()
+ except KeyboardInterrupt:
+ pass
diff --git a/gr-digital/examples/example_costas.py b/gr-digital/examples/example_costas.py
new file mode 100755
index 000000000..aef0196cc
--- /dev/null
+++ b/gr-digital/examples/example_costas.py
@@ -0,0 +1,116 @@
+#!/usr/bin/env python
+
+from gnuradio import gr, digital
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+
+try:
+ import scipy
+except ImportError:
+ print "Error: could not import scipy (http://www.scipy.org/)"
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ sys.exit(1)
+
+class example_costas(gr.top_block):
+ def __init__(self, N, sps, rolloff, ntaps, bw, noise, foffset, toffset, poffset):
+ gr.top_block.__init__(self)
+
+ rrc_taps = gr.firdes.root_raised_cosine(
+ sps, sps, 1.0, rolloff, ntaps)
+
+ data = 2.0*scipy.random.randint(0, 2, N) - 1.0
+ data = scipy.exp(1j*poffset) * data
+
+ self.src = gr.vector_source_c(data.tolist(), False)
+ self.rrc = gr.interp_fir_filter_ccf(sps, rrc_taps)
+ self.chn = gr.channel_model(noise, foffset, toffset)
+ self.cst = digital.costas_loop_cc(bw, 2)
+
+ self.vsnk_src = gr.vector_sink_c()
+ self.vsnk_cst = gr.vector_sink_c()
+ self.vsnk_frq = gr.vector_sink_f()
+
+ self.connect(self.src, self.rrc, self.chn, self.cst, self.vsnk_cst)
+ self.connect(self.rrc, self.vsnk_src)
+ 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 ()
+
+ # Adjust N for the interpolation by sps
+ options.nsamples = options.nsamples // options.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.run()
+
+ data_src = scipy.array(put.vsnk_src.data())
+
+ # Convert the FLL's LO frequency from rads/sec to Hz
+ data_frq = scipy.array(put.vsnk_frq.data()) / (2.0*scipy.pi)
+
+ # adjust this to align with the data.
+ data_cst = scipy.array(3*[0,]+list(put.vsnk_cst.data()))
+
+ # Plot the Costas loop's LO frequency
+ f1 = pylab.figure(1, figsize=(12,10), facecolor='w')
+ s1 = f1.add_subplot(2,2,1)
+ s1.plot(data_frq)
+ s1.set_title("Costas LO")
+ s1.set_xlabel("Samples")
+ s1.set_ylabel("Frequency (normalized Hz)")
+
+ # Plot the IQ symbols
+ s3 = f1.add_subplot(2,2,2)
+ s3.plot(data_src.real, data_src.imag, "o")
+ s3.plot(data_cst.real, data_cst.imag, "rx")
+ s3.set_title("IQ")
+ s3.set_xlabel("Real part")
+ s3.set_ylabel("Imag part")
+ s3.set_xlim([-2, 2])
+ s3.set_ylim([-2, 2])
+
+ # Plot the symbols in time
+ s4 = f1.add_subplot(2,2,3)
+ s4.set_position([0.125, 0.05, 0.775, 0.4])
+ s4.plot(data_src.real, "o-")
+ s4.plot(data_cst.real, "rx-")
+ s4.set_title("Symbols")
+ s4.set_xlabel("Samples")
+ s4.set_ylabel("Real Part of Signals")
+
+ pylab.show()
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
diff --git a/gr-digital/examples/example_fll.py b/gr-digital/examples/example_fll.py
new file mode 100755
index 000000000..3b75b5a75
--- /dev/null
+++ b/gr-digital/examples/example_fll.py
@@ -0,0 +1,126 @@
+#!/usr/bin/env python
+
+from gnuradio import gr, digital
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+
+try:
+ import scipy
+except ImportError:
+ print "Error: could not import scipy (http://www.scipy.org/)"
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ sys.exit(1)
+
+class example_fll(gr.top_block):
+ def __init__(self, N, sps, rolloff, ntaps, bw, noise, foffset, toffset, poffset):
+ gr.top_block.__init__(self)
+
+ rrc_taps = gr.firdes.root_raised_cosine(
+ sps, sps, 1.0, rolloff, ntaps)
+
+ data = 2.0*scipy.random.randint(0, 2, N) - 1.0
+ data = scipy.exp(1j*poffset) * data
+
+ self.src = gr.vector_source_c(data.tolist(), False)
+ self.rrc = gr.interp_fir_filter_ccf(sps, rrc_taps)
+ self.chn = gr.channel_model(noise, foffset, toffset)
+ self.fll = digital.fll_band_edge_cc(sps, rolloff, ntaps, bw)
+
+ self.vsnk_src = gr.vector_sink_c()
+ self.vsnk_fll = gr.vector_sink_c()
+ self.vsnk_frq = gr.vector_sink_f()
+ self.vsnk_phs = gr.vector_sink_f()
+ self.vsnk_err = gr.vector_sink_f()
+
+ self.connect(self.src, self.rrc, self.chn, self.fll, self.vsnk_fll)
+ self.connect(self.rrc, self.vsnk_src)
+ self.connect((self.fll,1), self.vsnk_frq)
+ self.connect((self.fll,2), self.vsnk_phs)
+ 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 ()
+
+ # Adjust N for the interpolation by sps
+ options.nsamples = options.nsamples // options.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.run()
+
+ data_src = scipy.array(put.vsnk_src.data())
+ data_err = scipy.array(put.vsnk_err.data())
+
+ # Convert the FLL's LO frequency from rads/sec to Hz
+ data_frq = scipy.array(put.vsnk_frq.data()) / (2.0*scipy.pi)
+
+ # 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:])
+
+ # Plot the FLL's LO frequency
+ f1 = pylab.figure(1, figsize=(12,10))
+ s1 = f1.add_subplot(2,2,1)
+ s1.plot(data_frq)
+ s1.set_title("FLL LO")
+ s1.set_xlabel("Samples")
+ s1.set_ylabel("Frequency (normalized Hz)")
+
+ # Plot the FLL's error
+ s2 = f1.add_subplot(2,2,2)
+ s2.plot(data_err)
+ s2.set_title("FLL Error")
+ s2.set_xlabel("Samples")
+ s2.set_ylabel("FLL Loop error")
+
+ # Plot the IQ symbols
+ s3 = f1.add_subplot(2,2,3)
+ s3.plot(data_src.real, data_src.imag, "o")
+ s3.plot(data_fll.real, data_fll.imag, "rx")
+ s3.set_title("IQ")
+ s3.set_xlabel("Real part")
+ s3.set_ylabel("Imag part")
+
+ # Plot the symbols in time
+ s4 = f1.add_subplot(2,2,4)
+ s4.plot(data_src.real, "o-")
+ s4.plot(data_fll.real, "rx-")
+ s4.set_title("Symbols")
+ s4.set_xlabel("Samples")
+ s4.set_ylabel("Real Part of Signals")
+
+ pylab.show()
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
diff --git a/gr-digital/examples/example_timing.py b/gr-digital/examples/example_timing.py
new file mode 100755
index 000000000..fd86acfb1
--- /dev/null
+++ b/gr-digital/examples/example_timing.py
@@ -0,0 +1,211 @@
+#!/usr/bin/env python
+
+from gnuradio import gr, digital
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+
+try:
+ import scipy
+except ImportError:
+ print "Error: could not import scipy (http://www.scipy.org/)"
+ sys.exit(1)
+
+try:
+ import pylab
+except ImportError:
+ print "Error: could not import pylab (http://matplotlib.sourceforge.net/)"
+ sys.exit(1)
+
+from scipy import fftpack
+
+class example_timing(gr.top_block):
+ def __init__(self, N, sps, rolloff, ntaps, bw, noise,
+ foffset, toffset, poffset, mode=0):
+ gr.top_block.__init__(self)
+
+ rrc_taps = gr.firdes.root_raised_cosine(
+ sps, sps, 1.0, rolloff, ntaps)
+
+ gain = 2*scipy.pi/100.0
+ nfilts = 32
+ rrc_taps_rx = gr.firdes.root_raised_cosine(
+ nfilts, sps*nfilts, 1.0, rolloff, ntaps*nfilts)
+
+ data = 2.0*scipy.random.randint(0, 2, N) - 1.0
+ data = scipy.exp(1j*poffset) * data
+
+ self.src = gr.vector_source_c(data.tolist(), False)
+ self.rrc = gr.interp_fir_filter_ccf(sps, rrc_taps)
+ self.chn = gr.channel_model(noise, foffset, toffset)
+ self.off = gr.fractional_interpolator_cc(0.20, 1.0)
+
+ if mode == 0:
+ self.clk = gr.pfb_clock_sync_ccf(sps, gain, rrc_taps_rx,
+ nfilts, nfilts//2, 3.5)
+ self.taps = self.clk.get_taps()
+ self.dtaps = self.clk.get_diff_taps()
+
+ self.vsnk_err = gr.vector_sink_f()
+ self.vsnk_rat = gr.vector_sink_f()
+ self.vsnk_phs = gr.vector_sink_f()
+
+ self.connect((self.clk,1), self.vsnk_err)
+ self.connect((self.clk,2), self.vsnk_rat)
+ self.connect((self.clk,3), self.vsnk_phs)
+
+ else: # mode == 1
+ mu = 0.5
+ gain_mu = 0.1
+ gain_omega = 0.25*gain_mu*gain_mu
+ omega_rel_lim = 0.02
+ self.clk = digital.clock_recovery_mm_cc(sps, gain_omega,
+ mu, gain_mu,
+ omega_rel_lim)
+
+ self.vsnk_err = gr.vector_sink_f()
+
+ self.connect((self.clk,1), self.vsnk_err)
+
+ self.vsnk_src = gr.vector_sink_c()
+ self.vsnk_clk = gr.vector_sink_c()
+
+ self.connect(self.src, self.rrc, self.chn, self.off, self.clk, self.vsnk_clk)
+ self.connect(self.off, self.vsnk_src)
+
+
+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.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 ()
+
+ # Adjust N for the interpolation by sps
+ options.nsamples = options.nsamples // options.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.run()
+
+ if options.mode == 0:
+ data_src = scipy.array(put.vsnk_src.data()[20:])
+ data_clk = scipy.array(put.vsnk_clk.data()[20:])
+
+ data_err = scipy.array(put.vsnk_err.data()[20:])
+ data_rat = scipy.array(put.vsnk_rat.data()[20:])
+ data_phs = scipy.array(put.vsnk_phs.data()[20:])
+
+ f1 = pylab.figure(1, figsize=(12,10), facecolor='w')
+
+ # Plot the IQ symbols
+ s1 = f1.add_subplot(2,2,1)
+ s1.plot(data_src.real, data_src.imag, "bo")
+ s1.plot(data_clk.real, data_clk.imag, "ro")
+ s1.set_title("IQ")
+ s1.set_xlabel("Real part")
+ s1.set_ylabel("Imag part")
+ s1.set_xlim([-2, 2])
+ s1.set_ylim([-2, 2])
+
+ # Plot the symbols in time
+ s2 = f1.add_subplot(2,2,2)
+ s2.plot(data_src.real, "bo-")
+ s2.plot(data_clk.real, "ro")
+ s2.set_title("Symbols")
+ s2.set_xlabel("Samples")
+ s2.set_ylabel("Real Part of Signals")
+
+ # Plot the clock recovery loop's error
+ s3 = f1.add_subplot(2,2,3)
+ s3.plot(data_err)
+ s3.set_title("Clock Recovery Loop Error")
+ s3.set_xlabel("Samples")
+ s3.set_ylabel("Error")
+
+ # Plot the clock recovery loop's error
+ s4 = f1.add_subplot(2,2,4)
+ s4.plot(data_phs)
+ s4.set_title("Clock Recovery Loop Filter Phase")
+ s4.set_xlabel("Samples")
+ s4.set_ylabel("Filter Phase")
+
+
+ diff_taps = put.dtaps
+ ntaps = len(diff_taps[0])
+ nfilts = len(diff_taps)
+ t = scipy.arange(0, ntaps*nfilts)
+
+ f3 = pylab.figure(3, figsize=(12,10), facecolor='w')
+ s31 = f3.add_subplot(2,1,1)
+ s32 = f3.add_subplot(2,1,2)
+ s31.set_title("Differential Filters")
+ s32.set_title("FFT of Differential Filters")
+
+ for i,d in enumerate(diff_taps):
+ D = 20.0*scipy.log10(abs(fftpack.fftshift(fftpack.fft(d, 10000))))
+ s31.plot(t[i::nfilts].real, d, "-o")
+ s32.plot(D)
+
+ # If testing the M&M clock recovery loop
+ else:
+ data_src = scipy.array(put.vsnk_src.data()[20:])
+ data_clk = scipy.array(put.vsnk_clk.data()[20:])
+
+ data_err = scipy.array(put.vsnk_err.data()[20:])
+
+ f1 = pylab.figure(1, figsize=(12,10), facecolor='w')
+
+ # Plot the IQ symbols
+ s1 = f1.add_subplot(2,2,1)
+ s1.plot(data_src.real, data_src.imag, "o")
+ s1.plot(data_clk.real, data_clk.imag, "ro")
+ s1.set_title("IQ")
+ s1.set_xlabel("Real part")
+ s1.set_ylabel("Imag part")
+ s1.set_xlim([-2, 2])
+ s1.set_ylim([-2, 2])
+
+ # Plot the symbols in time
+ s2 = f1.add_subplot(2,2,2)
+ s2.plot(data_src.real, "o-")
+ s2.plot(data_clk.real, "ro")
+ s2.set_title("Symbols")
+ s2.set_xlabel("Samples")
+ s2.set_ylabel("Real Part of Signals")
+
+ # Plot the clock recovery loop's error
+ s3 = f1.add_subplot(2,2,3)
+ s3.plot(data_err)
+ s3.set_title("Clock Recovery Loop Error")
+ s3.set_xlabel("Samples")
+ s3.set_ylabel("Error")
+
+ pylab.show()
+
+if __name__ == "__main__":
+ try:
+ main()
+ except KeyboardInterrupt:
+ pass
+
diff --git a/gnuradio-examples/python/digital/gen_whitener.py b/gr-digital/examples/gen_whitener.py
index 9a81e4eaa..9a81e4eaa 100755
--- a/gnuradio-examples/python/digital/gen_whitener.py
+++ b/gr-digital/examples/gen_whitener.py
diff --git a/gnuradio-examples/python/digital/receive_path.py b/gr-digital/examples/receive_path.py
index 0024d6941..1c5e58963 100644
--- a/gnuradio-examples/python/digital/receive_path.py
+++ b/gr-digital/examples/receive_path.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,8 +20,10 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, blks2
+from gnuradio import gr, gru
from gnuradio import eng_notation
+from gnuradio import digital
+
import copy
import sys
@@ -32,26 +34,27 @@ import sys
class receive_path(gr.hier_block2):
def __init__(self, demod_class, rx_callback, options):
gr.hier_block2.__init__(self, "receive_path",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
-
+ gr.io_signature(1, 1, gr.sizeof_gr_complex),
+ gr.io_signature(0, 0, 0))
options = copy.copy(options) # make a copy so we can destructively modify
- self._verbose = options.verbose
- self._bitrate = options.bitrate # desired bit rate
- self._samples_per_symbol = options.samples_per_symbol # desired samples/symbol
+ self._verbose = options.verbose
+ self._bitrate = options.bitrate # desired bit rate
- self._rx_callback = rx_callback # this callback is fired when there's a packet available
- self._demod_class = demod_class # the demodulator_class we're using
+ self._rx_callback = rx_callback # this callback is fired when a packet arrives
+ self._demod_class = demod_class # the demodulator_class we're using
# Get demod_kwargs
demod_kwargs = self._demod_class.extract_kwargs_from_options(options)
+ # Build the demodulator
+ self.demodulator = self._demod_class(**demod_kwargs)
+
# Design filter to get actual channel we want
sw_decim = 1
chan_coeffs = gr.firdes.low_pass (1.0, # gain
- sw_decim * self._samples_per_symbol, # sampling rate
+ sw_decim * self.samples_per_symbol(), # sampling rate
1.0, # midpoint of trans. band
0.5, # width of trans. band
gr.firdes.WIN_HANN) # filter type
@@ -59,10 +62,10 @@ class receive_path(gr.hier_block2):
# receiver
self.packet_receiver = \
- blks2.demod_pkts(self._demod_class(**demod_kwargs),
- access_code=None,
- callback=self._rx_callback,
- threshold=-1)
+ digital.demod_pkts(self.demodulator,
+ access_code=None,
+ callback=self._rx_callback,
+ threshold=-1)
# Carrier Sensing Blocks
alpha = 0.001
@@ -86,7 +89,10 @@ class receive_path(gr.hier_block2):
return self._bitrate
def samples_per_symbol(self):
- return self._samples_per_symbol
+ return self.demodulator._samples_per_symbol
+
+ def differential(self):
+ return self.demodulator._differential
def carrier_sensed(self):
"""
@@ -119,7 +125,7 @@ class receive_path(gr.hier_block2):
normal.add_option("-r", "--bitrate", type="eng_float", default=100e3,
help="specify bitrate [default=%default].")
normal.add_option("-v", "--verbose", action="store_true", default=False)
- expert.add_option("-S", "--samples-per-symbol", type="float", default=None,
+ expert.add_option("-S", "--samples-per-symbol", type="float", default=2,
help="set samples/symbol [default=%default]")
expert.add_option("", "--log", action="store_true", default=False,
help="Log all parts of flow graph to files (CAUTION: lots of data)")
@@ -135,4 +141,5 @@ class receive_path(gr.hier_block2):
print "\nReceive Path:"
print "modulation: %s" % (self._demod_class.__name__)
print "bitrate: %sb/s" % (eng_notation.num_to_str(self._bitrate))
- print "samples/symbol: %.4f" % (self._samples_per_symbol)
+ print "samples/symbol: %.4f" % (self.samples_per_symbol())
+ print "Differential: %s" % (self.differential())
diff --git a/gnuradio-examples/python/digital/run_length.py b/gr-digital/examples/run_length.py
index 5020655db..5020655db 100755
--- a/gnuradio-examples/python/digital/run_length.py
+++ b/gr-digital/examples/run_length.py
diff --git a/gnuradio-examples/python/digital/rx_voice.py b/gr-digital/examples/rx_voice.py
index 1aad1ff8e..b58704e16 100755
--- a/gnuradio-examples/python/digital/rx_voice.py
+++ b/gr-digital/examples/rx_voice.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2009 Free Software Foundation, Inc.
+# Copyright 2005,2006,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,21 +20,21 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, modulation_utils
-from gnuradio import usrp
-from gnuradio import audio
+from gnuradio import gr, blks2, audio, uhd
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from gnuradio.vocoder import gsm_full_rate
+from gnuradio import digital
+from gnuradio import vocoder
import random
import struct
import sys
# from current dir
-import usrp_receive_path
+from receive_path import receive_path
+from uhd_interface import uhd_receiver
#import os
#print os.getpid()
@@ -47,11 +47,12 @@ class audio_tx(gr.hier_block2):
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
+ self.sample_rate = sample_rate = 8000
self.packet_src = gr.message_source(33)
- voice_decoder = gsm_full_rate.decode_ps()
+ voice_decoder = vocoder.gsm_fr_decode_ps()
s2f = gr.short_to_float ()
sink_scale = gr.multiply_const_ff(1.0/32767.)
- audio_sink = audio.sink(8000, audio_output_dev)
+ audio_sink = audio.sink(sample_rate, audio_output_dev)
self.connect(self.packet_src, voice_decoder, s2f, sink_scale, audio_sink)
def msgq(self):
@@ -61,9 +62,33 @@ class audio_tx(gr.hier_block2):
class my_top_block(gr.top_block):
def __init__(self, demod_class, rx_callback, options):
gr.top_block.__init__(self)
- self.rxpath = usrp_receive_path.usrp_receive_path(demod_class, rx_callback, options)
+ self.rxpath = receive_path(demod_class, rx_callback, options)
self.audio_tx = audio_tx(options.audio_output)
- self.connect(self.rxpath)
+
+ if(options.rx_freq is not None):
+ self.source = uhd_receiver(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.rx_freq, options.rx_gain,
+ options.antenna, options.verbose)
+ options.samples_per_symbol = self.source._sps
+
+ audio_rate = self.audio_tx.sample_rate
+ usrp_rate = self.source.get_sample_rate()
+ rrate = audio_rate / usrp_rate
+ self.resampler = blks2.pfb_arb_resampler_ccf(rrate)
+
+ self.connect(self.source, self.resampler, self.rxpath)
+
+ elif(options.from_file is not None):
+ self.thr = gr.throttle(gr.sizeof_gr_complex, options.bitrate)
+ self.source = gr.file_source(gr.sizeof_gr_complex, options.from_file)
+ self.connect(self.source, self.thr, self.rxpath)
+
+ else:
+ self.thr = gr.throttle(gr.sizeof_gr_complex, 1e6)
+ self.source = gr.null_source(gr.sizeof_gr_complex)
+ self.connect(self.source, self.thr, self.rxpath)
+
self.connect(self.audio_tx)
# /////////////////////////////////////////////////////////////////////////////
@@ -89,7 +114,7 @@ def main():
print "ok = %r n_rcvd = %4d n_right = %4d" % (
ok, n_rcvd, n_right)
- demods = modulation_utils.type_1_demods()
+ demods = digital.modulation_utils2.type_1_demods()
# Create Options Parser:
parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
@@ -101,7 +126,10 @@ def main():
% (', '.join(demods.keys()),))
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm output device name. E.g., hw:0,0 or /dev/dsp")
- usrp_receive_path.add_options(parser, expert_grp)
+ 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)
for mod in demods.values():
mod.add_options(expert_grp)
@@ -113,10 +141,11 @@ def main():
parser.print_help(sys.stderr)
sys.exit(1)
- 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)
+ 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
diff --git a/gnuradio-examples/python/digital/transmit_path.py b/gr-digital/examples/transmit_path.py
index 86ebf75c3..3af37f330 100644
--- a/gnuradio-examples/python/digital/transmit_path.py
+++ b/gr-digital/examples/transmit_path.py
@@ -1,5 +1,5 @@
#
-# Copyright 2005, 2006, 2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,8 +19,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, blks2
+from gnuradio import gr, gru
from gnuradio import eng_notation
+from gnuradio import digital
import copy
import sys
@@ -35,28 +36,27 @@ class transmit_path(gr.hier_block2):
See below for what options should hold
'''
gr.hier_block2.__init__(self, "transmit_path",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+ gr.io_signature(0,0,0),
+ gr.io_signature(1,1,gr.sizeof_gr_complex))
options = copy.copy(options) # make a copy so we can destructively modify
- self._verbose = options.verbose
- self._tx_amplitude = options.tx_amplitude # digital amplitude sent to USRP
- self._bitrate = options.bitrate # desired bit rate
- self._samples_per_symbol = options.samples_per_symbol # desired samples/baud
-
- self._modulator_class = modulator_class # the modulator_class we are using
+ self._verbose = options.verbose
+ self._tx_amplitude = options.tx_amplitude # digital amplitude sent to USRP
+ self._bitrate = options.bitrate # desired bit rate
+ self._modulator_class = modulator_class # the modulator_class we are using
# Get mod_kwargs
mod_kwargs = self._modulator_class.extract_kwargs_from_options(options)
-
+
# transmitter
- modulator = self._modulator_class(**mod_kwargs)
+ self.modulator = self._modulator_class(**mod_kwargs)
+
self.packet_transmitter = \
- blks2.mod_pkts(modulator,
- access_code=None,
- msgq_limit=4,
- pad_for_usrp=True)
+ digital.mod_pkts(self.modulator,
+ access_code=None,
+ msgq_limit=4,
+ pad_for_usrp=True)
self.amp = gr.multiply_const_cc(1)
self.set_tx_amplitude(self._tx_amplitude)
@@ -86,7 +86,10 @@ class transmit_path(gr.hier_block2):
return self._bitrate
def samples_per_symbol(self):
- return self._samples_per_symbol
+ return self.modulator._samples_per_symbol
+
+ def differential(self):
+ return self.modulator._differential
def add_options(normal, expert):
"""
@@ -99,7 +102,7 @@ class transmit_path(gr.hier_block2):
help="set transmitter digital amplitude: 0 <= AMPL < 1 [default=%default]")
normal.add_option("-v", "--verbose", action="store_true", default=False)
- expert.add_option("-S", "--samples-per-symbol", type="float", default=None,
+ expert.add_option("-S", "--samples-per-symbol", type="float", default=2,
help="set samples/symbol [default=%default]")
expert.add_option("", "--log", action="store_true", default=False,
help="Log all parts of flow graph to file (CAUTION: lots of data)")
@@ -114,5 +117,5 @@ class transmit_path(gr.hier_block2):
print "Tx amplitude %s" % (self._tx_amplitude)
print "modulation: %s" % (self._modulator_class.__name__)
print "bitrate: %sb/s" % (eng_notation.num_to_str(self._bitrate))
- print "samples/symbol: %.4f" % (self._samples_per_symbol)
-
+ print "samples/symbol: %.4f" % (self.samples_per_symbol())
+ print "Differential: %s" % (self.differential())
diff --git a/gnuradio-examples/python/digital/tunnel.py b/gr-digital/examples/tunnel.py
index b0af721da..d25594df5 100755
--- a/gnuradio-examples/python/digital/tunnel.py
+++ b/gr-digital/examples/tunnel.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2009 Free Software Foundation, Inc.
+# Copyright 2005,2006,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,45 +21,45 @@
#
-# /////////////////////////////////////////////////////////////////////////////
+# ////////////////////////////////////////////////////////////////////
#
-# This code sets up up a virtual ethernet interface (typically gr0),
-# and relays packets between the interface and the GNU Radio PHY+MAC
+# 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.
+# machines, you can talk between them using normal TCP/IP
+# networking.
#
-# /////////////////////////////////////////////////////////////////////////////
+# ////////////////////////////////////////////////////////////////////
-from gnuradio import gr, gru, modulation_utils
-from gnuradio import usrp
+from gnuradio import gr, digital, uhd
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-import random
-import time
-import struct
-import sys
-import os
-
# from current dir
-import usrp_transmit_path
-import usrp_receive_path
+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
+# 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>
@@ -81,9 +81,9 @@ def open_tun_interface(tun_device_filename):
return (tun, ifname)
-# /////////////////////////////////////////////////////////////////////////////
-# the flow graph
-# /////////////////////////////////////////////////////////////////////////////
+# ////////////////////////////////////////////////////////////////////
+# the flow graph
+# ////////////////////////////////////////////////////////////////////
class my_top_block(gr.top_block):
@@ -91,10 +91,23 @@ class my_top_block(gr.top_block):
rx_callback, options):
gr.top_block.__init__(self)
- self.txpath = usrp_transmit_path.usrp_transmit_path(mod_class, options)
- self.rxpath = usrp_receive_path.usrp_receive_path(demod_class, rx_callback, options)
- self.connect(self.txpath)
- self.connect(self.rxpath)
+
+ self.source = uhd_receiver(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.rx_freq, options.rx_gain,
+ options.antenna, options.verbose)
+
+ self.sink = uhd_transmitter(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.tx_freq, options.tx_gain,
+ options.antenna, options.verbose)
+
+ options.samples_per_symbol = self.source._sps
+
+ self.txpath = transmit_path(mod_class, options)
+ self.rxpath = receive_path(demod_class, rx_callback, options)
+ self.connect(self.txpath, self.sink)
+ self.connect(self.source, self.rxpath)
def send_pkt(self, payload='', eof=False):
return self.txpath.send_pkt(payload, eof)
@@ -106,21 +119,22 @@ class my_top_block(gr.top_block):
return self.rxpath.carrier_sensed()
-# /////////////////////////////////////////////////////////////////////////////
+# ////////////////////////////////////////////////////////////////////
# 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.
+ 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.
+ 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
@@ -175,28 +189,28 @@ class cs_mac(object):
def main():
- mods = modulation_utils.type_1_mods()
- demods = modulation_utils.type_1_demods()
+ mods = digital.modulation_utils2.type_1_mods()
+ demods = digital.modulation_utils2.type_1_demods()
parser = OptionParser (option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
- expert_grp.add_option("", "--rx-freq", type="eng_float", default=None,
- help="set Rx frequency to FREQ [default=%default]", metavar="FREQ")
- expert_grp.add_option("", "--tx-freq", type="eng_float", default=None,
- help="set transmit frequency to FREQ [default=%default]", metavar="FREQ")
parser.add_option("-m", "--modulation", type="choice", choices=mods.keys(),
default='gmsk',
help="Select modulation from: %s [default=%%default]"
% (', '.join(mods.keys()),))
+ parser.add_option("-s", "--size", type="eng_float", default=1500,
+ help="set packet size [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]")
- usrp_transmit_path.add_options(parser, expert_grp)
- usrp_receive_path.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)
for mod in mods.values():
mod.add_options(expert_grp)
@@ -220,25 +234,9 @@ def main():
realtime = False
print "Note: failed to enable realtime scheduling"
-
- # If the user hasn't set the fusb_* parameters on the command line,
- # pick some values that will reduce latency.
-
- if options.fusb_block_size == 0 and options.fusb_nblocks == 0:
- if realtime: # be more aggressive
- options.fusb_block_size = gr.prefs().get_long('fusb', 'rt_block_size', 1024)
- options.fusb_nblocks = gr.prefs().get_long('fusb', 'rt_nblocks', 16)
- else:
- options.fusb_block_size = gr.prefs().get_long('fusb', 'block_size', 4096)
- options.fusb_nblocks = gr.prefs().get_long('fusb', 'nblocks', 16)
-
- #print "fusb_block_size =", options.fusb_block_size
- #print "fusb_nblocks =", options.fusb_nblocks
-
# instantiate the MAC
mac = cs_mac(tun_fd, verbose=True)
-
# build the graph (PHY)
tb = my_top_block(mods[options.modulation],
demods[options.modulation],
@@ -256,8 +254,6 @@ def main():
print "freq: %s" % (eng_notation.num_to_str(options.tx_freq))
print "bitrate: %sb/sec" % (eng_notation.num_to_str(tb.txpath.bitrate()),)
print "samples/symbol: %3d" % (tb.txpath.samples_per_symbol(),)
- #print "interp: %3d" % (tb.txpath.interp(),)
- #print "decim: %3d" % (tb.rxpath.decim(),)
tb.rxpath.set_carrier_threshold(options.carrier_threshold)
print "Carrier sense threshold:", options.carrier_threshold, "dB"
diff --git a/gnuradio-examples/python/digital/tx_voice.py b/gr-digital/examples/tx_voice.py
index d8692beb4..eabb5e3c3 100755
--- a/gnuradio-examples/python/digital/tx_voice.py
+++ b/gr-digital/examples/tx_voice.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
+# Copyright 2005-2007,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,14 +20,13 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, modulation_utils
-from gnuradio import usrp
-from gnuradio import audio
+from gnuradio import gr, blks2, audio, uhd
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from gnuradio.vocoder import gsm_full_rate
+from gnuradio import digital
+from gnuradio import vocoder
import random
import time
@@ -35,7 +34,8 @@ import struct
import sys
# from current dir
-import usrp_transmit_path
+from transmit_path import transmit_path
+from uhd_interface import uhd_transmitter
#import os
#print os.getpid()
@@ -47,11 +47,11 @@ class audio_rx(gr.hier_block2):
gr.hier_block2.__init__(self, "audio_rx",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
- sample_rate = 8000
+ self.sample_rate = sample_rate = 8000
src = audio.source(sample_rate, audio_input_dev)
src_scale = gr.multiply_const_ff(32767)
f2s = gr.float_to_short()
- voice_coder = gsm_full_rate.encode_sp()
+ voice_coder = vocoder.gsm_fr_encode_sp()
self.packets_from_encoder = gr.msg_queue()
packet_sink = gr.message_sink(33, self.packets_from_encoder, False)
self.connect(src, src_scale, f2s, voice_coder, packet_sink)
@@ -64,11 +64,31 @@ class my_top_block(gr.top_block):
def __init__(self, modulator_class, options):
gr.top_block.__init__(self)
- self.txpath = usrp_transmit_path.usrp_transmit_path(modulator_class, options)
+ self.txpath = transmit_path(modulator_class, options)
self.audio_rx = audio_rx(options.audio_input)
- self.connect(self.txpath)
- self.connect(self.audio_rx)
+ if(options.tx_freq is not None):
+ self.sink = uhd_transmitter(options.address, options.bitrate,
+ options.samples_per_symbol,
+ options.tx_freq, options.tx_gain,
+ options.antenna, options.verbose)
+ options.samples_per_symbol = self.sink._sps
+ audio_rate = self.audio_rx.sample_rate
+ usrp_rate = self.sink.get_sample_rate()
+ rrate = usrp_rate / audio_rate
+
+ elif(options.to_file is not None):
+ self.sink = gr.file_sink(gr.sizeof_gr_complex, options.to_file)
+ rrate = 1
+ else:
+ self.sink = gr.null_sink(gr.sizeof_gr_complex)
+ rrate = 1
+
+ self.resampler = blks2.pfb_arb_resampler_ccf(rrate)
+
+ self.connect(self.audio_rx)
+ self.connect(self.txpath, self.resampler, self.sink)
+
# /////////////////////////////////////////////////////////////////////////////
# main
@@ -82,7 +102,7 @@ def main():
def rx_callback(ok, payload):
print "ok = %r, payload = '%s'" % (ok, payload)
- mods = modulation_utils.type_1_mods()
+ mods = digital.modulation_utils2.type_1_mods()
parser = OptionParser(option_class=eng_option, conflict_handler="resolve")
expert_grp = parser.add_option_group("Expert")
@@ -95,7 +115,11 @@ def main():
help="set megabytes to transmit [default=inf]")
parser.add_option("-I", "--audio-input", type="string", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
- usrp_transmit_path.add_options(parser, expert_grp)
+ parser.add_option("","--to-file", default=None,
+ help="Output file for modulated samples")
+
+ transmit_path.add_options(parser, expert_grp)
+ uhd_transmitter.add_options(parser)
for mod in mods.values():
mod.add_options(expert_grp)
@@ -107,11 +131,11 @@ def main():
parser.print_help()
sys.exit(1)
- if 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)
-
+ if options.to_file is None:
+ if 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)
# build the graph
tb = my_top_block(mods[options.modulation], options)
diff --git a/gr-digital/examples/uhd_interface.py b/gr-digital/examples/uhd_interface.py
new file mode 100644
index 000000000..8420f3eec
--- /dev/null
+++ b/gr-digital/examples/uhd_interface.py
@@ -0,0 +1,219 @@
+#!/usr/bin/env python
+#
+# Copyright 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,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, uhd
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+
+import sys
+
+def add_freq_option(parser):
+ """
+ Hackery that has the -f / --freq option set both tx_freq and rx_freq
+ """
+ def freq_callback(option, opt_str, value, parser):
+ parser.values.rx_freq = value
+ parser.values.tx_freq = value
+
+ if not parser.has_option('--freq'):
+ parser.add_option('-f', '--freq', type="eng_float",
+ action="callback", callback=freq_callback,
+ help="set Tx and/or Rx frequency to FREQ [default=%default]",
+ metavar="FREQ")
+
+class uhd_interface:
+ def __init__(self, istx, address, bitrate, sps, freq=None,
+ gain=None, antenna=None):
+
+ if(istx):
+ self.u = uhd.usrp_sink(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+ else:
+ self.u = uhd.usrp_source(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self._addr = address
+ self._ant = antenna
+ self._gain = self.set_gain(gain)
+ self._freq = self.set_freq(freq)
+
+ self._rate, self._sps = self.set_sample_rate(bitrate, sps)
+
+ if(antenna):
+ self.u.set_antenna(antenna, 0)
+
+ def set_sample_rate(self, bitrate, req_sps):
+ start_sps = req_sps
+ while(True):
+ asked_samp_rate = bitrate * req_sps
+ self.u.set_samp_rate(asked_samp_rate)
+ actual_samp_rate = self.u.get_samp_rate()
+
+ sps = actual_samp_rate/bitrate
+ if(sps < 2):
+ req_sps +=1
+ else:
+ actual_sps = sps
+ break
+
+ if(sps != req_sps):
+ print "\nBit Rate: %f" % (bitrate)
+ print "Requested sps: %f" % (start_sps)
+ print "Given sample rate: %f" % (actual_samp_rate)
+ print "Actual sps for rate: %f" % (actual_sps)
+
+ if(actual_samp_rate != asked_samp_rate):
+ print "\nRequested sample rate: %f" % (asked_samp_rate)
+ print "Actual sample rate: %f" % (actual_samp_rate)
+
+ return (actual_samp_rate, actual_sps)
+
+ def get_sample_rate(self):
+ return self.u.get_samp_rate()
+
+ def set_gain(self, gain=None):
+ if gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ gain = float(g.start()+g.stop())/2
+ print "\nNo gain specified."
+ print "Setting gain to %f (from [%f, %f])" % \
+ (gain, g.start(), g.stop())
+
+ self.u.set_gain(gain, 0)
+ return gain
+
+ def set_freq(self, freq=None):
+ if(freq is None):
+ sys.stderr.write("You must specify -f FREQ or --freq FREQ\n")
+ sys.exit(1)
+
+ r = self.u.set_center_freq(freq, 0)
+ if r:
+ return freq
+ else:
+ frange = self.u.get_freq_range()
+ sys.stderr.write(("\nRequested frequency (%f) out or range [%f, %f]\n") % \
+ (freq, frange.start(), frange.stop()))
+ sys.exit(1)
+
+#-------------------------------------------------------------------#
+# TRANSMITTER
+#-------------------------------------------------------------------#
+
+class uhd_transmitter(uhd_interface, gr.hier_block2):
+ def __init__(self, address, bitrate, sps, freq=None, gain=None,
+ antenna=None, verbose=False):
+ gr.hier_block2.__init__(self, "uhd_transmitter",
+ gr.io_signature(1,1,gr.sizeof_gr_complex),
+ gr.io_signature(0,0,0))
+
+ # Set up the UHD interface as a transmitter
+ uhd_interface.__init__(self, True, address, bitrate, sps,
+ freq, gain, antenna)
+
+ self.connect(self, self.u)
+
+ if(verbose):
+ self._print_verbage()
+
+ def add_options(parser):
+ add_freq_option(parser)
+ parser.add_option("-a", "--address", type="string", default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("", "--tx-freq", type="eng_float", default=None,
+ help="set transmit frequency to FREQ [default=%default]",
+ metavar="FREQ")
+ parser.add_option("", "--tx-gain", type="eng_float", default=None,
+ help="set transmit gain in dB (default is midpoint)")
+ parser.add_option("-v", "--verbose", action="store_true", default=False)
+
+ # Make a static method to call before instantiation
+ add_options = staticmethod(add_options)
+
+ def _print_verbage(self):
+ """
+ Prints information about the UHD transmitter
+ """
+ print "\nUHD Transmitter:"
+ print "Address: %s" % (self._addr)
+ print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
+ print "Gain: %f dB" % (self._gain)
+ print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
+ print "Antenna: %s" % (self._ant)
+
+
+
+#-------------------------------------------------------------------#
+# RECEIVER
+#-------------------------------------------------------------------#
+
+
+class uhd_receiver(uhd_interface, gr.hier_block2):
+ def __init__(self, address, bitrate, sps, freq=None, gain=None,
+ antenna=None, verbose=False):
+ gr.hier_block2.__init__(self, "uhd_receiver",
+ gr.io_signature(0,0,0),
+ gr.io_signature(1,1,gr.sizeof_gr_complex))
+
+ # Set up the UHD interface as a receiver
+ uhd_interface.__init__(self, False, address, bitrate, sps,
+ freq, gain, antenna)
+
+ self.connect(self.u, self)
+
+ if(verbose):
+ self._print_verbage()
+
+ def add_options(parser):
+ add_freq_option(parser)
+ parser.add_option("-a", "--address", type="string", default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("", "--rx-freq", type="eng_float", default=None,
+ help="set receive frequency to FREQ [default=%default]",
+ metavar="FREQ")
+ parser.add_option("", "--rx-gain", type="eng_float", default=None,
+ help="set receive gain in dB (default is midpoint)")
+ if not parser.has_option("--verbose"):
+ parser.add_option("-v", "--verbose", action="store_true", default=False)
+
+ # Make a static method to call before instantiation
+ add_options = staticmethod(add_options)
+
+ def _print_verbage(self):
+ """
+ Prints information about the UHD transmitter
+ """
+ print "\nUHD Receiver:"
+ print "Address: %s" % (self._addr)
+ print "Freq: %sHz" % (eng_notation.num_to_str(self._freq))
+ print "Gain: %f dB" % (self._gain)
+ print "Sample Rate: %ssps" % (eng_notation.num_to_str(self._rate))
+ print "Antenna: %s" % (self._ant)
+
diff --git a/gr-msdd6000/gnuradio-msdd6000.pc.in b/gr-digital/gnuradio-digital.pc.in
index 565420718..6c0a7ccf8 100644
--- a/gr-msdd6000/gnuradio-msdd6000.pc.in
+++ b/gr-digital/gnuradio-digital.pc.in
@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: gnuradio-comedi
-Description: GNU Radio blocks for the Softronics MSDD 6000
+Name: gnuradio-digital
+Description: GNU Radio blocks for digital communications
Requires: gnuradio-core
Version: @LIBVER@
-Libs: -L${libdir} -lgnuradio-msdd6000
+Libs: -L${libdir} -lgnuradio-digital
Cflags: -I${includedir}
diff --git a/gr-digital/grc/.gitignore b/gr-digital/grc/.gitignore
new file mode 100644
index 000000000..3dda72986
--- /dev/null
+++ b/gr-digital/grc/.gitignore
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile
diff --git a/gr-digital/grc/Makefile.am b/gr-digital/grc/Makefile.am
new file mode 100644
index 000000000..e4426e721
--- /dev/null
+++ b/gr-digital/grc/Makefile.am
@@ -0,0 +1,43 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+grcblocksdir = $(grc_blocksdir)
+
+dist_grcblocks_DATA = \
+ digital_block_tree.xml \
+ digital_binary_slicer_fb.xml \
+ digital_clock_recovery_mm_xx.xml \
+ digital_constellation_decoder_cb.xml \
+ digital_correlate_access_code_bb.xml \
+ digital_costas_loop_cc.xml \
+ digital_cma_equalizer_cc.xml \
+ digital_fll_band_edge_cc.xml \
+ digital_kurtotic_equalizer_cc.xml \
+ digital_lms_dd_equalizer_cc.xml \
+ digital_mpsk_receiver_cc.xml \
+ digital_dxpsk_mod.xml \
+ digital_dxpsk_demod.xml \
+ digital_psk_mod.xml \
+ digital_psk_demod.xml \
+ digital_qam_mod.xml \
+ digital_qam_demod.xml
diff --git a/grc/blocks/gr_binary_slicer_fb.xml b/gr-digital/grc/digital_binary_slicer_fb.xml
index 85d71e709..3187d13f9 100644
--- a/grc/blocks/gr_binary_slicer_fb.xml
+++ b/gr-digital/grc/digital_binary_slicer_fb.xml
@@ -6,9 +6,9 @@
-->
<block>
<name>Binary Slicer</name>
- <key>gr_binary_slicer_fb</key>
- <import>from gnuradio import gr</import>
- <make>gr.binary_slicer_fb()</make>
+ <key>digital_binary_slicer_fb</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.binary_slicer_fb()</make>
<sink>
<name>in</name>
<type>float</type>
diff --git a/gr-digital/grc/digital_block_tree.xml b/gr-digital/grc/digital_block_tree.xml
new file mode 100644
index 000000000..088fe1c10
--- /dev/null
+++ b/gr-digital/grc/digital_block_tree.xml
@@ -0,0 +1,53 @@
+<?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.
+-->
+
+<!--
+###################################################
+##Block Tree for GR Digital blocks.
+###################################################
+ -->
+<cat>
+ <name></name> <!-- Blank for Root Name -->
+ <cat>
+ <name>Digital</name>
+ <block>digital_binary_slicer_fb</block>
+ <block>digital_clock_recovery_mm_xx</block>
+ <block>digital_cma_equalizer_cc</block>
+ <block>digital_constellation_decoder_cb</block>
+ <block>digital_correlate_access_code_bb</block>
+ <block>digital_costas_loop_cc</block>
+ <block>digital_fll_band_edge_cc</block>
+ <block>digital_kurtotic_equalizer_cc</block>
+ <block>digital_lms_dd_equalizer_cc</block>
+ <block>digital_mpsk_receiver_cc</block>
+ </cat>
+ <cat>
+ <name>Digital Modulators</name>
+ <block>digital_dxpsk_mod</block>
+ <block>digital_dxpsk_demod</block>
+ <block>digital_psk_mod</block>
+ <block>digital_psk_demod</block>
+ <block>digital_qam_mod</block>
+ <block>digital_qam_demod</block>
+ </cat>
+</cat>
diff --git a/grc/blocks/gr_clock_recovery_mm_xx.xml b/gr-digital/grc/digital_clock_recovery_mm_xx.xml
index 613cc23bf..d9c5ea4ff 100644
--- a/grc/blocks/gr_clock_recovery_mm_xx.xml
+++ b/gr-digital/grc/digital_clock_recovery_mm_xx.xml
@@ -6,9 +6,9 @@
-->
<block>
<name>Clock Recovery MM</name>
- <key>gr_clock_recovery_mm_xx</key>
- <import>from gnuradio import gr</import>
- <make>gr.clock_recovery_mm_$(type.fcn)($omega, $gain_omega, $mu, $gain_mu, $omega_relative_limit)</make>
+ <key>digital_clock_recovery_mm_xx</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.clock_recovery_mm_$(type.fcn)($omega, $gain_omega, $mu, $gain_mu, $omega_relative_limit)</make>
<callback>set_omega($omega)</callback>
<callback>set_gain_omega($gain_omega)</callback>
<callback>set_mu($mu)</callback>
diff --git a/gr-digital/grc/digital_cma_equalizer_cc.xml b/gr-digital/grc/digital_cma_equalizer_cc.xml
new file mode 100644
index 000000000..118c18e29
--- /dev/null
+++ b/gr-digital/grc/digital_cma_equalizer_cc.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## CMA Equalizer
+###################################################
+ -->
+<block>
+ <name>CMA Equalizer</name>
+ <key>digital_cma_equalizer_cc</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.cma_equalizer_cc($num_taps, $modulus, $mu, $sps)</make>
+ <callback>set_gain($mu)</callback>
+ <callback>set_modulus($modulus)</callback>
+ <param>
+ <name>Num. Taps</name>
+ <key>num_taps</key>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Modulus</name>
+ <key>modulus</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Gain</name>
+ <key>mu</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Samples per Symbol</name>
+ <key>sps</key>
+ <type>int</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/grc/blocks/gr_constellation_decoder_cb.xml b/gr-digital/grc/digital_constellation_decoder_cb.xml
index 99d897a3a..c7353e288 100644
--- a/grc/blocks/gr_constellation_decoder_cb.xml
+++ b/gr-digital/grc/digital_constellation_decoder_cb.xml
@@ -6,18 +6,13 @@
-->
<block>
<name>Constellation Decoder</name>
- <key>gr_constellation_decoder_cb</key>
- <import>from gnuradio import gr</import>
- <make>gr.constellation_decoder_cb($sym_position, $sym_value_out)</make>
+ <key>digital_constellation_decoder_cb</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.constellation_decoder_cb($constellation)</make>
<param>
- <name>Symbol Position</name>
- <key>sym_position</key>
- <type>complex_vector</type>
- </param>
- <param>
- <name>Symbol Value Out</name>
- <key>sym_value_out</key>
- <type>int_vector</type>
+ <name>Constellation Object</name>
+ <key>constellation</key>
+ <type>raw</type>
</param>
<sink>
<name>in</name>
diff --git a/grc/blocks/gr_correlate_access_code_bb.xml b/gr-digital/grc/digital_correlate_access_code_bb.xml
index e13d2d070..3941834c4 100644
--- a/grc/blocks/gr_correlate_access_code_bb.xml
+++ b/gr-digital/grc/digital_correlate_access_code_bb.xml
@@ -6,9 +6,9 @@
-->
<block>
<name>Correlate Access Code</name>
- <key>gr_correlate_access_code_bb</key>
- <import>from gnuradio import gr</import>
- <make>gr.correlate_access_code_bb($access_code, $threshold)</make>
+ <key>digital_correlate_access_code_bb</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.correlate_access_code_bb($access_code, $threshold)</make>
<param>
<name>Access Code</name>
<key>access_code</key>
diff --git a/gr-digital/grc/digital_costas_loop_cc.xml b/gr-digital/grc/digital_costas_loop_cc.xml
new file mode 100644
index 000000000..668c43dec
--- /dev/null
+++ b/gr-digital/grc/digital_costas_loop_cc.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+##Costas Loop
+###################################################
+ -->
+<block>
+ <name>Costas Loop</name>
+ <key>digital_costas_loop_cc</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.costas_loop_cc($w, $order)</make>
+ <callback>set_loop_bandwidth($w)</callback>
+ <param>
+ <name>Loop Bandwidth</name>
+ <key>w</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Order</name>
+ <key>order</key>
+ <type>int</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+
+ <!-- Optional Outputs -->
+ <source>
+ <name>frequency</name>
+ <type>float</type>
+ <optional>1</optional>
+ </source>
+</block>
diff --git a/grc/blocks/blks2_dxpsk2_demod.xml b/gr-digital/grc/digital_dxpsk_demod.xml
index 7fe4be32b..d5e742097 100644
--- a/grc/blocks/blks2_dxpsk2_demod.xml
+++ b/gr-digital/grc/digital_dxpsk_demod.xml
@@ -1,28 +1,46 @@
<?xml version="1.0"?>
+
+<!--
+ Copyright 2009,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,
+ Boston, MA 02110-1301, USA.
+-->
+
<!--
###################################################
-##DPSK2 Demod - 2, 4
+##DPSK2 Mod - 2, 4, 8
###################################################
-->
<block>
- <name>DPSK2 Demod</name>
- <key>blks2_dxpsk2_demod</key>
- <import>from gnuradio import blks2</import>
- <make>blks2.$(type)2_demod(
+ <name>DPSK Demod</name>
+ <key>digital_dxpsk_demod</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.$(type)_demod(
samples_per_symbol=$samples_per_symbol,
excess_bw=$excess_bw,
- freq_alpha=$freq_alpha,
- phase_alpha=$phase_alpha,
- timing_alpha=$timing_alpha,
- timing_max_dev=$timing_max_dev,
- gray_code=$gray_code,
+ phase_bw=$phase_bw,
+ timing_bw=$timing_bw,
+ gray_coded=$gray_coded,
verbose=$verbose,
- log=$log,
- sync_out=$sync_out,
+ log=$log
)</make>
- <callback>clock_recov.set_alpha($costas_alpha)</callback>
- <callback>clock_recov.set_beta(0.25*$costas_alpha**2)</callback>
- <callback>time_recov.set_alpha($timing_alpha)</callback>
+ <callback>clock_recov.set_loop_bandwidth($phase_bw)</callback>
+ <callback>time_recov.set_loop_bandwidth($timing_bw)</callback>
<param>
<name>Type</name>
<key>type</key>
@@ -49,27 +67,15 @@
<type>real</type>
</param>
<param>
- <name>FLL Alpha</name>
- <key>freq_alpha</key>
- <value>0.010</value>
- <type>real</type>
- </param>
- <param>
- <name>Phase Alpha</name>
- <key>phase_alpha</key>
- <value>0.100</value>
- <type>real</type>
- </param>
- <param>
- <name>Timing Alpha</name>
- <key>timing_alpha</key>
- <value>0.100</value>
+ <name>Phase Loop Bandwidth</name>
+ <key>phase_bw</key>
+ <value>6.28/100.0</value>
<type>real</type>
</param>
<param>
- <name>Timing Max Dev</name>
- <key>timing_max_dev</key>
- <value>1.5</value>
+ <name>Timing Bandwidth</name>
+ <key>timing_bw</key>
+ <value>6.28/100.0</value>
<type>real</type>
</param>
<param>
@@ -80,7 +86,7 @@
</param>
<param>
<name>Gray Code</name>
- <key>gray_code</key>
+ <key>gray_coded</key>
<value>True</value>
<type>bool</type>
<option>
@@ -144,9 +150,4 @@
<name>out</name>
<type>byte</type>
</source>
- <source>
- <name>sync</name>
- <type>complex</type>
- <optional>1</optional>
- </source>
</block>
diff --git a/grc/blocks/blks2_dxpsk_mod.xml b/gr-digital/grc/digital_dxpsk_mod.xml
index 77505d8ad..fbda9fb1f 100644
--- a/grc/blocks/blks2_dxpsk_mod.xml
+++ b/gr-digital/grc/digital_dxpsk_mod.xml
@@ -1,20 +1,42 @@
<?xml version="1.0"?>
+
+<!--
+ Copyright 2009,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,
+ Boston, MA 02110-1301, USA.
+-->
+
<!--
###################################################
-##DPSK Mod - 2, 4, 8
+## DPSK Mod - 2, 4, 8
###################################################
-->
<block>
<name>DPSK Mod</name>
- <key>blks2_dxpsk_mod</key>
- <import>from gnuradio import blks2</import>
- <make>blks2.$(type)_mod(
+ <key>digital_dxpsk_mod</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.$(type)_mod(
samples_per_symbol=$samples_per_symbol,
excess_bw=$excess_bw,
- gray_code=$gray_code,
+ gray_coded=$gray_coded,
verbose=$verbose,
- log=$log,
-)</make>
+ log=$log)
+ </make>
<param>
<name>Type</name>
<key>type</key>
@@ -46,7 +68,7 @@
</param>
<param>
<name>Gray Code</name>
- <key>gray_code</key>
+ <key>gray_coded</key>
<value>True</value>
<type>bool</type>
<option>
diff --git a/grc/blocks/gr_fll_band_edge_cc.xml b/gr-digital/grc/digital_fll_band_edge_cc.xml
index 5a13ac49b..e4da773db 100644
--- a/grc/blocks/gr_fll_band_edge_cc.xml
+++ b/gr-digital/grc/digital_fll_band_edge_cc.xml
@@ -6,12 +6,10 @@
-->
<block>
<name>FLL Band-Edge</name>
- <key>gr_fll_band_edge_cc</key>
- <import>from gnuradio import gr</import>
- <make>gr.fll_band_edge_cc($samps_per_sym, $rolloff, $filter_size, $alpha, $beta)</make>
- <callback>set_alpha($alpha)</callback>
- <callback>set_beta($beta)</callback>
-
+ <key>digital_fll_band_edge_cc</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.fll_band_edge_cc($samps_per_sym, $rolloff, $filter_size, $w)</make>
+ <callback>set_loop_bandwidth($w)</callback>
<param>
<name>Type</name>
<key>type</key>
@@ -41,15 +39,11 @@
</param>
<param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
+ <name>Loop Bandwidth</name>
+ <key>w</key>
<type>real</type>
</param>
+
<sink>
<name>in</name>
<type>$type.input</type>
diff --git a/grc/blocks/gr_cma_equalizer_cc.xml b/gr-digital/grc/digital_kurtotic_equalizer_cc.xml
index 142fb6d81..8c4a2012d 100644
--- a/grc/blocks/gr_cma_equalizer_cc.xml
+++ b/gr-digital/grc/digital_kurtotic_equalizer_cc.xml
@@ -1,26 +1,21 @@
<?xml version="1.0"?>
<!--
###################################################
-##CMA Equalizer
+## Kurtotic Equalizer
###################################################
-->
<block>
- <name>CMA Equalizer</name>
- <key>gr_cma_equalizer_cc</key>
- <import>from gnuradio import gr</import>
- <make>gr.cma_equalizer_cc($num_taps, $modulus, $mu)</make>
+ <name>Kurtotic Equalizer</name>
+ <key>digital_kurtotic_equalizer_cc</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.kurtotic_equalizer_cc($num_taps, $mu)</make>
+ <callback>set_gain($mu)</callback>
<param>
- <name>Num Taps</name>
+ <name>Num. Taps</name>
<key>num_taps</key>
- <value>64</value>
<type>int</type>
</param>
<param>
- <name>Modulus</name>
- <key>modulus</key>
- <type>real</type>
- </param>
- <param>
<name>Mu</name>
<key>mu</key>
<type>real</type>
diff --git a/gr-digital/grc/digital_lms_dd_equalizer_cc.xml b/gr-digital/grc/digital_lms_dd_equalizer_cc.xml
new file mode 100644
index 000000000..0fd7d523b
--- /dev/null
+++ b/gr-digital/grc/digital_lms_dd_equalizer_cc.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## LMS DD Equalizer
+###################################################
+ -->
+<block>
+ <name>LMS DD Equalizer</name>
+ <key>digital_lms_dd_equalizer_cc</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.lms_dd_equalizer_cc($num_taps, $mu, $sps, $cnst)</make>
+ <callback>set_gain($mu)</callback>
+ <param>
+ <name>Gain</name>
+ <key>mu</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Num. Taps</name>
+ <key>num_taps</key>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Samples per Symbol</name>
+ <key>sps</key>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Constellation Object</name>
+ <key>cnst</key>
+ <type>raw</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/grc/blocks/gr_mpsk_receiver_cc.xml b/gr-digital/grc/digital_mpsk_receiver_cc.xml
index 843c3a4c1..ab7e5c209 100644
--- a/grc/blocks/gr_mpsk_receiver_cc.xml
+++ b/gr-digital/grc/digital_mpsk_receiver_cc.xml
@@ -6,11 +6,10 @@
-->
<block>
<name>MPSK Receiver</name>
- <key>gr_mpsk_receiver_cc</key>
- <import>from gnuradio import gr</import>
- <make>gr.mpsk_receiver_cc($M, $theta, $alpha, $beta, $fmin, $fmax, $mu, $gain_mu, $omega, $gain_omega, $omega_relative_limit)</make>
- <callback>set_alpha($alpha)</callback>
- <callback>set_beta($beta)</callback>
+ <key>digital_mpsk_receiver_cc</key>
+ <import>from gnuradio import digital</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>
@@ -26,13 +25,8 @@
<type>real</type>
</param>
<param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
+ <name>Loop Bandwidth</name>
+ <key>w</key>
<type>real</type>
</param>
<param>
diff --git a/gr-digital/grc/digital_psk_demod.xml b/gr-digital/grc/digital_psk_demod.xml
new file mode 100644
index 000000000..b2628ac88
--- /dev/null
+++ b/gr-digital/grc/digital_psk_demod.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2009,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,
+ Boston, MA 02110-1301, USA.
+-->
+
+<!--
+###################################################
+##PSK Demod
+###################################################
+ -->
+<block>
+ <name>PSK Demod</name>
+ <key>digital_psk_demod</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.psk.psk_demod(
+ constellation_points=$constellation_points,
+ mod_code=$mod_code,
+ differential=$differential,
+ samples_per_symbol=$samples_per_symbol,
+ excess_bw=$excess_bw,
+ freq_alpha=$freq_alpha,
+ timing_alpha=$timing_alpha,
+ timing_max_dev=$timing_max_dev,
+ phase_alpha=$phase_alpha,
+ verbose=$verbose,
+ log=$log,
+ )</make>
+ <param>
+ <name>Number of Constellation Points</name>
+ <key>constellation_points</key>
+ <value>8</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Gray Code</name>
+ <key>mod_code</key>
+ <type>enum</type>
+ <option>
+ <name>Yes</name>
+ <key>gray</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>none</key>
+ </option>
+ </param>
+ <param>
+ <name>Differential Encoding</name>
+ <key>differential</key>
+ <value>True</value>
+ <type>bool</type>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Excess BW</name>
+ <key>excess_bw</key>
+ <value>0.35</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Frequency Alpha</name>
+ <key>freq_alpha</key>
+ <value>0.01</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Timing Alpha</name>
+ <key>timing_alpha</key>
+ <value>0.100</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Timing Max Dev</name>
+ <key>timing_max_dev</key>
+ <value>1.5</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Phase Alpha</name>
+ <key>phase_alpha</key>
+ <value>0.1</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>byte</type>
+ </source>
+ <source>
+ <name>sync</name>
+ <type>complex</type>
+ <optional>1</optional>
+ </source>
+</block>
diff --git a/gr-digital/grc/digital_psk_mod.xml b/gr-digital/grc/digital_psk_mod.xml
new file mode 100644
index 000000000..34ed42c97
--- /dev/null
+++ b/gr-digital/grc/digital_psk_mod.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2009,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,
+ Boston, MA 02110-1301, USA.
+-->
+
+<!--
+###################################################
+##PSK Mod
+###################################################
+ -->
+<block>
+ <name>PSK Mod</name>
+ <key>digital_psk_mod</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.psk2.psk_mod(
+ constellation_points=$constellation_points,
+ mod_code=$mod_code,
+ differential=$differential,
+ samples_per_symbol=$samples_per_symbol,
+ excess_bw=$excess_bw,
+ verbose=$verbose,
+ log=$log,
+ )</make>
+ <param>
+ <name>Number of Constellation Points</name>
+ <key>constellation_points</key>
+ <value>8</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Gray Code</name>
+ <key>mod_code</key>
+ <type>enum</type>
+ <option>
+ <name>Yes</name>
+ <key>"gray"</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>"none"</key>
+ </option>
+ </param>
+ <param>
+ <name>Differential Encoding</name>
+ <key>differential</key>
+ <value>True</value>
+ <type>bool</type>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Excess BW</name>
+ <key>excess_bw</key>
+ <value>0.35</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>byte</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/gr-digital/grc/digital_qam_demod.xml b/gr-digital/grc/digital_qam_demod.xml
new file mode 100644
index 000000000..88b20293e
--- /dev/null
+++ b/gr-digital/grc/digital_qam_demod.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2009,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,
+ Boston, MA 02110-1301, USA.
+-->
+
+<!--
+###################################################
+##QAM Demod
+###################################################
+ -->
+<block>
+ <name>QAM Demod</name>
+ <key>digital_qam_demod</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.qam.qam_demod(
+ constellation_points=$constellation_points,
+ mod_code=$mod_code,
+ differential=$differential,
+ samples_per_symbol=$samples_per_symbol,
+ excess_bw=$excess_bw,
+ freq_alpha=$freq_alpha,
+ timing_alpha=$timing_alpha,
+ timing_max_dev=$timing_max_dev,
+ phase_alpha=$phase_alpha,
+ verbose=$verbose,
+ log=$log,
+ )</make>
+ <param>
+ <name>Number of Constellation Points</name>
+ <key>constellation_points</key>
+ <value>16</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Gray Code</name>
+ <key>mod_code</key>
+ <type>enum</type>
+ <option>
+ <name>Yes</name>
+ <key>gray</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>none</key>
+ </option>
+ </param>
+ <param>
+ <name>Differential Encoding</name>
+ <key>differential</key>
+ <value>True</value>
+ <type>bool</type>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Excess BW</name>
+ <key>excess_bw</key>
+ <value>0.35</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Frequency Alpha</name>
+ <key>freq_alpha</key>
+ <value>0.01</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Timing Alpha</name>
+ <key>timing_alpha</key>
+ <value>0.100</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Timing Max Dev</name>
+ <key>timing_max_dev</key>
+ <value>1.5</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Phase Alpha</name>
+ <key>phase_alpha</key>
+ <value>0.1</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>complex</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>byte</type>
+ </source>
+ <source>
+ <name>sync</name>
+ <type>complex</type>
+ <optional>1</optional>
+ </source>
+</block>
diff --git a/gr-digital/grc/digital_qam_mod.xml b/gr-digital/grc/digital_qam_mod.xml
new file mode 100644
index 000000000..4d73d9a68
--- /dev/null
+++ b/gr-digital/grc/digital_qam_mod.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2009,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,
+ Boston, MA 02110-1301, USA.
+-->
+
+<!--
+###################################################
+##QAM Mod
+###################################################
+ -->
+<block>
+ <name>QAM Mod</name>
+ <key>digital_qam_mod</key>
+ <import>from gnuradio import digital</import>
+ <make>digital.qam.qam_mod(
+ constellation_points=$constellation_points,
+ mod_code=$mod_code,
+ differential=$differential,
+ samples_per_symbol=$samples_per_symbol,
+ excess_bw=$excess_bw,
+ verbose=$verbose,
+ log=$log,
+ )</make>
+ <param>
+ <name>Number of Constellation Points</name>
+ <key>constellation_points</key>
+ <value>16</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Gray Code</name>
+ <key>mod_code</key>
+ <type>enum</type>
+ <option>
+ <name>Yes</name>
+ <key>"gray"</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>"none"</key>
+ </option>
+ </param>
+ <param>
+ <name>Differential Encoding</name>
+ <key>differential</key>
+ <value>True</value>
+ <type>bool</type>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Excess BW</name>
+ <key>excess_bw</key>
+ <value>0.35</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Verbose</name>
+ <key>verbose</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Logging</name>
+ <key>log</key>
+ <value>False</value>
+ <type>bool</type>
+ <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
+ <option>
+ <name>On</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>Off</name>
+ <key>False</key>
+ </option>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>byte</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/gnuradio-examples/python/digital-bert/.gitignore b/gr-digital/include/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gnuradio-examples/python/digital-bert/.gitignore
+++ b/gr-digital/include/.gitignore
diff --git a/gr-digital/include/Makefile.am b/gr-digital/include/Makefile.am
new file mode 100644
index 000000000..ffbc0f793
--- /dev/null
+++ b/gr-digital/include/Makefile.am
@@ -0,0 +1,44 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+# These headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS = \
+ digital_binary_slicer_fb.h \
+ digital_clock_recovery_mm_cc.h \
+ digital_clock_recovery_mm_ff.h \
+ digital_constellation.h \
+ digital_constellation_receiver_cb.h \
+ digital_constellation_decoder_cb.h \
+ digital_correlate_access_code_bb.h \
+ digital_costas_loop_cc.h \
+ digital_cma_equalizer_cc.h \
+ digital_crc32.h \
+ digital_fll_band_edge_cc.h \
+ digital_lms_dd_equalizer_cc.h \
+ digital_kurtotic_equalizer_cc.h \
+ digital_metric_type.h \
+ digital_mpsk_receiver_cc.h \
+ digital_gmskmod_bc.h \
+ digital_cpmmod_bc.h
+
+libgnuradio_digital_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
diff --git a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.h b/gr-digital/include/digital_binary_slicer_fb.h
index 2aa4a0828..4e6717de6 100644
--- a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.h
+++ b/gr-digital/include/digital_binary_slicer_fb.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,27 +20,28 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_BINARY_SLICER_FB_H
-#define INCLUDED_GR_BINARY_SLICER_FB_H
+#ifndef INCLUDED_DIGITAL_BINARY_SLICER_FB_H
+#define INCLUDED_DIGITAL_BINARY_SLICER_FB_H
#include <gr_sync_block.h>
-class gr_binary_slicer_fb;
-typedef boost::shared_ptr<gr_binary_slicer_fb> gr_binary_slicer_fb_sptr;
+class digital_binary_slicer_fb;
+typedef boost::shared_ptr<digital_binary_slicer_fb> digital_binary_slicer_fb_sptr;
-gr_binary_slicer_fb_sptr gr_make_binary_slicer_fb ();
+digital_binary_slicer_fb_sptr digital_make_binary_slicer_fb ();
/*!
* \brief slice float binary symbol outputting 1 bit output
* \ingroup converter_blk
+ * \ingroup digital
*
* x < 0 --> 0
* x >= 0 --> 1
*/
-class gr_binary_slicer_fb : public gr_sync_block
+class digital_binary_slicer_fb : public gr_sync_block
{
- friend gr_binary_slicer_fb_sptr gr_make_binary_slicer_fb ();
- gr_binary_slicer_fb ();
+ friend digital_binary_slicer_fb_sptr digital_make_binary_slicer_fb ();
+ digital_binary_slicer_fb ();
public:
int work (int noutput_items,
diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.h b/gr-digital/include/digital_clock_recovery_mm_cc.h
index 04227a145..023891a66 100644
--- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.h
+++ b/gr-digital/include/digital_clock_recovery_mm_cc.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,8 +20,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_CLOCK_RECOVERY_MM_CC_H
-#define INCLUDED_GR_CLOCK_RECOVERY_MM_CC_H
+#ifndef INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_CC_H
+#define INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_CC_H
#include <gr_block.h>
#include <gr_complex.h>
@@ -29,17 +29,19 @@
class gri_mmse_fir_interpolator_cc;
-class gr_clock_recovery_mm_cc;
-typedef boost::shared_ptr<gr_clock_recovery_mm_cc> gr_clock_recovery_mm_cc_sptr;
+class digital_clock_recovery_mm_cc;
+typedef boost::shared_ptr<digital_clock_recovery_mm_cc> digital_clock_recovery_mm_cc_sptr;
// public constructor
-gr_clock_recovery_mm_cc_sptr
-gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit=0.001);
+digital_clock_recovery_mm_cc_sptr
+digital_make_clock_recovery_mm_cc (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit=0.001);
/*!
* \brief Mueller and Müller (M&M) based clock recovery block with complex input, complex output.
* \ingroup sync_blk
+ * \ingroup digital
*
* This implements the Mueller and Müller (M&M) discrete-time error-tracking synchronizer.
* The complex version here is based on:
@@ -48,10 +50,10 @@ gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gai
* 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.
*/
-class gr_clock_recovery_mm_cc : public gr_block
+class digital_clock_recovery_mm_cc : public gr_block
{
public:
- ~gr_clock_recovery_mm_cc ();
+ ~digital_clock_recovery_mm_cc ();
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
int general_work (int noutput_items,
gr_vector_int &ninput_items,
@@ -74,8 +76,9 @@ class gr_clock_recovery_mm_cc : public gr_block
}
protected:
- gr_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limi);
+ digital_clock_recovery_mm_cc (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limi);
private:
float d_mu;
@@ -101,9 +104,10 @@ protected:
gr_complex slicer_0deg (gr_complex sample);
gr_complex slicer_45deg (gr_complex sample);
- friend gr_clock_recovery_mm_cc_sptr
- gr_make_clock_recovery_mm_cc (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit);
+ friend digital_clock_recovery_mm_cc_sptr
+ digital_make_clock_recovery_mm_cc (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit);
};
#endif
diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.h b/gr-digital/include/digital_clock_recovery_mm_ff.h
index d2ec6d3e6..5a2206fb2 100644
--- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.h
+++ b/gr-digital/include/digital_clock_recovery_mm_ff.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,8 +20,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_CLOCK_RECOVERY_MM_FF_H
-#define INCLUDED_GR_CLOCK_RECOVERY_MM_FF_H
+#ifndef INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_FF_H
+#define INCLUDED_DIGITAL_CLOCK_RECOVERY_MM_FF_H
#include <gr_block.h>
#include <gr_math.h>
@@ -29,17 +29,19 @@
class gri_mmse_fir_interpolator;
-class gr_clock_recovery_mm_ff;
-typedef boost::shared_ptr<gr_clock_recovery_mm_ff> gr_clock_recovery_mm_ff_sptr;
+class digital_clock_recovery_mm_ff;
+typedef boost::shared_ptr<digital_clock_recovery_mm_ff> digital_clock_recovery_mm_ff_sptr;
// public constructor
-gr_clock_recovery_mm_ff_sptr
-gr_make_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit=0.001);
+digital_clock_recovery_mm_ff_sptr
+digital_make_clock_recovery_mm_ff (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit=0.001);
/*!
* \brief Mueller and Müller (M&M) based clock recovery block with float input, float output.
* \ingroup sync_blk
+ * \ingroup digital
*
* This implements the Mueller and Müller (M&M) discrete-time error-tracking synchronizer.
*
@@ -47,10 +49,10 @@ gr_make_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gai
* Estimation and Signal Processing" by Heinrich Meyr, Marc Moeneclaey, & Stefan Fechtel.
* ISBN 0-471-50275-8.
*/
-class gr_clock_recovery_mm_ff : public gr_block
+class digital_clock_recovery_mm_ff : public gr_block
{
public:
- ~gr_clock_recovery_mm_ff ();
+ ~digital_clock_recovery_mm_ff ();
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
int general_work (int noutput_items,
gr_vector_int &ninput_items,
@@ -72,7 +74,7 @@ class gr_clock_recovery_mm_ff : public gr_block
}
protected:
- gr_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
+ digital_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
float omega_relative_limit);
private:
@@ -88,9 +90,10 @@ protected:
FILE *d_logfile;
float d_omega_relative_limit; // used to compute min and max omega
- friend gr_clock_recovery_mm_ff_sptr
- gr_make_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit);
+ friend digital_clock_recovery_mm_ff_sptr
+ digital_make_clock_recovery_mm_ff (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit);
};
#endif
diff --git a/gr-digital/include/digital_cma_equalizer_cc.h b/gr-digital/include/digital_cma_equalizer_cc.h
new file mode 100644
index 000000000..93771dca4
--- /dev/null
+++ b/gr-digital/include/digital_cma_equalizer_cc.h
@@ -0,0 +1,102 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_DIGITAL_CMA_EQUALIZER_CC_H
+#define INCLUDED_DIGITAL_CMA_EQUALIZER_CC_H
+
+#include <gr_adaptive_fir_ccc.h>
+#include <gr_math.h>
+#include <iostream>
+
+class digital_cma_equalizer_cc;
+typedef boost::shared_ptr<digital_cma_equalizer_cc> digital_cma_equalizer_cc_sptr;
+
+digital_cma_equalizer_cc_sptr
+digital_make_cma_equalizer_cc(int num_taps, float modulus, float mu, int sps);
+
+/*!
+ * \brief Implements constant modulus adaptive filter on complex stream
+ * \ingroup eq_blk
+ * \ingroup digital
+ *
+ * The error value and tap update equations (for p=2) can be found in:
+ *
+ * D. Godard, "Self-Recovering Equalization and Carrier Tracking in
+ * Two-Dimensional Data Communication Systems," IEEE Transactions on
+ * Communications, Vol. 28, No. 11, pp. 1867 - 1875, 1980,
+ */
+class digital_cma_equalizer_cc : public gr_adaptive_fir_ccc
+{
+private:
+ float d_modulus;
+ float d_mu;
+
+ friend digital_cma_equalizer_cc_sptr digital_make_cma_equalizer_cc(int num_taps,
+ float modulus,
+ float mu,
+ int sps);
+ digital_cma_equalizer_cc(int num_taps, float modulus, float mu, int sps);
+
+protected:
+
+ virtual gr_complex error(const gr_complex &out)
+ {
+ gr_complex error = out*(norm(out) - d_modulus);
+ float re = gr_clip(error.real(), 1.0);
+ float im = gr_clip(error.imag(), 1.0);
+ return gr_complex(re, im);
+ }
+
+ virtual void update_tap(gr_complex &tap, const gr_complex &in)
+ {
+ // Hn+1 = Hn - mu*conj(Xn)*zn*(|zn|^2 - 1)
+ tap -= d_mu*conj(in)*d_error;
+ }
+
+public:
+ float get_gain()
+ {
+ return d_mu;
+ }
+
+ void set_gain(float mu)
+ {
+ if(mu < 0.0f || mu > 1.0f) {
+ throw std::out_of_range("digital_cma_equalizer::set_gain: Gain value must be in [0,1]");
+ }
+ d_mu = mu;
+ }
+
+ float get_modulus()
+ {
+ return d_modulus;
+ }
+
+ void set_modulus(float mod)
+ {
+ if(mod < 0)
+ throw std::out_of_range("digital_cma_equalizer::set_modulus: Modulus value must be >= 0");
+ d_modulus = mod;
+ }
+};
+
+#endif
diff --git a/gr-digital/include/digital_constellation.h b/gr-digital/include/digital_constellation.h
new file mode 100644
index 000000000..b6da7ff9b
--- /dev/null
+++ b/gr-digital/include/digital_constellation.h
@@ -0,0 +1,448 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_DIGITAL_CONSTELLATION_H
+#define INCLUDED_DIGITAL_CONSTELLATION_H
+
+#include <vector>
+#include <math.h>
+#include <gr_complex.h>
+#include <boost/enable_shared_from_this.hpp>
+#include <digital_metric_type.h>
+
+/************************************************************/
+/* digital_constellation */
+/* */
+/* Base class defining interface. */
+/************************************************************/
+
+class digital_constellation;
+typedef boost::shared_ptr<digital_constellation> digital_constellation_sptr;
+
+/*!
+ * \brief An abstracted constellation object
+ * \ingroup digital
+ *
+ * The constellation objects hold the necessary information to pass
+ * around constellation information for modulators and
+ * demodulators. These objects contain the mapping between the bits
+ * and the constellation points used to represent them as well as
+ * methods for slicing the symbol space. Various implementations are
+ * possible for efficiency and ease of use.
+ *
+ * Standard constellations (BPSK, QPSK, QAM, etc) can be inherited
+ * from this class and overloaded to perform optimized slicing and
+ * constellation mappings.
+ */
+class digital_constellation : public boost::enable_shared_from_this<digital_constellation>
+{
+public:
+ digital_constellation (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality);
+ digital_constellation ();
+
+ //! Returns the constellation points for a symbol value
+ void map_to_points(unsigned int value, gr_complex *points);
+ std::vector<gr_complex> map_to_points_v(unsigned int value);
+
+ //! Returns the constellation point that matches best.
+ virtual unsigned int decision_maker (const gr_complex *sample) = 0;
+ //! Takes a vector rather than a pointer. Better for SWIG wrapping.
+ unsigned int decision_maker_v (std::vector<gr_complex> sample);
+ //! Also calculates the phase error.
+ unsigned int decision_maker_pe (const gr_complex *sample, float *phase_error);
+ //! Calculates distance.
+ unsigned int decision_maker_e (const gr_complex *sample, float *error);
+
+ //! Calculates metrics for all points in the constellation.
+ //! For use with the viterbi algorithm.
+ virtual void calc_metric(const gr_complex *sample, float *metric, trellis_metric_type_t type);
+ virtual void calc_euclidean_metric(const gr_complex *sample, float *metric);
+ virtual void calc_hard_symbol_metric(const gr_complex *sample, float *metric);
+
+ //! Returns the set of points in this constellation.
+ std::vector<gr_complex> points() { return d_constellation;}
+ //! Returns the vector of points in this constellation.
+ //! Raise error if dimensionality is not one.
+ std::vector<gr_complex> s_points();
+ //! Returns a vector of vectors of points.
+ std::vector<std::vector<gr_complex> > v_points();
+ //! Whether to apply an encoding before doing differential encoding. (e.g. gray coding)
+ bool apply_pre_diff_code() { return d_apply_pre_diff_code;}
+ //! Whether to apply an encoding before doing differential encoding. (e.g. gray coding)
+ void set_pre_diff_code(bool a) { d_apply_pre_diff_code = a;}
+ //! Returns the encoding to apply before differential encoding.
+ std::vector<unsigned int> pre_diff_code() { return d_pre_diff_code;}
+ //! Returns the order of rotational symmetry.
+ unsigned int rotational_symmetry() { return d_rotational_symmetry;}
+ //! Returns the number of complex numbers in a single symbol.
+ unsigned int dimensionality() {return d_dimensionality;}
+
+ unsigned int bits_per_symbol () {
+ return floor(log(double(d_constellation.size()))/d_dimensionality/log(2.0));
+ }
+
+ unsigned int arity () {
+ return d_arity;
+ }
+
+ digital_constellation_sptr base() {
+ return shared_from_this();
+ }
+
+ protected:
+
+ std::vector<gr_complex> d_constellation;
+ std::vector<unsigned int> d_pre_diff_code;
+ bool d_apply_pre_diff_code;
+ unsigned int d_rotational_symmetry;
+ unsigned int d_dimensionality;
+ unsigned int d_arity;
+
+ float get_distance(unsigned int index, const gr_complex *sample);
+ unsigned int get_closest_point(const gr_complex *sample);
+ void calc_arity ();
+};
+
+/************************************************************/
+/* digital_constellation_calcdist */
+/* */
+/************************************************************/
+
+class digital_constellation_calcdist;
+typedef boost::shared_ptr<digital_constellation_calcdist> digital_constellation_calcdist_sptr;
+
+// public constructor
+digital_constellation_calcdist_sptr
+digital_make_constellation_calcdist (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality);
+
+
+/*! \brief Calculate Euclidian distance for any constellation
+ * \ingroup digital
+ *
+ * Constellation which calculates the distance to each point in the
+ * constellation for decision making. Inefficient for large
+ * constellations.
+ */
+class digital_constellation_calcdist : public digital_constellation
+{
+ public:
+ digital_constellation_calcdist (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality);
+ unsigned int decision_maker (const gr_complex *sample);
+ // void calc_metric(gr_complex *sample, float *metric, trellis_metric_type_t type);
+ // void calc_euclidean_metric(gr_complex *sample, float *metric);
+ // void calc_hard_symbol_metric(gr_complex *sample, float *metric);
+
+ private:
+ friend digital_constellation_calcdist_sptr
+ digital_make_constellation_calcdist (std::vector<gr_complex> constellation);
+};
+
+
+/************************************************************/
+/*! digital_constellation_sector */
+/************************************************************/
+
+/*!
+ * \brief Sectorized digital constellation
+ * \ingroup digital
+ *
+ * Constellation space is divided into sectors. Each sector is
+ * associated with the nearest constellation point.
+ *
+ */
+class digital_constellation_sector : public digital_constellation
+{
+ public:
+
+ digital_constellation_sector (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality,
+ unsigned int n_sectors);
+
+ unsigned int decision_maker (const gr_complex *sample);
+
+ protected:
+
+ virtual unsigned int get_sector (const gr_complex *sample) = 0;
+ virtual unsigned int calc_sector_value (unsigned int sector) = 0;
+ void find_sector_values ();
+
+ unsigned int n_sectors;
+
+ private:
+
+ std::vector<unsigned int> sector_values;
+
+};
+
+/************************************************************/
+/* digital_constellation_rect */
+/************************************************************/
+
+/*!
+ * \brief Rectangular digital constellation
+ * \ingroup digital
+ *
+ * Only implemented for 1-(complex)dimensional constellation.
+ *
+ * Constellation space is divided into rectangular sectors. Each
+ * sector is associated with the nearest constellation point.
+ *
+ * Works well for square QAM.
+ *
+ * Works for any generic constellation provided sectors are not too
+ * large.
+ */
+
+class digital_constellation_rect;
+typedef boost::shared_ptr<digital_constellation_rect> digital_constellation_rect_sptr;
+
+// public constructor
+digital_constellation_rect_sptr
+digital_make_constellation_rect (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors,
+ unsigned int imag_sectors,
+ float width_real_sectors,
+ float width_imag_sectors);
+
+class digital_constellation_rect : public digital_constellation_sector
+{
+ public:
+
+ digital_constellation_rect (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors,
+ unsigned int imag_sectors,
+ float width_real_sectors,
+ float width_imag_sectors);
+
+ protected:
+
+ unsigned int get_sector (const gr_complex *sample);
+
+ unsigned int calc_sector_value (unsigned int sector);
+
+ private:
+
+ unsigned int n_real_sectors;
+ unsigned int n_imag_sectors;
+ float d_width_real_sectors;
+ float d_width_imag_sectors;
+
+ friend digital_constellation_rect_sptr
+ digital_make_constellation_rect (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors,
+ unsigned int imag_sectors,
+ float width_real_sectors,
+ float width_imag_sectors);
+
+};
+
+
+/************************************************************/
+/* digital_constellation_psk */
+/************************************************************/
+
+class digital_constellation_psk;
+typedef boost::shared_ptr<digital_constellation_psk> digital_constellation_psk_sptr;
+
+// public constructor
+digital_constellation_psk_sptr
+digital_make_constellation_psk (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors);
+
+/*!
+ * \brief digital_constellation_psk
+ * \ingroup digital
+ *
+ * Constellation space is divided into pie slices sectors.
+ *
+ * Each slice is associated with the nearest constellation point.
+ *
+ * Works well for PSK but nothing else.
+ *
+ * Assumes that there is a constellation point at 1.x
+ */
+class digital_constellation_psk : public digital_constellation_sector
+{
+ public:
+
+ digital_constellation_psk (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors);
+
+ protected:
+
+ unsigned int get_sector (const gr_complex *sample);
+
+ unsigned int calc_sector_value (unsigned int sector);
+
+ private:
+
+ friend digital_constellation_psk_sptr
+ digital_make_constellation_psk (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors);
+
+};
+
+
+/************************************************************/
+/* digital_constellation_bpsk */
+/* */
+/* Only works for BPSK. */
+/* */
+/************************************************************/
+
+class digital_constellation_bpsk;
+typedef boost::shared_ptr<digital_constellation_bpsk> digital_constellation_bpsk_sptr;
+
+// public constructor
+digital_constellation_bpsk_sptr
+digital_make_constellation_bpsk ();
+
+/*!
+ * \brief Digital constellation for BPSK
+ * \ingroup digital
+ */
+class digital_constellation_bpsk : public digital_constellation
+{
+ public:
+
+ digital_constellation_bpsk ();
+ unsigned int decision_maker (const gr_complex *sample);
+
+ friend digital_constellation_bpsk_sptr
+ digital_make_constellation_bpsk ();
+
+};
+
+
+/************************************************************/
+/* digital_constellation_qpsk */
+/* */
+/* Only works for QPSK. */
+/* */
+/************************************************************/
+
+class digital_constellation_qpsk;
+typedef boost::shared_ptr<digital_constellation_qpsk> digital_constellation_qpsk_sptr;
+
+// public constructor
+digital_constellation_qpsk_sptr
+digital_make_constellation_qpsk ();
+
+/*!
+ * \brief Digital constellation for QPSK
+ * \ingroup digital
+ */
+class digital_constellation_qpsk : public digital_constellation
+{
+ public:
+
+ digital_constellation_qpsk ();
+ unsigned int decision_maker (const gr_complex *sample);
+
+ friend digital_constellation_qpsk_sptr
+ digital_make_constellation_qpsk ();
+
+};
+
+
+/************************************************************/
+/* digital_constellation_dqpsk */
+/* */
+/* Works with differential encoding; slower decisions. */
+/* */
+/************************************************************/
+
+class digital_constellation_dqpsk;
+typedef boost::shared_ptr<digital_constellation_dqpsk> digital_constellation_dqpsk_sptr;
+
+// public constructor
+digital_constellation_dqpsk_sptr
+digital_make_constellation_dqpsk ();
+
+/*!
+ * \brief Digital constellation for DQPSK
+ * \ingroup digital
+ */
+class digital_constellation_dqpsk : public digital_constellation
+{
+ public:
+
+ digital_constellation_dqpsk ();
+ unsigned int decision_maker (const gr_complex *sample);
+
+ friend digital_constellation_dqpsk_sptr
+ digital_make_constellation_dqpsk ();
+
+};
+
+
+/************************************************************/
+/* digital_constellation_8psk */
+/* */
+/* Only works for 8PSK. */
+/* */
+/************************************************************/
+
+class digital_constellation_8psk;
+typedef boost::shared_ptr<digital_constellation_8psk> digital_constellation_8psk_sptr;
+
+// public constructor
+digital_constellation_8psk_sptr
+digital_make_constellation_8psk ();
+
+/*!
+ * \brief Digital constellation for 8PSK
+ * \ingroup digital
+ */
+class digital_constellation_8psk : public digital_constellation
+{
+ public:
+
+ digital_constellation_8psk ();
+ unsigned int decision_maker (const gr_complex *sample);
+
+ friend digital_constellation_8psk_sptr
+ digital_make_constellation_8psk ();
+
+};
+
+#endif
diff --git a/gr-digital/include/digital_constellation_decoder_cb.h b/gr-digital/include/digital_constellation_decoder_cb.h
new file mode 100644
index 000000000..d587f6bc4
--- /dev/null
+++ b/gr-digital/include/digital_constellation_decoder_cb.h
@@ -0,0 +1,65 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_DIGITAL_CONSTELLATION_DECODER_CB_H
+#define INCLUDED_DIGITAL_CONSTELLATION_DECODER_CB_H
+
+#include <gr_block.h>
+#include <digital_constellation.h>
+#include <vector>
+
+class digital_constellation_decoder_cb;
+typedef boost::shared_ptr<digital_constellation_decoder_cb>digital_constellation_decoder_cb_sptr;
+
+digital_constellation_decoder_cb_sptr
+digital_make_constellation_decoder_cb (digital_constellation_sptr constellation);
+
+/*!
+ * \brief Constellation Decoder
+ * \ingroup coding_blk
+ * \ingroup digital
+ *
+ */
+class digital_constellation_decoder_cb : public gr_block
+{
+
+ private:
+ digital_constellation_sptr d_constellation;
+ unsigned int d_dim;
+
+ friend digital_constellation_decoder_cb_sptr
+ digital_make_constellation_decoder_cb (digital_constellation_sptr constellation);
+
+ digital_constellation_decoder_cb (digital_constellation_sptr constellation);
+
+ public:
+
+ 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);
+};
+
+#endif
diff --git a/gr-digital/include/digital_constellation_receiver_cb.h b/gr-digital/include/digital_constellation_receiver_cb.h
new file mode 100644
index 000000000..a67f67082
--- /dev/null
+++ b/gr-digital/include/digital_constellation_receiver_cb.h
@@ -0,0 +1,121 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_DIGITAL_CONSTELLATION_RECEIVER_CB_H
+#define INCLUDED_DIGITAL_CONSTELLATION_RECEIVER_CB_H
+
+#include <gr_block.h>
+#include <digital_constellation.h>
+#include <gri_control_loop.h>
+#include <gr_complex.h>
+#include <math.h>
+#include <fstream>
+
+class digital_constellation_receiver_cb;
+typedef boost::shared_ptr<digital_constellation_receiver_cb> digital_constellation_receiver_cb_sptr;
+
+// public constructor
+digital_constellation_receiver_cb_sptr
+digital_make_constellation_receiver_cb (digital_constellation_sptr constellation,
+ float loop_bw, float fmin, float fmax);
+
+/*!
+ * \brief This block takes care of receiving generic modulated signals
+ * through phase, frequency, and symbol synchronization.
+ * \ingroup sync_blk
+ * \ingroup demod_blk
+ * \ingroup digital
+ *
+ * This block takes care of receiving generic modulated signals
+ * through phase, frequency, and symbol synchronization. It performs
+ * carrier frequency and phase locking as well as symbol timing
+ * recovery.
+ *
+ * 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.
+ *
+ * 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_constellation_receiver_cb : public gr_block, public gri_control_loop
+{
+public:
+ int general_work (int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+protected:
+
+ /*!
+ * \brief Constructor to synchronize incoming M-PSK symbols
+ *
+ * \param constellation constellation of points for generic modulation
+ * \param loop_bw Loop bandwidth of the Costas Loop (~ 2pi/100)
+ * \param fmin minimum normalized frequency value the loop can achieve
+ * \param fmax maximum normalized frequency value the loop can achieve
+ *
+ * The constructor also chooses which phase detector and decision maker to use in the
+ * work loop based on the value of M.
+ */
+ digital_constellation_receiver_cb (digital_constellation_sptr constellation,
+ float loop_bw, float fmin, float fmax);
+
+ void phase_error_tracking(float phase_error);
+
+private:
+ unsigned int d_M;
+
+ digital_constellation_sptr d_constellation;
+ unsigned int d_current_const_point;
+
+ //! delay line length.
+ static const unsigned int DLLEN = 8;
+
+ //! delay line plus some length for overflow protection
+ gr_complex d_dl[2*DLLEN] __attribute__ ((aligned(8)));
+
+ //! index to delay line
+ unsigned int d_dl_idx;
+
+ friend digital_constellation_receiver_cb_sptr
+ digital_make_constellation_receiver_cb (digital_constellation_sptr constell,
+ float loop_bw, float fmin, float fmax);
+};
+
+#endif
diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h b/gr-digital/include/digital_correlate_access_code_bb.h
index 581713c14..c21875f0e 100644
--- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.h
+++ b/gr-digital/include/digital_correlate_access_code_bb.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,25 +20,26 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_CORRELATE_ACCESS_CODE_BB_H
-#define INCLUDED_GR_CORRELATE_ACCESS_CODE_BB_H
+#ifndef INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_H
+#define INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_H
#include <gr_sync_block.h>
#include <string>
-class gr_correlate_access_code_bb;
-typedef boost::shared_ptr<gr_correlate_access_code_bb> gr_correlate_access_code_bb_sptr;
+class digital_correlate_access_code_bb;
+typedef boost::shared_ptr<digital_correlate_access_code_bb> digital_correlate_access_code_bb_sptr;
/*!
* \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
* \param threshold maximum number of bits that may be wrong
*/
-gr_correlate_access_code_bb_sptr
-gr_make_correlate_access_code_bb (const std::string &access_code, int threshold);
+digital_correlate_access_code_bb_sptr
+digital_make_correlate_access_code_bb (const std::string &access_code, int threshold);
/*!
* \brief Examine input for specified access code, one bit at a time.
* \ingroup sync_blk
+ * \ingroup digital
*
* input: stream of bits, 1 bit per input byte (data in LSB)
* output: stream of bits, 2 bits per output byte (data in LSB, flag in next higher bit)
@@ -49,10 +50,10 @@ gr_make_correlate_access_code_bb (const std::string &access_code, int threshold)
* flag bit and is 1 if the corresponding data bit is the first data
* bit following the access code. Otherwise the flag bit is 0.
*/
-class gr_correlate_access_code_bb : public gr_sync_block
+class digital_correlate_access_code_bb : public gr_sync_block
{
- friend gr_correlate_access_code_bb_sptr
- gr_make_correlate_access_code_bb (const std::string &access_code, int threshold);
+ friend digital_correlate_access_code_bb_sptr
+ digital_make_correlate_access_code_bb (const std::string &access_code, int threshold);
private:
unsigned long long d_access_code; // access code to locate start of packet
// access code is left justified in the word
@@ -64,10 +65,10 @@ class gr_correlate_access_code_bb : public gr_sync_block
unsigned int d_threshold; // how many bits may be wrong in sync vector
protected:
- gr_correlate_access_code_bb(const std::string &access_code, int threshold);
+ digital_correlate_access_code_bb(const std::string &access_code, int threshold);
public:
- ~gr_correlate_access_code_bb();
+ ~digital_correlate_access_code_bb();
int work(int noutput_items,
gr_vector_const_void_star &input_items,
@@ -80,4 +81,4 @@ class gr_correlate_access_code_bb : public gr_sync_block
bool set_access_code (const std::string &access_code);
};
-#endif /* INCLUDED_GR_CORRELATE_ACCESS_CODE_BB_H */
+#endif /* INCLUDED_DIGITAL_CORRELATE_ACCESS_CODE_BB_H */
diff --git a/gnuradio-core/src/lib/general/gr_costas_loop_cc.h b/gr-digital/include/digital_costas_loop_cc.h
index 3b4aab86c..3811825dd 100644
--- a/gnuradio-core/src/lib/general/gr_costas_loop_cc.h
+++ b/gr-digital/include/digital_costas_loop_cc.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -21,16 +21,19 @@
*/
-#ifndef INCLUDED_GR_COSTAS_LOOP_CC_H
-#define INCLUDED_GR_COSTAS_LOOP_CC_H
+#ifndef INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
+#define INCLUDED_DIGITAL_COSTAS_LOOP_CC_H
#include <gr_sync_block.h>
+#include <gri_control_loop.h>
#include <stdexcept>
#include <fstream>
-/*! \brief A Costas loop carrier recovery module.
+/*!
+ * \brief A Costas loop carrier recovery module.
* \ingroup sync_blk
+ * \ingroup digital
*
* The Costas loop locks to the center frequency of a signal and
* downconverts it to baseband. The second (order=2) order loop is
@@ -41,9 +44,9 @@
*
* More details can be found online:
*
- * J. Feigin, "Practical Costas loop design: Designing a simple and inexpensive
- * BPSK Costas loop carrier recovery circuit," RF signal processing, pp. 20-36,
- * 2002.
+ * J. Feigin, "Practical Costas loop design: Designing a simple and
+ * inexpensive BPSK Costas loop carrier recovery circuit," RF signal
+ * processing, pp. 20-36, 2002.
*
* http://rfdesign.com/images/archive/0102Feigin20.pdf
*
@@ -53,15 +56,13 @@
* \param min_freq the minimum frequency deviation (radians/sample) the loop can handle
* \param order the loop order, either 2 or 4
*/
-class gr_costas_loop_cc;
-typedef boost::shared_ptr<gr_costas_loop_cc> gr_costas_loop_cc_sptr;
+class digital_costas_loop_cc;
+typedef boost::shared_ptr<digital_costas_loop_cc> digital_costas_loop_cc_sptr;
-gr_costas_loop_cc_sptr
-gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument);
+digital_costas_loop_cc_sptr
+digital_make_costas_loop_cc (float loop_bw, int order
+ ) throw (std::invalid_argument);
/*!
@@ -74,20 +75,22 @@ gr_make_costas_loop_cc (float alpha, float beta,
*
* \p order must be 2 or 4.
*/
-class gr_costas_loop_cc : public gr_sync_block
+class digital_costas_loop_cc : public gr_sync_block, public gri_control_loop
{
- friend gr_costas_loop_cc_sptr gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument);
+ friend digital_costas_loop_cc_sptr
+ digital_make_costas_loop_cc (float loop_bw, int order
+ ) throw (std::invalid_argument);
- float d_alpha, d_beta, d_max_freq, d_min_freq, d_phase, d_freq;
int d_order;
- gr_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument);
+ digital_costas_loop_cc (float loop_bw, int order
+ ) throw (std::invalid_argument);
+
+ /*! \brief the phase detector circuit for 8th-order PSK loops
+ * \param sample complex sample
+ * \return the phase error
+ */
+ float phase_detector_8(gr_complex sample) const; // for 8PSK
/*! \brief the phase detector circuit for fourth-order loops
* \param sample complex sample
@@ -102,38 +105,13 @@ class gr_costas_loop_cc : public gr_sync_block
float phase_detector_2(gr_complex sample) const; // for BPSK
- float (gr_costas_loop_cc::*d_phase_detector)(gr_complex sample) const;
+ float (digital_costas_loop_cc::*d_phase_detector)(gr_complex sample) const;
public:
- /*! \brief set the first order gain
- * \param alpha
- */
- void set_alpha(float alpha);
-
- /*! \brief get the first order gain
- *
- */
- float alpha() const { return d_alpha; }
-
- /*! \brief set the second order gain
- * \param beta
- */
- void set_beta(float beta);
-
- /*! \brief get the second order gain
- *
- */
- float beta() const { return d_beta; }
-
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
-
- /*! \brief returns the current NCO frequency in radians/sample
- *
- */
- float freq() const { return d_freq; }
};
#endif
diff --git a/gr-digital/include/digital_cpmmod_bc.h b/gr-digital/include/digital_cpmmod_bc.h
new file mode 100644
index 000000000..85b901ba2
--- /dev/null
+++ b/gr-digital/include/digital_cpmmod_bc.h
@@ -0,0 +1,96 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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_CPMMOD_BC_H
+#define INCLUDED_DIGITAL_CPMMOD_BC_H
+
+#include <gr_hier_block2.h>
+#include <gr_char_to_float.h>
+#include <gr_interp_fir_filter_fff.h>
+#include <gr_frequency_modulator_fc.h>
+#include <gr_cpm.h>
+
+
+class digital_cpmmod_bc;
+typedef boost::shared_ptr<digital_cpmmod_bc> digital_cpmmod_bc_sptr;
+
+
+digital_cpmmod_bc_sptr
+digital_make_cpmmod_bc(int type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta=0.3);
+
+/*!
+ * \brief Generic CPM modulator
+ *
+ * \ingroup modulation_blk
+ * \ingroup digital
+ *
+ * \param type The modulation type. Can be one of LREC, LRC, LSRC, TFM
+ * or GAUSSIAN. See gr_cpm::phase_response() for a
+ * detailed description.
+ * \param h The modulation index. \f$ h \cdot \pi\f$ is the maximum
+ * phase change that can occur between two symbols, i.e., if
+ * you only send ones, the phase will increase by \f$ h \cdot
+ * \pi\f$ every \p samples_per_sym samples. Set this to 0.5
+ * for Minimum Shift Keying variants.
+ * \param samples_per_sym Samples per symbol.
+ * \param L The length of the phase duration in symbols. For L=1, this
+ * yields full- response CPM symbols, for L > 1,
+ * partial-response.
+ * \param beta For LSRC, this is the rolloff factor. For Gaussian
+ * pulses, this is the 3 dB time-bandwidth product.
+ *
+ * Examples:
+ * - Setting h = 0.5, L = 1, type = LREC yields MSK.
+ * - Setting h = 0.5, type = GAUSSIAN and beta = 0.3 yields GMSK
+ * as used in GSM.
+ *
+ * The input of this block are symbols from an M-ary alphabet
+ * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
+ * valid inputs are +/-1.
+ * The modulator will silently accept any other inputs, though.
+ * The output is the phase-modulated signal.
+ */
+class digital_cpmmod_bc : public gr_hier_block2
+{
+ friend digital_cpmmod_bc_sptr digital_make_cpmmod_bc(int type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta);
+
+ std::vector<float> d_taps;
+ gr_char_to_float_sptr d_char_to_float;
+ gr_interp_fir_filter_fff_sptr d_pulse_shaper;
+ gr_frequency_modulator_fc_sptr d_fm;
+
+protected:
+ digital_cpmmod_bc(gr_cpm::cpm_type type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta);
+
+public:
+ //! Return the phase response FIR taps
+ std::vector<float> get_taps() { return d_taps; };
+};
+
+#endif /* INCLUDED_DIGITAL_CPMMOD_BC_H */
+
diff --git a/gnuradio-core/src/lib/general/gr_crc32.h b/gr-digital/include/digital_crc32.h
index 87a8d15f2..869cf7f45 100644
--- a/gnuradio-core/src/lib/general/gr_crc32.h
+++ b/gr-digital/include/digital_crc32.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,15 +20,15 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_CRC32_H
-#define INCLUDED_GR_CRC32_H
+#ifndef INCLUDED_DIGITAL_CRC32_H
+#define INCLUDED_DIGITAL_CRC32_H
#include <string>
#include <gr_types.h>
/*!
* \brief update running CRC-32
- * \ingroup misc
+ * \ingroup digital
*
* Update a running CRC with the bytes buf[0..len-1] The CRC should be
* initialized to all 1's, and the transmitted value is the 1's
@@ -36,15 +36,15 @@
* transmitted in big endian order.
*/
unsigned int
-gr_update_crc32(unsigned int crc, const unsigned char *buf, size_t len);
+digital_update_crc32(unsigned int crc, const unsigned char *buf, size_t len);
unsigned int
-gr_update_crc32(unsigned int crc, const std::string buf);
+digital_update_crc32(unsigned int crc, const std::string buf);
unsigned int
-gr_crc32(const unsigned char *buf, size_t len);
+digital_crc32(const unsigned char *buf, size_t len);
unsigned int
-gr_crc32(const std::string buf);
+digital_crc32(const std::string buf);
#endif /* INCLUDED_CRC32_H */
diff --git a/gr-digital/include/digital_fll_band_edge_cc.h b/gr-digital/include/digital_fll_band_edge_cc.h
new file mode 100644
index 000000000..576dfab87
--- /dev/null
+++ b/gr-digital/include/digital_fll_band_edge_cc.h
@@ -0,0 +1,213 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009,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.
+ */
+
+
+#ifndef INCLUDED_DIGITAL_FLL_BAND_EDGE_CC_H
+#define INCLUDED_DIGITAL_FLL_BAND_EDGE_CC_H
+
+#include <gr_sync_block.h>
+#include <gri_control_loop.h>
+
+class digital_fll_band_edge_cc;
+typedef boost::shared_ptr<digital_fll_band_edge_cc> digital_fll_band_edge_cc_sptr;
+digital_fll_band_edge_cc_sptr digital_make_fll_band_edge_cc (float samps_per_sym,
+ float rolloff,
+ int filter_size,
+ float bandwidth);
+
+/*!
+ * \class digital_fll_band_edge_cc
+ * \brief Frequency Lock Loop using band-edge filters
+ *
+ * \ingroup general
+ * \ingroup digital
+ *
+ * The frequency lock loop derives a band-edge filter that covers the
+ * upper and lower bandwidths of a digitally-modulated signal. The
+ * bandwidth range is determined by the excess bandwidth (e.g.,
+ * rolloff factor) of the modulated signal. The placement in frequency
+ * of the band-edges is determined by the oversampling ratio (number
+ * of samples per symbol) and the excess bandwidth. The size of the
+ * filters should be fairly large so as to average over a number of
+ * symbols.
+ *
+ * The FLL works by filtering the upper and lower band edges into
+ * x_u(t) and x_l(t), respectively. These are combined to form cc(t)
+ * = x_u(t) + x_l(t) and ss(t) = x_u(t) - x_l(t). Combining these to
+ * form the signal e(t) = Re{cc(t) \\times ss(t)^*} (where ^* is the
+ * complex conjugate) provides an error signal at the DC term that is
+ * directly proportional to the carrier frequency. We then make a
+ * second-order loop using the error signal that is the running
+ * average of e(t).
+ *
+ * In practice, the above equation can be simplified by just comparing
+ * the absolute value squared of the output of both filters:
+ * abs(x_l(t))^2 - abs(x_u(t))^2 = norm(x_l(t)) - norm(x_u(t)).
+ *
+ * In theory, the band-edge filter is the derivative of the matched
+ * filter in frequency, (H_be(f) = \\frac{H(f)}{df}. In practice, this
+ * comes down to a quarter sine wave at the point of the matched
+ * filter's rolloff (if it's a raised-cosine, the derivative of a
+ * cosine is a sine). Extend this sine by another quarter wave to
+ * make a half wave around the band-edges is equivalent in time to the
+ * sum of two sinc functions. The baseband filter fot the band edges
+ * is therefore derived from this sum of sincs. The band edge filters
+ * are then just the baseband signal modulated to the correct place in
+ * frequency. All of these calculations are done in the
+ * 'design_filter' function.
+ *
+ * Note: We use FIR filters here because the filters have to have a
+ * flat phase response over the entire frequency range to allow their
+ * comparisons to be valid.
+ *
+ * It is very important that the band edge filters be the derivatives
+ * of the pulse shaping filter, and that they be linear
+ * phase. Otherwise, the variance of the error will be very large.
+ *
+ */
+
+class digital_fll_band_edge_cc : public gr_sync_block, public gri_control_loop
+{
+ private:
+ /*!
+ * Build the FLL
+ * \param samps_per_sym (float) Number of samples per symbol of signal
+ * \param rolloff (float) Rolloff factor of signal
+ * \param filter_size (int) Size (in taps) of the filter
+ * \param bandwidth (float) Loop bandwidth
+ */
+ friend digital_fll_band_edge_cc_sptr digital_make_fll_band_edge_cc (float samps_per_sym,
+ float rolloff,
+ int filter_size,
+ float bandwidth);
+
+ float d_sps;
+ float d_rolloff;
+ int d_filter_size;
+
+ std::vector<gr_complex> d_taps_lower;
+ std::vector<gr_complex> d_taps_upper;
+ bool d_updated;
+
+ /*!
+ * Build the FLL
+ * \param samps_per_sym (float) number of samples per symbol
+ * \param rolloff (float) Rolloff (excess bandwidth) of signal filter
+ * \param filter_size (int) number of filter taps to generate
+ * \param bandwidth (float) Loop bandwidth
+ */
+ digital_fll_band_edge_cc(float samps_per_sym, float rolloff,
+ int filter_size, float bandwidth);
+
+ /*!
+ * Design the band-edge filter based on the number of samples per symbol,
+ * filter rolloff factor, and the filter size
+ *
+ * \param samps_per_sym (float) Number of samples per symbol of signal
+ * \param rolloff (float) Rolloff factor of signal
+ * \param filter_size (int) Size (in taps) of the filter
+ */
+ void design_filter(float samps_per_sym, float rolloff, int filter_size);
+
+public:
+ ~digital_fll_band_edge_cc ();
+
+ /*******************************************************************
+ SET FUNCTIONS
+ *******************************************************************/
+
+ /*!
+ * \brief Set the number of samples per symbol
+ *
+ * Set's the number of samples per symbol the system should
+ * use. This value is uesd to calculate the filter taps and will
+ * force a recalculation.
+ *
+ * \param sps (float) new samples per symbol
+ *
+ */
+ void set_samples_per_symbol(float sps);
+
+ /*!
+ * \brief Set the rolloff factor of the shaping filter
+ *
+ * This sets the rolloff factor that is used in the pulse shaping
+ * filter and is used to calculate the filter taps. Changing this
+ * will force a recalculation of the filter taps.
+ *
+ * This should be the same value that is used in the transmitter's
+ * pulse shaping filter. It must be between 0 and 1 and is usually
+ * between 0.2 and 0.5 (where 0.22 and 0.35 are commonly used
+ * values).
+ *
+ * \param rolloff (float) new shaping filter rolloff factor [0,1]
+ *
+ */
+ void set_rolloff(float rolloff);
+
+ /*!
+ * \brief Set the number of taps in the filter
+ *
+ * This sets the number of taps in the band-edge filters. Setting
+ * this will force a recalculation of the filter taps.
+ *
+ * This should be about the same number of taps used in the
+ * transmitter's shaping filter and also not very large. A large
+ * number of taps will result in a large delay between input and
+ * frequency estimation, and so will not be as accurate. Between 30
+ * and 70 taps is usual.
+ *
+ * \param filter_size (float) number of taps in the filters
+ *
+ */
+ void set_filter_size(int filter_size);
+
+ /*******************************************************************
+ GET FUNCTIONS
+ *******************************************************************/
+
+ /*!
+ * \brief Returns the number of sampler per symbol used for the filter
+ */
+ float get_samples_per_symbol() const;
+
+ /*!
+ * \brief Returns the rolloff factor used for the filter
+ */
+ float get_rolloff() const;
+
+ /*!
+ * \brief Returns the number of taps of the filter
+ */
+ int get_filter_size() const;
+
+ /*!
+ * Print the taps to screen.
+ */
+ void print_taps();
+
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif
diff --git a/gr-digital/include/digital_gmskmod_bc.h b/gr-digital/include/digital_gmskmod_bc.h
new file mode 100644
index 000000000..4b0952401
--- /dev/null
+++ b/gr-digital/include/digital_gmskmod_bc.h
@@ -0,0 +1,62 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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_GMSKMOD_BC_H
+#define INCLUDED_DIGITAL_GMSKMOD_BC_H
+
+#include <digital_cpmmod_bc.h>
+
+class digital_gmskmod_bc;
+typedef boost::shared_ptr<digital_gmskmod_bc> digital_gmskmod_bc_sptr;
+
+
+digital_gmskmod_bc_sptr
+digital_make_gmskmod_bc(unsigned samples_per_sym=2,
+ double bt=0.3, unsigned L=4);
+
+/*!
+ * \brief GMSK modulator
+ *
+ * \ingroup modulation_blk
+ * \ingroup digital
+ *
+ * \param samples_per_sym Samples per symbol.
+ * \param bt The 3 dB time-bandwidth product.
+ * \param L The length of the phase duration in symbols. The Gaussian
+ * pulse is truncated after L symbols.
+ *
+ * The input of this block are symbols from an M-ary alphabet
+ * +/-1, +/-3, ..., +/-(M-1). Usually, M = 2 and therefore, the
+ * valid inputs are +/-1.
+ * The modulator will silently accept any other inputs, though.
+ * The output is the phase-modulated signal.
+ */
+class digital_gmskmod_bc : public digital_cpmmod_bc
+{
+ friend digital_gmskmod_bc_sptr digital_make_gmskmod_bc(unsigned samples_per_sym,
+ double bt, unsigned L);
+ digital_gmskmod_bc(unsigned samples_per_sym,
+ double bt, unsigned L);
+};
+
+#endif /* INCLUDED_DIGITAL_GMSKMOD_BC_H */
+
diff --git a/gr-digital/include/digital_kurtotic_equalizer_cc.h b/gr-digital/include/digital_kurtotic_equalizer_cc.h
new file mode 100644
index 000000000..018a906b0
--- /dev/null
+++ b/gr-digital/include/digital_kurtotic_equalizer_cc.h
@@ -0,0 +1,112 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_DIGITAL_KURTOTIC_EQUALIZER_CC_H
+#define INCLUDED_DIGITAL_KURTOTIC_EQUALIZER_CC_H
+
+#include <gr_adaptive_fir_ccc.h>
+#include <gr_math.h>
+#include <iostream>
+
+class digital_kurtotic_equalizer_cc;
+typedef boost::shared_ptr<digital_kurtotic_equalizer_cc> digital_kurtotic_equalizer_cc_sptr;
+
+digital_kurtotic_equalizer_cc_sptr
+digital_make_kurtotic_equalizer_cc(int num_taps, float mu);
+
+/*!
+ * \brief Implements a kurtosis-based adaptive equalizer on complex stream
+ * \ingroup eq_blk
+ * \ingroup digital
+ *
+ * Y. Guo, J. Zhao, Y. Sun, "Sign kurtosis maximization based blind
+ * equalization algorithm," IEEE Conf. on Control, Automation,
+ * Robotics and Vision, Vol. 3, Dec. 2004, pp. 2052 - 2057.
+ */
+class digital_kurtotic_equalizer_cc : public gr_adaptive_fir_ccc
+{
+private:
+ float d_mu;
+ float d_p, d_m;
+ gr_complex d_q, d_u;
+ float d_alpha_p, d_alpha_q, d_alpha_m;
+
+ friend digital_kurtotic_equalizer_cc_sptr digital_make_kurtotic_equalizer_cc(int num_taps,
+ float mu);
+ digital_kurtotic_equalizer_cc(int num_taps, float mu);
+
+ gr_complex sign(gr_complex x)
+ {
+ float re = (float)(x.real() >= 0.0f);
+ float im = (float)(x.imag() >= 0.0f);
+ return gr_complex(re, im);
+ }
+
+protected:
+
+ virtual gr_complex error(const gr_complex &out)
+ {
+
+ // p = E[|z|^2]
+ // q = E[z^2]
+ // m = E[|z|^4]
+ // u = E[kurtosis(z)]
+
+ float nrm = norm(out);
+ gr_complex cnj = conj(out);
+ float epsilon_f = 1e-12;
+ gr_complex epsilon_c = gr_complex(1e-12, 1e-12);
+
+
+ d_p = (1-d_alpha_p)*d_p + (d_alpha_p)*nrm + epsilon_f;
+ d_q = (1-d_alpha_q)*d_q + (d_alpha_q)*out*out + epsilon_c;
+ d_m = (1-d_alpha_m)*d_m + (d_alpha_m)*nrm*nrm + epsilon_f;
+ d_u = d_m - 2.0f*(d_p*d_p) - d_q*d_q;
+
+ gr_complex F = (1.0f / (d_p*d_p*d_p)) *
+ (sign(d_u) * (nrm*cnj - 2.0f*d_p*cnj - conj(d_q)*out) -
+ abs(d_u)*cnj);
+
+ //std::cout << "out: " << out << " p: " << d_p << " q: " << d_q;
+ //std::cout << " m: " << d_m << " u: " << d_u << std::endl;
+ //std::cout << "error: " << F << std::endl;
+
+ float re = gr_clip(F.real(), 1.0);
+ float im = gr_clip(F.imag(), 1.0);
+ return gr_complex(re, im);
+ }
+
+ virtual void update_tap(gr_complex &tap, const gr_complex &in)
+ {
+ tap += d_mu*in*d_error;
+ }
+
+public:
+ void set_gain(float mu)
+ {
+ if(mu < 0)
+ throw std::out_of_range("digital_kurtotic_equalizer::set_gain: Gain value must be >= 0");
+ d_mu = mu;
+ }
+};
+
+#endif
diff --git a/gr-digital/include/digital_lms_dd_equalizer_cc.h b/gr-digital/include/digital_lms_dd_equalizer_cc.h
new file mode 100644
index 000000000..050d8781d
--- /dev/null
+++ b/gr-digital/include/digital_lms_dd_equalizer_cc.h
@@ -0,0 +1,117 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H
+#define INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H
+
+#include <gr_adaptive_fir_ccc.h>
+#include <digital_constellation.h>
+
+class digital_lms_dd_equalizer_cc;
+typedef boost::shared_ptr<digital_lms_dd_equalizer_cc> digital_lms_dd_equalizer_cc_sptr;
+
+digital_lms_dd_equalizer_cc_sptr digital_make_lms_dd_equalizer_cc (int num_taps,
+ float mu, int sps,
+ digital_constellation_sptr cnst);
+
+/*!
+ * \brief Least-Mean-Square Decision Directed Equalizer (complex in/out)
+ * \ingroup eq_blk
+ * \ingroup digital
+ *
+ * This block implements an LMS-based decision-directed equalizer.
+ * It uses a set of weights, w, to correlate against the inputs, u,
+ * and a decisions is then made from this output. The error
+ * in the decision is used to update teh weight vector.
+ *
+ * y[n] = conj(w[n]) u[n]
+ * d[n] = decision(y[n])
+ * e[n] = d[n] - y[n]
+ * w[n+1] = w[n] + mu u[n] conj(e[n])
+ *
+ * Where mu is a gain value (between 0 and 1 and usualy small,
+ * around 0.001 - 0.01.
+ *
+ * This block uses the digital_constellation object for making
+ * the decision from y[n]. Create the constellation object for
+ * whatever constellation is to be used and pass in the object.
+ * In Python, you can use something like:
+ * self.constellation = digital.constellation_qpsk()
+ * To create a QPSK constellation (see the digital_constellation
+ * block for more details as to what constellations are available
+ * or how to create your own). You then pass the object to this
+ * block as an sptr, or using "self.constellation.base()".
+ *
+ * The theory for this algorithm can be found in Chapter 9 of:
+ * S. Haykin, Adaptive Filter Theory, Upper Saddle River, NJ:
+ * Prentice Hall, 1996.
+ *
+ */
+class digital_lms_dd_equalizer_cc : public gr_adaptive_fir_ccc
+{
+private:
+ friend digital_lms_dd_equalizer_cc_sptr digital_make_lms_dd_equalizer_cc (int num_taps,
+ float mu, int sps,
+ digital_constellation_sptr cnst);
+
+ float d_mu;
+ std::vector<gr_complex> d_taps;
+ digital_constellation_sptr d_cnst;
+
+ digital_lms_dd_equalizer_cc (int num_taps,
+ float mu, int sps,
+ digital_constellation_sptr cnst);
+
+protected:
+
+ virtual gr_complex error(const gr_complex &out)
+ {
+ gr_complex decision, error;
+ d_cnst->map_to_points(d_cnst->decision_maker(&out), &decision);
+ error = decision - out;
+ return error;
+ }
+
+ virtual void update_tap(gr_complex &tap, const gr_complex &in)
+ {
+ tap += d_mu*conj(in)*d_error;
+ }
+
+public:
+ float get_gain()
+ {
+ return d_mu;
+ }
+
+ void set_gain(float mu)
+ {
+ if(mu < 0.0f || mu > 1.0f) {
+ throw std::out_of_range("digital_lms_dd_equalizer::set_mu: Gain value must in [0, 1]");
+ }
+ else {
+ d_mu = mu;
+ }
+ }
+
+};
+
+#endif
diff --git a/gr-trellis/src/lib/metric_type.h b/gr-digital/include/digital_metric_type.h
index a1040f108..83de166f0 100644
--- a/gr-trellis/src/lib/metric_type.h
+++ b/gr-digital/include/digital_metric_type.h
@@ -20,8 +20,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_TRELLIS_METRIC_TYPE_H
-#define INCLUDED_TRELLIS_METRIC_TYPE_H
+#ifndef INCLUDED_DIGITAL_METRIC_TYPE_H
+#define INCLUDED_DIGITAL_METRIC_TYPE_H
typedef enum {
TRELLIS_EUCLIDEAN = 200, TRELLIS_HARD_SYMBOL, TRELLIS_HARD_BIT
diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h b/gr-digital/include/digital_mpsk_receiver_cc.h
index f17b68aa0..74aca5649 100644
--- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.h
+++ b/gr-digital/include/digital_mpsk_receiver_cc.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2007 Free Software Foundation, Inc.
+ * Copyright 2004,2007,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,60 +20,69 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GR_MPSK_RECEIVER_CC_H
-#define INCLUDED_GR_MPSK_RECEIVER_CC_H
+#ifndef INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
+#define INCLUDED_DIGITAL_MPSK_RECEIVER_CC_H
#include <gruel/attributes.h>
+#include <gri_control_loop.h>
#include <gr_block.h>
#include <gr_complex.h>
#include <fstream>
class gri_mmse_fir_interpolator_cc;
-class gr_mpsk_receiver_cc;
-typedef boost::shared_ptr<gr_mpsk_receiver_cc> gr_mpsk_receiver_cc_sptr;
+class digital_mpsk_receiver_cc;
+typedef boost::shared_ptr<digital_mpsk_receiver_cc> digital_mpsk_receiver_cc_sptr;
// public constructor
-gr_mpsk_receiver_cc_sptr
-gr_make_mpsk_receiver_cc (unsigned int M, float theta,
- float alpha, float beta,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
+digital_mpsk_receiver_cc_sptr
+digital_make_mpsk_receiver_cc (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);
/*!
- * \brief This block takes care of receiving M-PSK modulated signals through phase, frequency, and symbol
- * synchronization.
+ * \brief This block takes care of receiving M-PSK modulated signals
+ * through phase, frequency, and symbol synchronization.
* \ingroup sync_blk
* \ingroup demod_blk
+ * \ingroup digital
*
- * This block takes care of receiving M-PSK modulated signals through phase, frequency, and symbol
- * synchronization. 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.
+ * This block takes care of receiving M-PSK modulated signals through
+ * phase, frequency, and symbol synchronization. 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 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:
+ * 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.
+ * 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.
+ * 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 gr_mpsk_receiver_cc : public gr_block
+class digital_mpsk_receiver_cc : public gr_block, public gri_control_loop
{
public:
- ~gr_mpsk_receiver_cc ();
+ ~digital_mpsk_receiver_cc ();
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
int general_work (int noutput_items,
gr_vector_int &ninput_items,
@@ -111,43 +120,14 @@ class gr_mpsk_receiver_cc : public gr_block
//! (M&M) Sets value for omega gain factor
void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; }
-
-
- // Member function related to the phase/frequency tracking portion of the receiver
- //! (CL) Returns the value for alpha (the phase gain term)
- float alpha() const { return d_alpha; }
-
- //! (CL) Returns the value of beta (the frequency gain term)
- float beta() const { return d_beta; }
-
- //! (CL) Returns the current value of the frequency of the NCO in the Costas loop
- float freq() const { return d_freq; }
-
- //! (CL) Returns the current value of the phase of the NCO in the Costal loop
- float phase() const { return d_phase; }
-
- //! (CL) Sets the value for alpha (the phase gain term)
- void set_alpha(float alpha) { d_alpha = alpha; }
-
- //! (CL) Setss the value of beta (the frequency gain term)
- void set_beta(float beta) { d_beta = beta; }
-
- //! (CL) Sets the current value of the frequency of the NCO in the Costas loop
- void set_freq(float freq) { d_freq = freq; }
-
- //! (CL) Setss the current value of the phase of the NCO in the Costal loop
- void set_phase(float phase) { d_phase = phase; }
-
-
protected:
-
- /*!
+
+ /*!
* \brief Constructor to synchronize incoming M-PSK symbols
*
* \param M modulation order of the M-PSK modulation
* \param theta any constant phase rotation from the real axis of the constellation
- * \param alpha gain parameter to adjust the phase in the Costas loop (~0.01)
- * \param beta gain parameter to adjust the frequency in the Costas loop (~alpha^2/4)
+ * \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]
@@ -159,11 +139,11 @@ protected:
* The constructor also chooses which phase detector and decision maker to use in the work loop based on the
* value of M.
*/
- gr_mpsk_receiver_cc (unsigned int M, float theta,
- float alpha, float beta,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
+ digital_mpsk_receiver_cc (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);
void make_constellation();
void mm_sampler(const gr_complex symbol);
@@ -171,54 +151,61 @@ protected:
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 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; // generic for M but more costly
- /*!
+ /*!
* \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.
+ * 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; // optimized for BPSK
- /*!
+ /*!
* \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
+ * 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.
+ * 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/
*/
@@ -230,47 +217,45 @@ protected:
*
* \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.
+ * 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.
+ * 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:
+private:
unsigned int d_M;
float d_theta;
- // Members related to carrier and phase tracking
- float d_alpha;
- float d_beta;
- float d_freq, d_max_freq, d_min_freq;
- float d_phase;
-
-/*!
+ /*!
* \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.
+ * 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 (gr_mpsk_receiver_cc::*d_decision)(gr_complex sample) const; // pointer to decision function
+ */
+ unsigned int (digital_mpsk_receiver_cc::*d_decision)(gr_complex sample) const; // pointer to decision function
std::vector<gr_complex> d_constellation;
@@ -282,15 +267,16 @@ protected:
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 (gr_mpsk_receiver_cc::*d_phase_error_detector)(gr_complex sample) const;
+ * 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 (digital_mpsk_receiver_cc::*d_phase_error_detector)(gr_complex sample) const;
//! get interpolated value
@@ -305,12 +291,12 @@ protected:
//! index to delay line
unsigned int d_dl_idx;
- friend gr_mpsk_receiver_cc_sptr
- gr_make_mpsk_receiver_cc (unsigned int M, float theta,
- float alpha, float beta,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
+ friend digital_mpsk_receiver_cc_sptr
+ digital_make_mpsk_receiver_cc (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);
};
#endif
diff --git a/gcell/lib/.gitignore b/gr-digital/lib/.gitignore
index 3531485fb..1b6114c39 100644
--- a/gcell/lib/.gitignore
+++ b/gr-digital/lib/.gitignore
@@ -1,8 +1,4 @@
+/.libs
+/.deps
/Makefile
/Makefile.in
-/.deps
-/.libs
-/*.la
-/*.lo
-/*.a
-/*.o
diff --git a/gr-digital/lib/Makefile.am b/gr-digital/lib/Makefile.am
new file mode 100644
index 000000000..17baf2101
--- /dev/null
+++ b/gr-digital/lib/Makefile.am
@@ -0,0 +1,50 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
+ $(GR_DIGITAL_INCLUDES) $(WITH_INCLUDES)
+
+lib_LTLIBRARIES = libgnuradio-digital.la
+
+libgnuradio_digital_la_SOURCES = \
+ digital_binary_slicer_fb.cc \
+ digital_clock_recovery_mm_cc.cc \
+ digital_clock_recovery_mm_ff.cc \
+ digital_constellation.cc \
+ digital_constellation_receiver_cb.cc \
+ digital_constellation_decoder_cb.cc \
+ digital_correlate_access_code_bb.cc \
+ digital_costas_loop_cc.cc \
+ digital_cma_equalizer_cc.cc \
+ digital_crc32.cc \
+ digital_fll_band_edge_cc.cc \
+ digital_lms_dd_equalizer_cc.cc \
+ digital_kurtotic_equalizer_cc.cc \
+ digital_mpsk_receiver_cc.cc \
+ digital_gmskmod_bc.cc \
+ digital_cpmmod_bc.cc
+
+libgnuradio_digital_la_LIBADD = \
+ $(GNURADIO_CORE_LA)
+
+libgnuradio_digital_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
diff --git a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc b/gr-digital/lib/digital_binary_slicer_fb.cc
index ae8903abb..fcdb4291f 100644
--- a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.cc
+++ b/gr-digital/lib/digital_binary_slicer_fb.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2010 Free Software Foundation, Inc.
+ * Copyright 2006,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -24,40 +24,35 @@
#include "config.h"
#endif
-#include <gr_binary_slicer_fb.h>
+#include <digital_binary_slicer_fb.h>
#include <gr_io_signature.h>
+#include <gr_math.h>
#include <stdexcept>
-gr_binary_slicer_fb_sptr
-gr_make_binary_slicer_fb ()
+digital_binary_slicer_fb_sptr
+digital_make_binary_slicer_fb ()
{
- return gnuradio::get_initial_sptr(new gr_binary_slicer_fb ());
+ return gnuradio::get_initial_sptr(new digital_binary_slicer_fb ());
}
-gr_binary_slicer_fb::gr_binary_slicer_fb ()
+digital_binary_slicer_fb::digital_binary_slicer_fb ()
: gr_sync_block ("binary_slicer_fb",
gr_make_io_signature (1, 1, sizeof (float)),
gr_make_io_signature (1, 1, sizeof (unsigned char)))
{
}
-static inline int
-slice(float x)
-{
- return x < 0 ? 0 : 1;
-}
-
int
-gr_binary_slicer_fb::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+digital_binary_slicer_fb::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
for (int i = 0; i < noutput_items; i++){
- out[i] = slice(in[i]);
+ out[i] = gr_binary_slicer(in[i]);
}
return noutput_items;
diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc b/gr-digital/lib/digital_clock_recovery_mm_cc.cc
index 7c20f7fd9..198eb4b89 100644
--- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.cc
+++ b/gr-digital/lib/digital_clock_recovery_mm_cc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2006,2010 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -26,7 +26,7 @@
#include <gr_io_signature.h>
#include <gr_prefs.h>
-#include <gr_clock_recovery_mm_cc.h>
+#include <digital_clock_recovery_mm_cc.h>
#include <gri_mmse_fir_interpolator_cc.h>
#include <stdexcept>
#include <cstdio>
@@ -35,22 +35,24 @@
// Public constructor
static const int FUDGE = 16;
-gr_clock_recovery_mm_cc_sptr
-gr_make_clock_recovery_mm_cc(float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit)
+digital_clock_recovery_mm_cc_sptr
+digital_make_clock_recovery_mm_cc(float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit)
{
- return gnuradio::get_initial_sptr(new gr_clock_recovery_mm_cc (omega,
- gain_omega,
- mu,
- gain_mu,
- omega_relative_limit));
+ return gnuradio::get_initial_sptr(new digital_clock_recovery_mm_cc (omega,
+ gain_omega,
+ mu,
+ gain_mu,
+ omega_relative_limit));
}
-gr_clock_recovery_mm_cc::gr_clock_recovery_mm_cc (float omega, float gain_omega, float mu,
- float gain_mu, float omega_relative_limit)
+digital_clock_recovery_mm_cc::digital_clock_recovery_mm_cc (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit)
: gr_block ("clock_recovery_mm_cc",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
- gr_make_io_signature (1, 2, sizeof (gr_complex))),
+ gr_make_io_signature2 (1, 2, sizeof (gr_complex), sizeof(float))),
d_mu (mu), d_omega(omega), d_gain_omega(gain_omega),
d_omega_relative_limit(omega_relative_limit),
d_gain_mu(gain_mu), d_last_sample(0), d_interp(new gri_mmse_fir_interpolator_cc()),
@@ -67,13 +69,13 @@ gr_clock_recovery_mm_cc::gr_clock_recovery_mm_cc (float omega, float gain_omega,
set_history(3); // ensure 2 extra input sample is available
}
-gr_clock_recovery_mm_cc::~gr_clock_recovery_mm_cc ()
+digital_clock_recovery_mm_cc::~digital_clock_recovery_mm_cc ()
{
delete d_interp;
}
void
-gr_clock_recovery_mm_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required)
+digital_clock_recovery_mm_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required)
{
unsigned ninputs = ninput_items_required.size();
for (unsigned i=0; i < ninputs; i++)
@@ -82,7 +84,7 @@ gr_clock_recovery_mm_cc::forecast(int noutput_items, gr_vector_int &ninput_items
}
gr_complex
-gr_clock_recovery_mm_cc::slicer_0deg (gr_complex sample)
+digital_clock_recovery_mm_cc::slicer_0deg (gr_complex sample)
{
float real=0, imag=0;
@@ -94,7 +96,7 @@ gr_clock_recovery_mm_cc::slicer_0deg (gr_complex sample)
}
gr_complex
-gr_clock_recovery_mm_cc::slicer_45deg (gr_complex sample)
+digital_clock_recovery_mm_cc::slicer_45deg (gr_complex sample)
{
float real= -1, imag = -1;
if(sample.real() > 0)
@@ -112,14 +114,14 @@ gr_clock_recovery_mm_cc::slicer_45deg (gr_complex sample)
*/
int
-gr_clock_recovery_mm_cc::general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+digital_clock_recovery_mm_cc::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];
- gr_complex *foptr = (gr_complex *) output_items[1];
+ float *foptr = (float *) output_items[1];
bool write_foptr = output_items.size() >= 2;
@@ -151,7 +153,7 @@ gr_clock_recovery_mm_cc::general_work (int noutput_items,
out[oo++] = d_p_0T;
// limit mm_val
- mm_val = gr_branchless_clip(mm_val,1.0);
+ mm_val = gr_branchless_clip(mm_val,4.0);
d_omega = d_omega + d_gain_omega * mm_val;
d_omega = d_omega_mid + gr_branchless_clip(d_omega-d_omega_mid, d_omega_relative_limit); // make sure we don't walk away
@@ -160,7 +162,7 @@ gr_clock_recovery_mm_cc::general_work (int noutput_items,
d_mu -= floor(d_mu);
// write the error signal to the second output
- foptr[oo-1] = gr_complex(d_mu,0);
+ foptr[oo-1] = mm_val;
if (ii < 0) // clamp it. This should only happen with bogus input
ii = 0;
diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc b/gr-digital/lib/digital_clock_recovery_mm_ff.cc
index bb5a27071..04057f0e9 100644
--- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.cc
+++ b/gr-digital/lib/digital_clock_recovery_mm_ff.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -25,7 +25,7 @@
#endif
#include <gr_io_signature.h>
-#include <gr_clock_recovery_mm_ff.h>
+#include <digital_clock_recovery_mm_ff.h>
#include <gri_mmse_fir_interpolator.h>
#include <stdexcept>
@@ -33,19 +33,21 @@
// Public constructor
-gr_clock_recovery_mm_ff_sptr
-gr_make_clock_recovery_mm_ff(float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit)
+digital_clock_recovery_mm_ff_sptr
+digital_make_clock_recovery_mm_ff(float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit)
{
- return gnuradio::get_initial_sptr(new gr_clock_recovery_mm_ff (omega,
- gain_omega,
- mu,
- gain_mu,
- omega_relative_limit));
+ return gnuradio::get_initial_sptr(new digital_clock_recovery_mm_ff (omega,
+ gain_omega,
+ mu,
+ gain_mu,
+ omega_relative_limit));
}
-gr_clock_recovery_mm_ff::gr_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit)
+digital_clock_recovery_mm_ff::digital_clock_recovery_mm_ff (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit)
: gr_block ("clock_recovery_mm_ff",
gr_make_io_signature (1, 1, sizeof (float)),
gr_make_io_signature (1, 1, sizeof (float))),
@@ -65,7 +67,7 @@ gr_clock_recovery_mm_ff::gr_clock_recovery_mm_ff (float omega, float gain_omega,
d_logfile = fopen("cr_mm_ff.dat", "wb");
}
-gr_clock_recovery_mm_ff::~gr_clock_recovery_mm_ff ()
+digital_clock_recovery_mm_ff::~digital_clock_recovery_mm_ff ()
{
delete d_interp;
@@ -76,7 +78,7 @@ gr_clock_recovery_mm_ff::~gr_clock_recovery_mm_ff ()
}
void
-gr_clock_recovery_mm_ff::forecast(int noutput_items, gr_vector_int &ninput_items_required)
+digital_clock_recovery_mm_ff::forecast(int noutput_items, gr_vector_int &ninput_items_required)
{
unsigned ninputs = ninput_items_required.size();
for (unsigned i=0; i < ninputs; i++)
@@ -98,10 +100,10 @@ slice(float x)
* ISBN 0-471-50275-8.
*/
int
-gr_clock_recovery_mm_ff::general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+digital_clock_recovery_mm_ff::general_work (int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const float *in = (const float *) input_items[0];
float *out = (float *) output_items[0];
diff --git a/gr-digital/lib/digital_cma_equalizer_cc.cc b/gr-digital/lib/digital_cma_equalizer_cc.cc
new file mode 100644
index 000000000..c6c46c2d8
--- /dev/null
+++ b/gr-digital/lib/digital_cma_equalizer_cc.cc
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <digital_cma_equalizer_cc.h>
+#include <cstdio>
+
+digital_cma_equalizer_cc_sptr
+digital_make_cma_equalizer_cc(int num_taps, float modulus, float mu, int sps)
+{
+ return gnuradio::get_initial_sptr(new digital_cma_equalizer_cc(num_taps, modulus,
+ mu, sps));
+}
+
+digital_cma_equalizer_cc::digital_cma_equalizer_cc(int num_taps, float modulus,
+ float mu, int sps)
+ : gr_adaptive_fir_ccc("cma_equalizer_cc", sps,
+ std::vector<gr_complex>(num_taps, gr_complex(0,0)))
+{
+ set_modulus(modulus);
+ set_gain(mu);
+ if (num_taps > 0)
+ d_taps[0] = 1.0;
+}
diff --git a/gr-digital/lib/digital_constellation.cc b/gr-digital/lib/digital_constellation.cc
new file mode 100644
index 000000000..0c100f38e
--- /dev/null
+++ b/gr-digital/lib/digital_constellation.cc
@@ -0,0 +1,554 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_io_signature.h>
+#include <digital_constellation.h>
+#include <digital_metric_type.h>
+#include <gr_math.h>
+#include <gr_complex.h>
+#include <math.h>
+#include <iostream>
+#include <stdlib.h>
+#include <float.h>
+#include <stdexcept>
+
+#define M_TWOPI (2*M_PI)
+#define SQRT_TWO 0.707107
+
+// Base Constellation Class
+
+digital_constellation::digital_constellation (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality) :
+ d_constellation(constellation),
+ d_pre_diff_code(pre_diff_code),
+ d_rotational_symmetry(rotational_symmetry),
+ d_dimensionality(dimensionality)
+{
+ if (pre_diff_code.size() == 0)
+ d_apply_pre_diff_code = false;
+ else if (pre_diff_code.size() != constellation.size())
+ throw std::runtime_error ("The constellation and pre-diff code must be of the same length.");
+ else
+ d_apply_pre_diff_code = true;
+ calc_arity();
+}
+
+digital_constellation::digital_constellation () :
+ d_apply_pre_diff_code(false),
+ d_rotational_symmetry(0),
+ d_dimensionality(1)
+{
+ calc_arity();
+}
+
+//! Returns the constellation points for a symbol value
+void
+digital_constellation::map_to_points(unsigned int value, gr_complex *points)
+{
+ for (unsigned int i=0; i<d_dimensionality; i++)
+ points[i] = d_constellation[value*d_dimensionality + i];
+}
+
+std::vector<gr_complex>
+digital_constellation::map_to_points_v(unsigned int value)
+{
+ std::vector<gr_complex> points_v;
+ points_v.resize(d_dimensionality);
+ map_to_points(value, &(points_v[0]));
+ return points_v;
+}
+
+float
+digital_constellation::get_distance(unsigned int index, const gr_complex *sample)
+{
+ float dist = 0;
+ for (unsigned int i=0; i<d_dimensionality; i++) {
+ dist += norm(sample[i] - d_constellation[index*d_dimensionality + i]);
+ }
+ return dist;
+}
+
+unsigned int
+digital_constellation::get_closest_point(const gr_complex *sample)
+{
+ unsigned int min_index = 0;
+ float min_euclid_dist;
+ float euclid_dist;
+
+ min_euclid_dist = get_distance(0, sample);
+ min_index = 0;
+ for (unsigned int j = 1; j < d_arity; j++){
+ euclid_dist = get_distance(j, sample);
+ if (euclid_dist < min_euclid_dist){
+ min_euclid_dist = euclid_dist;
+ min_index = j;
+ }
+ }
+ return min_index;
+}
+
+unsigned int
+digital_constellation::decision_maker_pe(const gr_complex *sample, float *phase_error)
+{
+ unsigned int index = decision_maker(sample);
+ *phase_error = 0;
+ for (unsigned int d=0; d<d_dimensionality; d++)
+ *phase_error += -arg(sample[d]*conj(d_constellation[index+d]));
+ return index;
+}
+
+/*
+unsigned int digital_constellation::decision_maker_e(const gr_complex *sample, float *error)
+{
+ unsigned int index = decision_maker(sample);
+ *error = 0;
+ for (unsigned int d=0; d<d_dimensionality; d++)
+ *error += sample[d]*conj(d_constellation[index+d]);
+ return index;
+}
+*/
+
+std::vector<gr_complex> digital_constellation::s_points () {
+ if (d_dimensionality != 1)
+ throw std::runtime_error ("s_points only works for dimensionality 1 constellations.");
+ else
+ return d_constellation;
+}
+
+std::vector<std::vector<gr_complex> >
+digital_constellation::v_points ()
+{
+ std::vector<std::vector<gr_complex> > vv_const;
+ vv_const.resize(d_arity);
+ for (unsigned int p=0; p<d_arity; p++) {
+ std::vector<gr_complex> v_const;
+ v_const.resize(d_dimensionality);
+ for (unsigned int d=0; d<d_dimensionality; d++) {
+ v_const[d] = d_constellation[p*d_dimensionality+d];
+ }
+ vv_const[p] = v_const;
+ }
+ return vv_const;
+}
+
+void
+digital_constellation::calc_metric(const gr_complex *sample, float *metric,
+ trellis_metric_type_t type)
+{
+ switch (type){
+ case TRELLIS_EUCLIDEAN:
+ calc_euclidean_metric(sample, metric);
+ break;
+ case TRELLIS_HARD_SYMBOL:
+ calc_hard_symbol_metric(sample, metric);
+ break;
+ case TRELLIS_HARD_BIT:
+ throw std::runtime_error ("Invalid metric type (not yet implemented).");
+ break;
+ default:
+ throw std::runtime_error ("Invalid metric type.");
+ }
+}
+
+void
+digital_constellation::calc_euclidean_metric(const gr_complex *sample, float *metric)
+{
+ for (unsigned int o=0; o<d_arity; o++) {
+ metric[o] = get_distance(o, sample);
+ }
+}
+
+void
+digital_constellation::calc_hard_symbol_metric(const gr_complex *sample, float *metric)
+{
+ float minm = FLT_MAX;
+ unsigned int minmi = 0;
+ for (unsigned int o=0; o<d_arity; o++) {
+ float dist = get_distance(o, sample);
+ if (dist < minm) {
+ minm = dist;
+ minmi = o;
+ }
+ }
+ for(unsigned int o=0; o<d_arity; o++) {
+ metric[o] = (o==minmi?0.0:1.0);
+ }
+}
+
+void
+digital_constellation::calc_arity ()
+{
+ if (d_constellation.size() % d_dimensionality != 0)
+ throw std::runtime_error ("Constellation vector size must be a multiple of the dimensionality.");
+ d_arity = d_constellation.size()/d_dimensionality;
+}
+
+unsigned int
+digital_constellation::decision_maker_v (std::vector<gr_complex> sample)
+{
+ assert(sample.size() == d_dimensionality);
+ return decision_maker (&(sample[0]));
+}
+
+digital_constellation_calcdist_sptr
+digital_make_constellation_calcdist(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality)
+{
+ return digital_constellation_calcdist_sptr(new digital_constellation_calcdist
+ (constellation, pre_diff_code,
+ rotational_symmetry, dimensionality));
+}
+
+digital_constellation_calcdist::digital_constellation_calcdist(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality) :
+ digital_constellation(constellation, pre_diff_code, rotational_symmetry, dimensionality)
+{}
+
+// Chooses points base on shortest distance.
+// Inefficient.
+unsigned int
+digital_constellation_calcdist::decision_maker(const gr_complex *sample)
+{
+ return get_closest_point(sample);
+}
+
+digital_constellation_sector::digital_constellation_sector (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality,
+ unsigned int n_sectors) :
+ digital_constellation(constellation, pre_diff_code, rotational_symmetry, dimensionality),
+ n_sectors(n_sectors)
+{
+}
+
+unsigned int
+digital_constellation_sector::decision_maker (const gr_complex *sample)
+{
+ unsigned int sector;
+ sector = get_sector(sample);
+ return sector_values[sector];
+}
+
+void
+digital_constellation_sector::find_sector_values ()
+{
+ unsigned int i;
+ sector_values.clear();
+ for (i=0; i<n_sectors; i++) {
+ sector_values.push_back(calc_sector_value(i));
+ }
+}
+
+digital_constellation_rect_sptr
+digital_make_constellation_rect(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors, unsigned int imag_sectors,
+ float width_real_sectors, float width_imag_sectors)
+{
+ return digital_constellation_rect_sptr(new digital_constellation_rect
+ (constellation, pre_diff_code,
+ rotational_symmetry,
+ real_sectors, imag_sectors,
+ width_real_sectors,
+ width_imag_sectors));
+ }
+
+digital_constellation_rect::digital_constellation_rect (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors, unsigned int imag_sectors,
+ float width_real_sectors, float width_imag_sectors) :
+ digital_constellation_sector(constellation, pre_diff_code, rotational_symmetry, 1, real_sectors * imag_sectors),
+ n_real_sectors(real_sectors), n_imag_sectors(imag_sectors),
+ d_width_real_sectors(width_real_sectors), d_width_imag_sectors(width_imag_sectors)
+{
+ find_sector_values();
+}
+
+unsigned int
+digital_constellation_rect::get_sector (const gr_complex *sample)
+{
+ int real_sector, imag_sector;
+ unsigned int sector;
+
+ real_sector = int(real(*sample)/d_width_real_sectors + n_real_sectors/2.0);
+ if(real_sector < 0)
+ real_sector = 0;
+ if(real_sector >= (int)n_real_sectors)
+ real_sector = n_real_sectors-1;
+
+ imag_sector = int(imag(*sample)/d_width_imag_sectors + n_imag_sectors/2.0);
+ if(imag_sector < 0)
+ imag_sector = 0;
+ if(imag_sector >= (int)n_imag_sectors)
+ imag_sector = n_imag_sectors-1;
+
+ sector = real_sector * n_imag_sectors + imag_sector;
+ return sector;
+}
+
+unsigned int
+digital_constellation_rect::calc_sector_value (unsigned int sector)
+{
+ unsigned int real_sector, imag_sector;
+ gr_complex sector_center;
+ unsigned int closest_point;
+ real_sector = float(sector)/n_imag_sectors;
+ imag_sector = sector - real_sector * n_imag_sectors;
+ sector_center = gr_complex((real_sector + 0.5 - n_real_sectors/2.0) * d_width_real_sectors,
+ (imag_sector + 0.5 - n_imag_sectors/2.0) * d_width_imag_sectors);
+ closest_point = get_closest_point(&sector_center);
+ return closest_point;
+}
+
+
+digital_constellation_psk_sptr
+digital_make_constellation_psk(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors)
+{
+ return digital_constellation_psk_sptr(new digital_constellation_psk
+ (constellation, pre_diff_code,
+ n_sectors));
+}
+
+digital_constellation_psk::digital_constellation_psk (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors) :
+ digital_constellation_sector(constellation, pre_diff_code, constellation.size(), 1, n_sectors)
+{
+ find_sector_values();
+}
+
+unsigned int
+digital_constellation_psk::get_sector (const gr_complex *sample)
+{
+ float phase = arg(*sample);
+ float width = M_TWOPI / n_sectors;
+ int sector = floor(phase/width + 0.5);
+ unsigned int u_sector;
+ if (sector < 0)
+ sector += n_sectors;
+ u_sector = sector;
+ return sector;
+}
+
+unsigned int
+digital_constellation_psk::calc_sector_value (unsigned int sector)
+{
+ float phase = sector * M_TWOPI / n_sectors;
+ gr_complex sector_center = gr_complex(cos(phase), sin(phase));
+ unsigned int closest_point = get_closest_point(&sector_center);
+ return closest_point;
+}
+
+
+digital_constellation_bpsk_sptr
+digital_make_constellation_bpsk()
+{
+ return digital_constellation_bpsk_sptr(new digital_constellation_bpsk ());
+}
+
+digital_constellation_bpsk::digital_constellation_bpsk ()
+{
+ d_constellation.resize(2);
+ d_constellation[0] = gr_complex(-1, 0);
+ d_constellation[1] = gr_complex(1, 0);
+ d_rotational_symmetry = 2;
+ d_dimensionality = 1;
+ calc_arity();
+}
+
+unsigned int
+digital_constellation_bpsk::decision_maker(const gr_complex *sample)
+{
+ return (real(*sample) > 0);
+}
+
+
+digital_constellation_qpsk_sptr
+digital_make_constellation_qpsk()
+{
+ return digital_constellation_qpsk_sptr(new digital_constellation_qpsk ());
+}
+
+digital_constellation_qpsk::digital_constellation_qpsk ()
+{
+ d_constellation.resize(4);
+ // Gray-coded
+ d_constellation[0] = gr_complex(-SQRT_TWO, -SQRT_TWO);
+ d_constellation[1] = gr_complex(SQRT_TWO, -SQRT_TWO);
+ d_constellation[2] = gr_complex(-SQRT_TWO, SQRT_TWO);
+ d_constellation[3] = gr_complex(SQRT_TWO, SQRT_TWO);
+
+ /*
+ d_constellation[0] = gr_complex(SQRT_TWO, SQRT_TWO);
+ d_constellation[1] = gr_complex(-SQRT_TWO, SQRT_TWO);
+ d_constellation[2] = gr_complex(SQRT_TWO, -SQRT_TWO);
+ d_constellation[3] = gr_complex(SQRT_TWO, -SQRT_TWO);
+ */
+
+ d_pre_diff_code.resize(4);
+ d_pre_diff_code[0] = 0x0;
+ d_pre_diff_code[1] = 0x2;
+ d_pre_diff_code[2] = 0x3;
+ d_pre_diff_code[3] = 0x1;
+
+ d_rotational_symmetry = 4;
+ d_dimensionality = 1;
+ calc_arity();
+}
+
+unsigned int
+digital_constellation_qpsk::decision_maker(const gr_complex *sample)
+{
+ // Real component determines small bit.
+ // Imag component determines big bit.
+ return 2*(imag(*sample)>0) + (real(*sample)>0);
+
+ /*
+ bool a = real(*sample) > 0;
+ bool b = imag(*sample) > 0;
+ if(a) {
+ if(b)
+ return 0x0;
+ else
+ return 0x1;
+ }
+ else {
+ if(b)
+ return 0x2;
+ else
+ return 0x3;
+ }
+ */
+}
+
+
+/********************************************************************/
+
+
+digital_constellation_dqpsk_sptr
+digital_make_constellation_dqpsk()
+{
+ return digital_constellation_dqpsk_sptr(new digital_constellation_dqpsk ());
+}
+
+digital_constellation_dqpsk::digital_constellation_dqpsk ()
+{
+ // This constellation is not gray coded, which allows
+ // us to use differential encodings (through gr_diff_encode and
+ // gr_diff_decode) on the symbols.
+ d_constellation.resize(4);
+ d_constellation[0] = gr_complex(+SQRT_TWO, +SQRT_TWO);
+ d_constellation[1] = gr_complex(-SQRT_TWO, +SQRT_TWO);
+ d_constellation[2] = gr_complex(-SQRT_TWO, -SQRT_TWO);
+ d_constellation[3] = gr_complex(+SQRT_TWO, -SQRT_TWO);
+
+ // Use this mapping to convert to gray code before diff enc.
+ d_pre_diff_code.resize(4);
+ d_pre_diff_code[0] = 0x0;
+ d_pre_diff_code[1] = 0x1;
+ d_pre_diff_code[2] = 0x3;
+ d_pre_diff_code[3] = 0x2;
+ d_apply_pre_diff_code = true;
+
+ d_rotational_symmetry = 4;
+ d_dimensionality = 1;
+ calc_arity();
+}
+
+unsigned int
+digital_constellation_dqpsk::decision_maker(const gr_complex *sample)
+{
+ // Slower deicison maker as we can't slice along one axis.
+ // Maybe there's a better way to do this, still.
+
+ bool a = real(*sample) > 0;
+ bool b = imag(*sample) > 0;
+ if(a) {
+ if(b)
+ return 0x0;
+ else
+ return 0x3;
+ }
+ else {
+ if(b)
+ return 0x1;
+ else
+ return 0x2;
+ }
+}
+
+digital_constellation_8psk_sptr
+digital_make_constellation_8psk()
+{
+ return digital_constellation_8psk_sptr(new digital_constellation_8psk ());
+}
+
+digital_constellation_8psk::digital_constellation_8psk ()
+{
+ float angle = M_PI/8.0;
+ d_constellation.resize(8);
+ // Gray-coded
+ d_constellation[0] = gr_complex(cos( 1*angle), sin( 1*angle));
+ d_constellation[1] = gr_complex(cos( 7*angle), sin( 7*angle));
+ d_constellation[2] = gr_complex(cos(15*angle), sin(15*angle));
+ d_constellation[3] = gr_complex(cos( 9*angle), sin( 9*angle));
+ d_constellation[4] = gr_complex(cos( 3*angle), sin( 3*angle));
+ d_constellation[5] = gr_complex(cos( 5*angle), sin( 5*angle));
+ d_constellation[6] = gr_complex(cos(13*angle), sin(13*angle));
+ d_constellation[7] = gr_complex(cos(11*angle), sin(11*angle));
+ d_rotational_symmetry = 8;
+ d_dimensionality = 1;
+ calc_arity();
+}
+
+unsigned int
+digital_constellation_8psk::decision_maker(const gr_complex *sample)
+{
+ unsigned int ret = 0;
+
+ float re = sample->real();
+ float im = sample->imag();
+
+ if(fabsf(re) <= fabsf(im))
+ ret = 4;
+ if(re <= 0)
+ ret |= 1;
+ if(im <= 0)
+ ret |= 2;
+
+ return ret;
+}
diff --git a/gr-digital/lib/digital_constellation_decoder_cb.cc b/gr-digital/lib/digital_constellation_decoder_cb.cc
new file mode 100644
index 000000000..4638790f6
--- /dev/null
+++ b/gr-digital/lib/digital_constellation_decoder_cb.cc
@@ -0,0 +1,77 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <digital_constellation_decoder_cb.h>
+#include <digital_constellation.h>
+#include <gr_io_signature.h>
+#include <iostream>
+
+digital_constellation_decoder_cb_sptr
+digital_make_constellation_decoder_cb (digital_constellation_sptr constellation)
+{
+ return gnuradio::get_initial_sptr
+ (new digital_constellation_decoder_cb(constellation));
+}
+
+digital_constellation_decoder_cb::
+digital_constellation_decoder_cb (digital_constellation_sptr constellation)
+ : gr_block ("constellation_decoder_cb",
+ gr_make_io_signature (1, 1, sizeof (gr_complex)),
+ gr_make_io_signature (1, 1, sizeof (unsigned char))),
+ d_constellation(constellation),
+ d_dim(constellation->dimensionality())
+{
+ set_relative_rate (1.0 / ((double) d_dim));
+}
+
+void
+digital_constellation_decoder_cb::forecast (int noutput_items,
+ gr_vector_int &ninput_items_required)
+{
+ unsigned int input_required = noutput_items * d_dim;
+
+ unsigned ninputs = ninput_items_required.size();
+ for (unsigned int i = 0; i < ninputs; i++)
+ ninput_items_required[i] = input_required;
+}
+
+
+int
+digital_constellation_decoder_cb::general_work (int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ gr_complex const *in = (const gr_complex *) input_items[0];
+ unsigned char *out = (unsigned char *) output_items[0];
+
+ for(int i = 0; i < noutput_items; i++){
+ out[i] = d_constellation->decision_maker(&(in[i*d_dim]));
+ }
+
+ consume_each (noutput_items * d_dim);
+ return noutput_items;
+}
diff --git a/gr-digital/lib/digital_constellation_receiver_cb.cc b/gr-digital/lib/digital_constellation_receiver_cb.cc
new file mode 100644
index 000000000..b9239962a
--- /dev/null
+++ b/gr-digital/lib/digital_constellation_receiver_cb.cc
@@ -0,0 +1,123 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gr_io_signature.h>
+#include <gr_prefs.h>
+#include <digital_constellation_receiver_cb.h>
+#include <stdexcept>
+#include <gr_math.h>
+#include <gr_expj.h>
+
+
+#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
+
+// Public constructor
+
+digital_constellation_receiver_cb_sptr
+digital_make_constellation_receiver_cb(digital_constellation_sptr constell,
+ float loop_bw, float fmin, float fmax)
+{
+ return gnuradio::get_initial_sptr(new digital_constellation_receiver_cb (constell,
+ loop_bw,
+ fmin, fmax));
+}
+
+static int ios[] = {sizeof(char), sizeof(float), sizeof(float), sizeof(float)};
+static std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int));
+digital_constellation_receiver_cb::digital_constellation_receiver_cb (digital_constellation_sptr constellation,
+ float loop_bw, float fmin, float fmax)
+ : gr_block ("constellation_receiver_cb",
+ gr_make_io_signature (1, 1, sizeof (gr_complex)),
+ gr_make_io_signaturev (1, 4, iosig)),
+ gri_control_loop(loop_bw, fmax, fmin),
+ d_constellation(constellation),
+ d_current_const_point(0)
+{
+ if (d_constellation->dimensionality() != 1)
+ throw std::runtime_error ("This receiver only works with constellations of dimension 1.");
+}
+
+void
+digital_constellation_receiver_cb::phase_error_tracking(float phase_error)
+{
+ 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->points()[d_current_const_point].real(),
+ d_constellation->points()[d_current_const_point].imag());
+#endif
+}
+
+int
+digital_constellation_receiver_cb::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];
+ unsigned char *out = (unsigned char *) output_items[0];
+
+ int i=0;
+
+ float phase_error;
+ unsigned int sym_value;
+ gr_complex sample, nco;
+
+ float *out_err = 0, *out_phase = 0, *out_freq = 0;
+ if(output_items.size() == 4) {
+ out_err = (float *) output_items[1];
+ out_phase = (float *) output_items[2];
+ out_freq = (float *) output_items[3];
+ }
+
+ while((i < noutput_items) && (i < ninput_items[0])) {
+ sample = in[i];
+ nco = gr_expj(d_phase); // get the NCO value for derotating the current sample
+ sample = nco*sample; // get the downconverted symbol
+
+ sym_value = d_constellation->decision_maker_pe(&sample, &phase_error);
+ phase_error_tracking(phase_error); // corrects phase and frequency offsets
+
+ out[i] = sym_value;
+
+ if(output_items.size() == 4) {
+ out_err[i] = phase_error;
+ out_phase[i] = d_phase;
+ out_freq[i] = d_freq;
+ }
+ i++;
+ }
+
+ consume_each(i);
+ return i;
+}
+
diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc b/gr-digital/lib/digital_correlate_access_code_bb.cc
index 15f673411..f21b57d92 100644
--- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.cc
+++ b/gr-digital/lib/digital_correlate_access_code_bb.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2006,2010 Free Software Foundation, Inc.
+ * Copyright 2004,2006,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -24,7 +24,7 @@
#include "config.h"
#endif
-#include <gr_correlate_access_code_bb.h>
+#include <digital_correlate_access_code_bb.h>
#include <gr_io_signature.h>
#include <stdexcept>
#include <gr_count_bits.h>
@@ -34,14 +34,15 @@
#define VERBOSE 0
-gr_correlate_access_code_bb_sptr
-gr_make_correlate_access_code_bb (const std::string &access_code, int threshold)
+digital_correlate_access_code_bb_sptr
+digital_make_correlate_access_code_bb (const std::string &access_code, int threshold)
{
- return gnuradio::get_initial_sptr(new gr_correlate_access_code_bb (access_code, threshold));
+ return gnuradio::get_initial_sptr(new digital_correlate_access_code_bb
+ (access_code, threshold));
}
-gr_correlate_access_code_bb::gr_correlate_access_code_bb (
+digital_correlate_access_code_bb::digital_correlate_access_code_bb (
const std::string &access_code, int threshold)
: gr_sync_block ("correlate_access_code_bb",
gr_make_io_signature (1, 1, sizeof(char)),
@@ -51,17 +52,17 @@ gr_correlate_access_code_bb::gr_correlate_access_code_bb (
{
if (!set_access_code(access_code)){
- fprintf(stderr, "gr_correlate_access_code_bb: access_code is > 64 bits\n");
+ fprintf(stderr, "digital_correlate_access_code_bb: access_code is > 64 bits\n");
throw std::out_of_range ("access_code is > 64 bits");
}
}
-gr_correlate_access_code_bb::~gr_correlate_access_code_bb ()
+digital_correlate_access_code_bb::~digital_correlate_access_code_bb ()
{
}
bool
-gr_correlate_access_code_bb::set_access_code(
+digital_correlate_access_code_bb::set_access_code(
const std::string &access_code)
{
unsigned len = access_code.length(); // # of bytes in string
@@ -84,9 +85,9 @@ gr_correlate_access_code_bb::set_access_code(
}
int
-gr_correlate_access_code_bb::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+digital_correlate_access_code_bb::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
diff --git a/gr-digital/lib/digital_costas_loop_cc.cc b/gr-digital/lib/digital_costas_loop_cc.cc
new file mode 100644
index 000000000..370dc7e5c
--- /dev/null
+++ b/gr-digital/lib/digital_costas_loop_cc.cc
@@ -0,0 +1,153 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2006,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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <digital_costas_loop_cc.h>
+#include <gr_io_signature.h>
+#include <gr_expj.h>
+#include <gr_sincos.h>
+#include <gr_math.h>
+
+digital_costas_loop_cc_sptr
+digital_make_costas_loop_cc (float loop_bw, int order
+ ) throw (std::invalid_argument)
+{
+ return gnuradio::get_initial_sptr(new digital_costas_loop_cc
+ (loop_bw, order));
+}
+
+digital_costas_loop_cc::digital_costas_loop_cc (float loop_bw, int order
+ ) throw (std::invalid_argument)
+ : gr_sync_block ("costas_loop_cc",
+ gr_make_io_signature (1, 1, sizeof (gr_complex)),
+ gr_make_io_signature2 (1, 2, sizeof (gr_complex), sizeof(float))),
+ gri_control_loop(loop_bw, 1.0, -1.0),
+ d_order(order), d_phase_detector(NULL)
+{
+ // Set up the phase detector to use based on the constellation order
+ switch(d_order) {
+ case 2:
+ d_phase_detector = &digital_costas_loop_cc::phase_detector_2;
+ break;
+
+ case 4:
+ d_phase_detector = &digital_costas_loop_cc::phase_detector_4;
+ break;
+
+ case 8:
+ d_phase_detector = &digital_costas_loop_cc::phase_detector_8;
+ break;
+
+ default:
+ throw std::invalid_argument("order must be 2, 4, or 8");
+ break;
+ }
+}
+
+float
+digital_costas_loop_cc::phase_detector_8(gr_complex sample) const
+{
+ /* This technique splits the 8PSK constellation into 2 squashed
+ QPSK constellations, one when I is larger than Q and one where
+ Q is larger than I. The error is then calculated proportionally
+ to these squashed constellations by the const K = sqrt(2)-1.
+
+ The signal magnitude must be > 1 or K will incorrectly bias
+ the error value.
+
+ Ref: Z. Huang, Z. Yi, M. Zhang, K. Wang, "8PSK demodulation for
+ new generation DVB-S2", IEEE Proc. Int. Conf. Communications,
+ Circuits and Systems, Vol. 2, pp. 1447 - 1450, 2004.
+ */
+
+ float K = (sqrt(2.0) - 1);
+ if(fabsf(sample.real()) >= fabsf(sample.imag())) {
+ return ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() -
+ (sample.imag()>0 ? 1.0 : -1.0) * sample.real() * K);
+ }
+ else {
+ return ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() * K -
+ (sample.imag()>0 ? 1.0 : -1.0) * sample.real());
+ }
+}
+
+float
+digital_costas_loop_cc::phase_detector_4(gr_complex sample) const
+{
+
+ return ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() -
+ (sample.imag()>0 ? 1.0 : -1.0) * sample.real());
+}
+
+float
+digital_costas_loop_cc::phase_detector_2(gr_complex sample) const
+{
+ return (sample.real()*sample.imag());
+}
+
+int
+digital_costas_loop_cc::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const gr_complex *iptr = (gr_complex *) input_items[0];
+ gr_complex *optr = (gr_complex *) output_items[0];
+ float *foptr = (float *) output_items[1];
+
+ bool write_foptr = output_items.size() >= 2;
+
+ float error;
+ gr_complex nco_out;
+
+ if (write_foptr) {
+
+ for (int i = 0; i < noutput_items; i++){
+ nco_out = gr_expj(-d_phase);
+ optr[i] = iptr[i] * nco_out;
+
+ error = (*this.*d_phase_detector)(optr[i]);
+ error = gr_branchless_clip(error, 1.0);
+
+ advance_loop(error);
+ phase_wrap();
+ frequency_limit();
+
+ foptr[i] = d_freq;
+ }
+ } else {
+ for (int i = 0; i < noutput_items; i++){
+ nco_out = gr_expj(-d_phase);
+ optr[i] = iptr[i] * nco_out;
+
+ error = (*this.*d_phase_detector)(optr[i]);
+ error = gr_branchless_clip(error, 1.0);
+
+ advance_loop(error);
+ phase_wrap();
+ frequency_limit();
+ }
+ }
+ return noutput_items;
+}
diff --git a/gr-digital/lib/digital_cpmmod_bc.cc b/gr-digital/lib/digital_cpmmod_bc.cc
new file mode 100644
index 000000000..a95b604d1
--- /dev/null
+++ b/gr-digital/lib/digital_cpmmod_bc.cc
@@ -0,0 +1,69 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 Free Software Foundation, Inc.
+ *
+ * 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 <digital_cpmmod_bc.h>
+#include <gr_io_signature.h>
+
+
+// Shared pointer constructor
+digital_cpmmod_bc_sptr
+digital_make_cpmmod_bc(int type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta)
+{
+ return gnuradio::get_initial_sptr(new digital_cpmmod_bc((gr_cpm::cpm_type)type,
+ h, samples_per_sym,
+ L, beta));
+}
+
+
+digital_cpmmod_bc::digital_cpmmod_bc(gr_cpm::cpm_type type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta)
+ : gr_hier_block2("digital_cpmmod_bc",
+ gr_make_io_signature(1, 1, sizeof(char)),
+ gr_make_io_signature2(1, 1, sizeof(gr_complex), sizeof(float))),
+ d_taps(gr_cpm::phase_response(type, samples_per_sym, L, beta)),
+ d_char_to_float(gr_make_char_to_float()),
+ d_pulse_shaper(gr_make_interp_fir_filter_fff(samples_per_sym, d_taps)),
+ d_fm(gr_make_frequency_modulator_fc(M_PI * h))
+{
+ switch (type) {
+ case gr_cpm::LRC:
+ case gr_cpm::LSRC:
+ case gr_cpm::LREC:
+ case gr_cpm::TFM:
+ case gr_cpm::GAUSSIAN:
+ break;
+
+ default:
+ throw std::invalid_argument("invalid CPM type");
+ }
+
+ connect(self(), 0, d_char_to_float, 0);
+ connect(d_char_to_float, 0, d_pulse_shaper, 0);
+ connect(d_pulse_shaper, 0, d_fm, 0);
+ connect(d_fm, 0, self(), 0);
+}
+
diff --git a/gnuradio-core/src/lib/general/gr_crc32.cc b/gr-digital/lib/digital_crc32.cc
index d4e843528..8806d6e9c 100644
--- a/gnuradio-core/src/lib/general/gr_crc32.cc
+++ b/gr-digital/lib/digital_crc32.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -27,13 +27,13 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <gr_crc32.h>
+#include <digital_crc32.h>
// Automatically generated CRC function
// polynomial: 0x104C11DB7
unsigned int
-gr_update_crc32(unsigned int crc, const unsigned char *data, size_t len)
+digital_update_crc32(unsigned int crc, const unsigned char *data, size_t len)
{
static const unsigned int table[256] = {
0x00000000U,0x04C11DB7U,0x09823B6EU,0x0D4326D9U,
@@ -112,19 +112,19 @@ gr_update_crc32(unsigned int crc, const unsigned char *data, size_t len)
}
unsigned int
-gr_update_crc32(unsigned int crc, const std::string s)
+digital_update_crc32(unsigned int crc, const std::string s)
{
- return gr_update_crc32(crc, (const unsigned char *) s.data(), s.size());
+ return digital_update_crc32(crc, (const unsigned char *) s.data(), s.size());
}
unsigned int
-gr_crc32(const unsigned char *buf, size_t len)
+digital_crc32(const unsigned char *buf, size_t len)
{
- return gr_update_crc32(0xffffffff, buf, len) ^ 0xffffffff;
+ return digital_update_crc32(0xffffffff, buf, len) ^ 0xffffffff;
}
unsigned int
-gr_crc32(const std::string s)
+digital_crc32(const std::string s)
{
- return gr_crc32((const unsigned char *) s.data(), s.size());
+ return digital_crc32((const unsigned char *) s.data(), s.size());
}
diff --git a/gr-digital/lib/digital_fll_band_edge_cc.cc b/gr-digital/lib/digital_fll_band_edge_cc.cc
new file mode 100644
index 000000000..05c092622
--- /dev/null
+++ b/gr-digital/lib/digital_fll_band_edge_cc.cc
@@ -0,0 +1,259 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009-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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <digital_fll_band_edge_cc.h>
+#include <gr_io_signature.h>
+#include <gr_expj.h>
+#include <cstdio>
+
+#define M_TWOPI (2*M_PI)
+
+float sinc(float x)
+{
+ if(x == 0)
+ return 1;
+ else
+ return sin(M_PI*x)/(M_PI*x);
+}
+
+digital_fll_band_edge_cc_sptr
+digital_make_fll_band_edge_cc (float samps_per_sym, float rolloff,
+ int filter_size, float bandwidth)
+{
+ return gnuradio::get_initial_sptr(new digital_fll_band_edge_cc (samps_per_sym, rolloff,
+ filter_size, bandwidth));
+}
+
+
+static int ios[] = {sizeof(gr_complex), sizeof(float), sizeof(float), sizeof(float)};
+static std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int));
+digital_fll_band_edge_cc::digital_fll_band_edge_cc (float samps_per_sym, float rolloff,
+ int filter_size, float bandwidth)
+ : gr_sync_block ("fll_band_edge_cc",
+ gr_make_io_signature (1, 1, sizeof(gr_complex)),
+ gr_make_io_signaturev (1, 4, iosig)),
+ gri_control_loop(bandwidth, M_TWOPI*(2.0/samps_per_sym), -M_TWOPI*(2.0/samps_per_sym)),
+ d_updated (false)
+{
+ // Initialize samples per symbol
+ if(samps_per_sym <= 0) {
+ throw std::out_of_range ("digital_fll_band_edge_cc: invalid number of sps. Must be > 0.");
+ }
+ d_sps = samps_per_sym;
+
+ // Initialize rolloff factor
+ if(rolloff < 0 || rolloff > 1.0) {
+ throw std::out_of_range ("digital_fll_band_edge_cc: invalid rolloff factor. Must be in [0,1].");
+ }
+ d_rolloff = rolloff;
+
+ // Initialize filter length
+ if(filter_size <= 0) {
+ throw std::out_of_range ("digital_fll_band_edge_cc: invalid filter size. Must be > 0.");
+ }
+ d_filter_size = filter_size;
+
+ // Build the band edge filters
+ design_filter(d_sps, d_rolloff, d_filter_size);
+}
+
+digital_fll_band_edge_cc::~digital_fll_band_edge_cc ()
+{
+}
+
+
+/*******************************************************************
+ SET FUNCTIONS
+*******************************************************************/
+
+void
+digital_fll_band_edge_cc::set_samples_per_symbol(float sps)
+{
+ if(sps <= 0) {
+ throw std::out_of_range ("digital_fll_band_edge_cc: invalid number of sps. Must be > 0.");
+ }
+ d_sps = sps;
+ design_filter(d_sps, d_rolloff, d_filter_size);
+}
+
+void
+digital_fll_band_edge_cc::set_rolloff(float rolloff)
+{
+ if(rolloff < 0 || rolloff > 1.0) {
+ throw std::out_of_range ("digital_fll_band_edge_cc: invalid rolloff factor. Must be in [0,1].");
+ }
+ d_rolloff = rolloff;
+ design_filter(d_sps, d_rolloff, d_filter_size);
+}
+
+void
+digital_fll_band_edge_cc::set_filter_size(int filter_size)
+{
+ if(filter_size <= 0) {
+ throw std::out_of_range ("digital_fll_band_edge_cc: invalid filter size. Must be > 0.");
+ }
+ d_filter_size = filter_size;
+ design_filter(d_sps, d_rolloff, d_filter_size);
+}
+
+/*******************************************************************
+ GET FUNCTIONS
+*******************************************************************/
+
+float
+digital_fll_band_edge_cc::get_samples_per_symbol() const
+{
+ return d_sps;
+}
+
+float
+digital_fll_band_edge_cc::get_rolloff() const
+{
+ return d_rolloff;
+}
+
+int
+digital_fll_band_edge_cc:: get_filter_size() const
+{
+ return d_filter_size;
+}
+
+
+/*******************************************************************
+*******************************************************************/
+
+void
+digital_fll_band_edge_cc::design_filter(float samps_per_sym,
+ float rolloff, int filter_size)
+{
+ int M = rint(filter_size / samps_per_sym);
+ float power = 0;
+
+ // Create the baseband filter by adding two sincs together
+ std::vector<float> bb_taps;
+ for(int i = 0; i < filter_size; i++) {
+ float k = -M + i*2.0/samps_per_sym;
+ float tap = sinc(rolloff*k - 0.5) + sinc(rolloff*k + 0.5);
+ power += tap;
+
+ bb_taps.push_back(tap);
+ }
+
+ d_taps_lower.resize(filter_size);
+ d_taps_upper.resize(filter_size);
+
+ // Create the band edge filters by spinning the baseband
+ // filter up and down to the right places in frequency.
+ // Also, normalize the power in the filters
+ int N = (bb_taps.size() - 1.0)/2.0;
+ for(int i = 0; i < filter_size; i++) {
+ float tap = bb_taps[i] / power;
+
+ float k = (-N + (int)i)/(2.0*samps_per_sym);
+
+ gr_complex t1 = tap * gr_expj(-M_TWOPI*(1+rolloff)*k);
+ gr_complex t2 = tap * gr_expj(M_TWOPI*(1+rolloff)*k);
+
+ d_taps_lower[filter_size-i-1] = t1;
+ d_taps_upper[filter_size-i-1] = t2;
+ }
+
+ d_updated = true;
+
+ // Set the history to ensure enough input items for each filter
+ set_history(filter_size+1);
+}
+
+void
+digital_fll_band_edge_cc::print_taps()
+{
+ unsigned int i;
+
+ printf("Upper Band-edge: [");
+ for(i = 0; i < d_taps_upper.size(); i++) {
+ printf(" %.4e + %.4ej,", d_taps_upper[i].real(), d_taps_upper[i].imag());
+ }
+ printf("]\n\n");
+
+ printf("Lower Band-edge: [");
+ for(i = 0; i < d_taps_lower.size(); i++) {
+ printf(" %.4e + %.4ej,", d_taps_lower[i].real(), d_taps_lower[i].imag());
+ }
+ printf("]\n\n");
+}
+
+int
+digital_fll_band_edge_cc::work (int noutput_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];
+
+ float *frq = NULL;
+ float *phs = NULL;
+ float *err = NULL;
+ if(output_items.size() == 4) {
+ frq = (float *) output_items[1];
+ phs = (float *) output_items[2];
+ err = (float *) output_items[3];
+ }
+
+ if (d_updated) {
+ d_updated = false;
+ return 0; // history requirements may have changed.
+ }
+
+ int i;
+ float error;
+ gr_complex nco_out;
+ gr_complex out_upper, out_lower;
+ for(i = 0; i < noutput_items; i++) {
+ nco_out = gr_expj(d_phase);
+ out[i+d_filter_size-1] = in[i] * nco_out;
+
+ // Perform the dot product of the output with the filters
+ out_upper = 0;
+ out_lower = 0;
+ for(int k = 0; k < d_filter_size; k++) {
+ out_upper += d_taps_upper[k] * out[i+k];
+ out_lower += d_taps_lower[k] * out[i+k];
+ }
+ error = norm(out_lower) - norm(out_upper);
+
+ advance_loop(error);
+ phase_wrap();
+ frequency_limit();
+
+ if(output_items.size() == 4) {
+ frq[i] = d_freq;
+ phs[i] = d_phase;
+ err[i] = error;
+ }
+ }
+
+ return noutput_items;
+}
diff --git a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc b/gr-digital/lib/digital_gmskmod_bc.cc
index f80bfd518..e53e90037 100644
--- a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc
+++ b/gr-digital/lib/digital_gmskmod_bc.cc
@@ -1,9 +1,9 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2010 Free Software Foundation, Inc.
+ * Copyright 2010 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)
@@ -24,19 +24,21 @@
#include "config.h"
#endif
-#include <gr_cma_equalizer_cc.h>
+#include <digital_gmskmod_bc.h>
+#include <gr_io_signature.h>
-gr_cma_equalizer_cc_sptr
-gr_make_cma_equalizer_cc(int num_taps, float modulus, float mu)
+// Shared pointer constructor
+digital_gmskmod_bc_sptr
+digital_make_gmskmod_bc(unsigned samples_per_sym,
+ double bt, unsigned L)
{
- return gnuradio::get_initial_sptr(new gr_cma_equalizer_cc(num_taps, modulus, mu));
+ return gnuradio::get_initial_sptr(new digital_gmskmod_bc(samples_per_sym, bt, L));
}
-gr_cma_equalizer_cc::gr_cma_equalizer_cc(int num_taps, float modulus, float mu)
- : gr_adaptive_fir_ccf("cma_equalizer_cc", 1, std::vector<float>(num_taps)),
- d_modulus(modulus), d_mu(mu)
+
+digital_gmskmod_bc::digital_gmskmod_bc(unsigned samples_per_sym,
+ double bt, unsigned L)
+ : digital_cpmmod_bc(gr_cpm::GAUSSIAN, 0.5, samples_per_sym, L, bt)
{
- if (num_taps > 0)
- d_taps[0] = 1.0;
}
diff --git a/gr-digital/lib/digital_kurtotic_equalizer_cc.cc b/gr-digital/lib/digital_kurtotic_equalizer_cc.cc
new file mode 100644
index 000000000..c95b56021
--- /dev/null
+++ b/gr-digital/lib/digital_kurtotic_equalizer_cc.cc
@@ -0,0 +1,51 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <digital_kurtotic_equalizer_cc.h>
+
+digital_kurtotic_equalizer_cc_sptr
+digital_make_kurtotic_equalizer_cc(int num_taps, float mu)
+{
+ return gnuradio::get_initial_sptr(new digital_kurtotic_equalizer_cc(num_taps, mu));
+}
+
+digital_kurtotic_equalizer_cc::digital_kurtotic_equalizer_cc(int num_taps, float mu)
+ : gr_adaptive_fir_ccc("kurtotic_equalizer_cc", 1, std::vector<gr_complex>(num_taps))
+{
+ set_gain(mu);
+ if (num_taps > 0)
+ d_taps[0] = 1.0;
+
+ d_alpha_p = 0.01;
+ d_alpha_q = 0.01;
+ d_alpha_m = 0.01;
+
+ d_p = 0.0f;
+ d_m = 0.0f;
+ d_q = gr_complex(0,0);
+ d_u = gr_complex(0,0);
+}
+
diff --git a/gr-digital/lib/digital_lms_dd_equalizer_cc.cc b/gr-digital/lib/digital_lms_dd_equalizer_cc.cc
new file mode 100644
index 000000000..e2c2f16f2
--- /dev/null
+++ b/gr-digital/lib/digital_lms_dd_equalizer_cc.cc
@@ -0,0 +1,85 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <digital_lms_dd_equalizer_cc.h>
+#include <gr_io_signature.h>
+#include <gr_misc.h>
+#include <iostream>
+
+digital_lms_dd_equalizer_cc_sptr
+digital_make_lms_dd_equalizer_cc(int num_taps, float mu, int sps,
+ digital_constellation_sptr cnst)
+{
+ return gnuradio::get_initial_sptr(new digital_lms_dd_equalizer_cc(num_taps, mu,
+ sps, cnst));
+}
+
+digital_lms_dd_equalizer_cc::digital_lms_dd_equalizer_cc(int num_taps, float mu,
+ int sps,
+ digital_constellation_sptr cnst)
+ : gr_adaptive_fir_ccc("lms_dd_equalizer_cc", sps,
+ std::vector<gr_complex>(num_taps, gr_complex(0,0))),
+ d_taps(num_taps), d_cnst(cnst)
+{
+ set_gain(mu);
+ if (num_taps > 0)
+ d_taps[num_taps/2] = 1.0;
+}
+
+
+
+
+/*
+int
+digital_lms_dd_equalizer_cc::work (int noutput_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];
+
+ gr_complex acc, decision, error;
+
+ for(int i = 0; i < noutput_items; i++) {
+ acc = 0;
+
+ // Compute output
+ for (size_t j=0; j < d_taps.size(); j++)
+ acc += in[i+j] * conj(d_taps[j]);
+
+ d_cnst->map_to_points(d_cnst->decision_maker(&acc), &decision);
+ error = decision - acc;
+
+ // Update taps
+ for (size_t j=0; j < d_taps.size(); j++)
+ d_taps[j] += d_mu * conj(error) * in[i+j];
+
+ out[i] = acc;
+ }
+
+ return noutput_items;
+}
+*/
diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc b/gr-digital/lib/digital_mpsk_receiver_cc.cc
index bc51c6769..363b86c9f 100644
--- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
+++ b/gr-digital/lib/digital_mpsk_receiver_cc.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2006,2007,2010 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2007,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -26,7 +26,7 @@
#include <gr_io_signature.h>
#include <gr_prefs.h>
-#include <gr_mpsk_receiver_cc.h>
+#include <digital_mpsk_receiver_cc.h>
#include <stdexcept>
#include <gr_math.h>
#include <gr_expj.h>
@@ -39,30 +39,32 @@
// Public constructor
-gr_mpsk_receiver_cc_sptr
-gr_make_mpsk_receiver_cc(unsigned int M, float theta,
- float alpha, float beta,
+digital_mpsk_receiver_cc_sptr
+digital_make_mpsk_receiver_cc(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 gr_mpsk_receiver_cc (M, theta,
- alpha, beta,
- fmin, fmax,
- mu, gain_mu,
- omega, gain_omega, omega_rel));
+ return gnuradio::get_initial_sptr(new digital_mpsk_receiver_cc (M, theta,
+ loop_bw,
+ fmin, fmax,
+ mu, gain_mu,
+ omega, gain_omega,
+ omega_rel));
}
-gr_mpsk_receiver_cc::gr_mpsk_receiver_cc (unsigned int M, float theta,
- float alpha, float beta,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel)
+digital_mpsk_receiver_cc::digital_mpsk_receiver_cc (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)
: gr_block ("mpsk_receiver_cc",
gr_make_io_signature (1, 1, sizeof (gr_complex)),
gr_make_io_signature (1, 1, sizeof (gr_complex))),
+ gri_control_loop(loop_bw, fmax, fmin),
d_M(M), d_theta(theta),
- d_alpha(alpha), d_beta(beta), d_freq(0), d_max_freq(fmax), d_min_freq(fmin), d_phase(0),
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),
@@ -90,29 +92,29 @@ gr_mpsk_receiver_cc::gr_mpsk_receiver_cc (unsigned int M, float theta,
// 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 = &gr_mpsk_receiver_cc::phase_error_detector_bpsk; //bpsk;
- d_decision = &gr_mpsk_receiver_cc::decision_bpsk;
+ d_phase_error_detector = &digital_mpsk_receiver_cc::phase_error_detector_bpsk; //bpsk;
+ d_decision = &digital_mpsk_receiver_cc::decision_bpsk;
break;
case 4: // optimized algorithms for QPSK
- d_phase_error_detector = &gr_mpsk_receiver_cc::phase_error_detector_qpsk; //qpsk;
- d_decision = &gr_mpsk_receiver_cc::decision_qpsk;
+ d_phase_error_detector = &digital_mpsk_receiver_cc::phase_error_detector_qpsk; //qpsk;
+ d_decision = &digital_mpsk_receiver_cc::decision_qpsk;
break;
default: // generic algorithms for any M (power of 2?) but not pretty
- d_phase_error_detector = &gr_mpsk_receiver_cc::phase_error_detector_generic;
- d_decision = &gr_mpsk_receiver_cc::decision_generic;
+ d_phase_error_detector = &digital_mpsk_receiver_cc::phase_error_detector_generic;
+ d_decision = &digital_mpsk_receiver_cc::decision_generic;
break;
}
}
-gr_mpsk_receiver_cc::~gr_mpsk_receiver_cc ()
+digital_mpsk_receiver_cc::~digital_mpsk_receiver_cc ()
{
delete d_interp;
}
void
-gr_mpsk_receiver_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required)
+digital_mpsk_receiver_cc::forecast(int noutput_items, gr_vector_int &ninput_items_required)
{
unsigned ninputs = ninput_items_required.size();
for (unsigned i=0; i < ninputs; i++)
@@ -121,7 +123,7 @@ gr_mpsk_receiver_cc::forecast(int noutput_items, gr_vector_int &ninput_items_req
// FIXME add these back in an test difference in performance
float
-gr_mpsk_receiver_cc::phase_error_detector_qpsk(gr_complex sample) const
+digital_mpsk_receiver_cc::phase_error_detector_qpsk(gr_complex sample) const
{
float phase_error = 0;
if(fabsf(sample.real()) > fabsf(sample.imag())) {
@@ -141,26 +143,26 @@ gr_mpsk_receiver_cc::phase_error_detector_qpsk(gr_complex sample) const
}
float
-gr_mpsk_receiver_cc::phase_error_detector_bpsk(gr_complex sample) const
+digital_mpsk_receiver_cc::phase_error_detector_bpsk(gr_complex sample) const
{
return -(sample.real()*sample.imag());
}
-float gr_mpsk_receiver_cc::phase_error_detector_generic(gr_complex sample) const
+float digital_mpsk_receiver_cc::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
-gr_mpsk_receiver_cc::decision_bpsk(gr_complex sample) const
+digital_mpsk_receiver_cc::decision_bpsk(gr_complex sample) const
{
return (gr_branchless_binary_slicer(sample.real()) ^ 1);
//return gr_binary_slicer(sample.real()) ^ 1;
}
unsigned int
-gr_mpsk_receiver_cc::decision_qpsk(gr_complex sample) const
+digital_mpsk_receiver_cc::decision_qpsk(gr_complex sample) const
{
unsigned int index;
@@ -170,7 +172,7 @@ gr_mpsk_receiver_cc::decision_qpsk(gr_complex sample) const
}
unsigned int
-gr_mpsk_receiver_cc::decision_generic(gr_complex sample) const
+digital_mpsk_receiver_cc::decision_generic(gr_complex sample) const
{
unsigned int min_m = 0;
float min_s = 65535;
@@ -191,7 +193,7 @@ gr_mpsk_receiver_cc::decision_generic(gr_complex sample) const
void
-gr_mpsk_receiver_cc::make_constellation()
+digital_mpsk_receiver_cc::make_constellation()
{
for(unsigned int m=0; m < d_M; m++) {
d_constellation.push_back(gr_expj((M_TWOPI/d_M)*m));
@@ -199,7 +201,7 @@ gr_mpsk_receiver_cc::make_constellation()
}
void
-gr_mpsk_receiver_cc::mm_sampler(const gr_complex symbol)
+digital_mpsk_receiver_cc::mm_sampler(const gr_complex symbol)
{
gr_complex sample, nco;
@@ -222,7 +224,7 @@ gr_mpsk_receiver_cc::mm_sampler(const gr_complex symbol)
}
void
-gr_mpsk_receiver_cc::mm_error_tracking(gr_complex sample)
+digital_mpsk_receiver_cc::mm_error_tracking(gr_complex sample)
{
gr_complex u, x, y;
float mm_error = 0;
@@ -259,24 +261,16 @@ gr_mpsk_receiver_cc::mm_error_tracking(gr_complex sample)
void
-gr_mpsk_receiver_cc::phase_error_tracking(gr_complex sample)
+digital_mpsk_receiver_cc::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);
-
- d_freq += d_beta*phase_error; // adjust frequency based on error
- d_phase += d_freq + d_alpha*phase_error; // adjust phase based on error
-
- // Make sure we stay within +-2pi
- while(d_phase > M_TWOPI)
- d_phase -= M_TWOPI;
- while(d_phase < -M_TWOPI)
- d_phase += M_TWOPI;
- // Limit the frequency range
- d_freq = gr_branchless_clip(d_freq, d_max_freq);
+ 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",
@@ -286,10 +280,10 @@ gr_mpsk_receiver_cc::phase_error_tracking(gr_complex sample)
}
int
-gr_mpsk_receiver_cc::general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+digital_mpsk_receiver_cc::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];
diff --git a/gr-cvsd-vocoder/src/python/.gitignore b/gr-digital/python/.gitignore
index 604b402c5..604b402c5 100644
--- a/gr-cvsd-vocoder/src/python/.gitignore
+++ b/gr-digital/python/.gitignore
diff --git a/gr-gsm-fr-vocoder/src/python/Makefile.am b/gr-digital/python/Makefile.am
index 8a97395ee..cd98fe2d4 100644
--- a/gr-gsm-fr-vocoder/src/python/Makefile.am
+++ b/gr-digital/python/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2004 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,10 +21,43 @@
include $(top_srcdir)/Makefile.common
+TESTS =
EXTRA_DIST += run_tests.in
-TESTS = run_tests
+if PYTHON
+SUBDIRS = utils
+TESTS += run_tests
-noinst_PYTHON = \
- encdec.py \
- qa_gsm_full_rate.py
+digitaldir = $(grpythondir)/digital
+
+noinst_PYTHON = \
+ qa_digital.py \
+ qa_binary_slicer_fb.py \
+ qa_clock_recovery_mm.py \
+ qa_cma_equalizer.py \
+ qa_cpm.py \
+ qa_constellation.py \
+ qa_constellation_receiver.py \
+ qa_constellation_decoder_cb.py \
+ qa_correlate_access_code.py \
+ qa_costas_loop_cc.py \
+ qa_crc32.py \
+ qa_fll_band_edge.py \
+ qa_lms_equalizer.py \
+ qa_mpsk_receiver.py
+
+digital_PYTHON = \
+ __init__.py \
+ bpsk.py \
+ cpm.py \
+ crc.py \
+ generic_mod_demod.py \
+ gmsk.py \
+ modulation_utils2.py \
+ packet_utils.py \
+ pkt.py \
+ psk.py \
+ psk2.py \
+ qam.py \
+ qpsk.py
+endif
diff --git a/gr-digital/python/__init__.py b/gr-digital/python/__init__.py
new file mode 100644
index 000000000..ca46dcfdb
--- /dev/null
+++ b/gr-digital/python/__init__.py
@@ -0,0 +1,37 @@
+# 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.
+#
+
+'''
+This is the gr-digital package. It contains all of the blocks,
+utilities, and examples for doing digital modulation and demodulation.
+'''
+
+# The presence of this file turns this directory into a Python package
+
+from digital_swig import *
+from psk2 import *
+from bpsk import *
+from qpsk import *
+from qam import *
+from gmsk import *
+from pkt import *
+from crc import *
+from packet_utils import *
+from modulation_utils2 import *
diff --git a/gr-digital/python/bpsk.py b/gr-digital/python/bpsk.py
new file mode 100644
index 000000000..58a8289a5
--- /dev/null
+++ b/gr-digital/python/bpsk.py
@@ -0,0 +1,171 @@
+#
+# 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 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.
+#
+
+"""
+BPSK modulation and demodulation.
+"""
+
+from math import pi, log
+from cmath import exp
+
+from gnuradio import gr
+from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
+import digital_swig
+import modulation_utils2
+
+# Default number of points in constellation.
+_def_constellation_points = 2
+# Whether differential coding is used.
+_def_differential = False
+
+# /////////////////////////////////////////////////////////////////////////////
+# BPSK constellation
+# /////////////////////////////////////////////////////////////////////////////
+
+def bpsk_constellation(m=_def_constellation_points):
+ if m != _def_constellation_points:
+ raise ValueError("BPSK can only have 2 constellation points.")
+ return digital_swig.constellation_bpsk()
+
+# /////////////////////////////////////////////////////////////////////////////
+# BPSK modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class bpsk_mod(generic_mod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=False, *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered BPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_mod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_bpsk()
+ if constellation_points != 2:
+ raise ValueError('Number of constellation points must be 2 for BPSK.')
+ super(bpsk_mod, self).__init__(constellation=constellation,
+ differential=differential, *args, **kwargs)
+
+# /////////////////////////////////////////////////////////////////////////////
+# BPSK demodulator
+#
+# /////////////////////////////////////////////////////////////////////////////
+
+class bpsk_demod(generic_demod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=False, *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered BPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_demod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_bpsk()
+ if constellation_points != 2:
+ raise ValueError('Number of constellation points must be 2 for BPSK.')
+ super(bpsk_demod, self).__init__(constellation=constellation,
+ differential=differential, *args, **kwargs)
+
+
+
+# /////////////////////////////////////////////////////////////////////////////
+# DBPSK constellation
+# /////////////////////////////////////////////////////////////////////////////
+
+def dbpsk_constellation(m=_def_constellation_points):
+ if m != _def_constellation_points:
+ raise ValueError("DBPSK can only have 2 constellation points.")
+ return digital_swig.constellation_dbpsk()
+
+# /////////////////////////////////////////////////////////////////////////////
+# DBPSK modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class dbpsk_mod(generic_mod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=True, *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered DBPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_mod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_bpsk()
+ if constellation_points != 2:
+ raise ValueError('Number of constellation points must be 2 for DBPSK.')
+ super(dbpsk_mod, self).__init__(constellation=constellation,
+ differential=True,
+ *args, **kwargs)
+
+# /////////////////////////////////////////////////////////////////////////////
+# DBPSK demodulator
+#
+# /////////////////////////////////////////////////////////////////////////////
+
+class dbpsk_demod(generic_demod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=True, *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered DBPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_demod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_bpsk()
+ if constellation_points != 2:
+ raise ValueError('Number of constellation points must be 2 for DBPSK.')
+ super(dbpsk_demod, self).__init__(constellation=constellation,
+ differential=True,
+ *args, **kwargs)
+
+#
+# Add these to the mod/demod registry
+#
+modulation_utils2.add_type_1_mod('bpsk', bpsk_mod)
+modulation_utils2.add_type_1_demod('bpsk', bpsk_demod)
+modulation_utils2.add_type_1_constellation('bpsk', bpsk_constellation)
+modulation_utils2.add_type_1_mod('dbpsk', dbpsk_mod)
+modulation_utils2.add_type_1_demod('dbpsk', dbpsk_demod)
+modulation_utils2.add_type_1_constellation('dbpsk', dbpsk_constellation)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/cpm.py b/gr-digital/python/cpm.py
index 8f593cd51..8f593cd51 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/cpm.py
+++ b/gr-digital/python/cpm.py
diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/crc.py b/gr-digital/python/crc.py
index d31aca0ea..198ab059f 100644
--- a/gnuradio-core/src/python/gnuradio/gruimpl/crc.py
+++ b/gr-digital/python/crc.py
@@ -1,5 +1,5 @@
#
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,20 +19,20 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr
-from hexint import *
+from gnuradio import gru
+import digital_swig
import struct
def gen_and_append_crc32(s):
- crc = gr.crc32(s)
- return s + struct.pack(">I", hexint(crc) & 0xFFFFFFFF)
+ crc = digital_swig.crc32(s)
+ return s + struct.pack(">I", gru.hexint(crc) & 0xFFFFFFFF)
def check_crc32(s):
if len(s) < 4:
return (False, '')
msg = s[:-4]
#print "msg = '%s'" % (msg,)
- actual = gr.crc32(msg)
+ actual = digital_swig.crc32(msg)
(expected,) = struct.unpack(">I", s[-4:])
# print "actual =", hex(actual), "expected =", hex(expected)
return (actual == expected, msg)
diff --git a/gr-digital/python/generic_mod_demod.py b/gr-digital/python/generic_mod_demod.py
new file mode 100644
index 000000000..dec96e455
--- /dev/null
+++ b/gr-digital/python/generic_mod_demod.py
@@ -0,0 +1,387 @@
+#
+# Copyright 2005,2006,2007,2009,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.
+#
+
+# See gnuradio-examples/python/digital for examples
+
+"""
+Generic modulation and demodulation.
+"""
+
+from gnuradio import gr
+from modulation_utils2 import extract_kwargs_from_options_for_class
+from utils import mod_codes
+import digital_swig
+import math
+
+# default values (used in __init__ and add_options)
+_def_samples_per_symbol = 2
+_def_excess_bw = 0.35
+_def_verbose = False
+_def_log = False
+
+# Frequency correction
+_def_freq_bw = 2*math.pi/100.0
+# Symbol timing recovery
+_def_timing_bw = 2*math.pi/100.0
+_def_timing_max_dev = 1.5
+# Fine frequency / Phase correction
+_def_phase_bw = 2*math.pi/100.0
+# Number of points in constellation
+_def_constellation_points = 16
+# Whether differential coding is used.
+_def_differential = False
+
+def add_common_options(parser):
+ """
+ Sets options common to both modulator and demodulator.
+ """
+ parser.add_option("-p", "--constellation-points", type="int", default=_def_constellation_points,
+ help="set the number of constellation points (must be a power of 2 for psk, power of 4 for QAM) [default=%default]")
+ parser.add_option("", "--non-differential", action="store_false",
+ dest="differential",
+ help="do not use differential encoding [default=False]")
+ parser.add_option("", "--differential", action="store_true",
+ dest="differential", default=True,
+ help="use differential encoding [default=%default]")
+ parser.add_option("", "--mod-code", type="choice", choices=mod_codes.codes,
+ default=mod_codes.NO_CODE,
+ help="Select modulation code from: %s [default=%%default]"
+ % (', '.join(mod_codes.codes),))
+ parser.add_option("", "--excess-bw", type="float", default=_def_excess_bw,
+ help="set RRC excess bandwith factor [default=%default]")
+
+
+# /////////////////////////////////////////////////////////////////////////////
+# Generic modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class generic_mod(gr.hier_block2):
+
+ def __init__(self, constellation,
+ samples_per_symbol=_def_samples_per_symbol,
+ differential=_def_differential,
+ excess_bw=_def_excess_bw,
+ gray_coded=True,
+ verbose=_def_verbose,
+ log=_def_log):
+ """
+ Hierarchical block for RRC-filtered differential generic modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ @param constellation: determines the modulation type
+ @type constellation: gnuradio.digital.gr_constellation
+ @param samples_per_symbol: samples per baud >= 2
+ @type samples_per_symbol: float
+ @param excess_bw: Root-raised cosine filter excess bandwidth
+ @type excess_bw: float
+ @param gray_coded: turn gray coding on/off
+ @type gray_coded: bool
+ @param verbose: Print information about modulator?
+ @type verbose: bool
+ @param log: Log modulation data to files?
+ @type log: bool
+ """
+
+ gr.hier_block2.__init__(self, "generic_mod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+
+ self._constellation = constellation.base()
+ self._samples_per_symbol = samples_per_symbol
+ self._excess_bw = excess_bw
+ self._differential = differential
+
+ if self._samples_per_symbol < 2:
+ raise TypeError, ("sbp must be >= 2, is %f" % self._samples_per_symbol)
+
+ arity = pow(2,self.bits_per_symbol())
+
+ # turn bytes into k-bit vectors
+ self.bytes2chunks = \
+ gr.packed_to_unpacked_bb(self.bits_per_symbol(), gr.GR_MSB_FIRST)
+
+ if gray_coded == True:
+ self.symbol_mapper = gr.map_bb(self._constellation.pre_diff_code())
+
+ if differential:
+ self.diffenc = gr.diff_encoder_bb(arity)
+
+ self.chunks2symbols = gr.chunks_to_symbols_bc(self._constellation.points())
+
+ # pulse shaping filter
+ nfilts = 32
+ ntaps = nfilts * 11 * int(self._samples_per_symbol) # make nfilts filters of ntaps each
+ self.rrc_taps = gr.firdes.root_raised_cosine(
+ nfilts, # gain
+ nfilts, # sampling rate based on 32 filters in resampler
+ 1.0, # symbol rate
+ self._excess_bw, # excess bandwidth (roll-off factor)
+ ntaps)
+ self.rrc_filter = gr.pfb_arb_resampler_ccf(self._samples_per_symbol,
+ self.rrc_taps)
+
+ # Connect
+ blocks = [self, self.bytes2chunks]
+ if gray_coded == True:
+ blocks.append(self.symbol_mapper)
+ if differential:
+ blocks.append(self.diffenc)
+ blocks += [self.chunks2symbols, self.rrc_filter, self]
+ self.connect(*blocks)
+
+ if verbose:
+ self._print_verbage()
+
+ if log:
+ self._setup_logging()
+
+
+ def samples_per_symbol(self):
+ return self._samples_per_symbol
+
+ def bits_per_symbol(self): # static method that's also callable on an instance
+ return self._constellation.bits_per_symbol()
+
+ def add_options(parser):
+ """
+ Adds generic modulation options to the standard parser
+ """
+ add_common_options(parser)
+ add_options=staticmethod(add_options)
+
+ def extract_kwargs_from_options(cls, options):
+ """
+ Given command line options, create dictionary suitable for passing to __init__
+ """
+ return extract_kwargs_from_options_for_class(cls, options)
+ extract_kwargs_from_options=classmethod(extract_kwargs_from_options)
+
+
+ def _print_verbage(self):
+ print "\nModulator:"
+ print "bits per symbol: %d" % self.bits_per_symbol()
+ print "RRC roll-off factor: %.2f" % self._excess_bw
+
+ def _setup_logging(self):
+ print "Modulation logging turned on."
+ self.connect(self.bytes2chunks,
+ gr.file_sink(gr.sizeof_char, "tx_bytes2chunks.8b"))
+ if self._constellation.apply_pre_diff_code():
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "tx_symbol_mapper.8b"))
+ if self._differential:
+ self.connect(self.diffenc,
+ gr.file_sink(gr.sizeof_char, "tx_diffenc.8b"))
+ self.connect(self.chunks2symbols,
+ gr.file_sink(gr.sizeof_gr_complex, "tx_chunks2symbols.32fc"))
+ self.connect(self.rrc_filter,
+ gr.file_sink(gr.sizeof_gr_complex, "tx_rrc_filter.32fc"))
+
+
+# /////////////////////////////////////////////////////////////////////////////
+# Generic demodulator
+#
+# Differentially coherent detection of differentially encoded generically
+# modulated signal.
+# /////////////////////////////////////////////////////////////////////////////
+
+class generic_demod(gr.hier_block2):
+
+ def __init__(self, constellation,
+ samples_per_symbol=_def_samples_per_symbol,
+ differential=_def_differential,
+ excess_bw=_def_excess_bw,
+ gray_coded=True,
+ freq_bw=_def_freq_bw,
+ timing_bw=_def_timing_bw,
+ phase_bw=_def_phase_bw,
+ verbose=_def_verbose,
+ log=_def_log):
+ """
+ Hierarchical block for RRC-filtered differential generic demodulation.
+
+ The input is the complex modulated signal at baseband.
+ The output is a stream of bits packed 1 bit per byte (LSB)
+
+ @param constellation: determines the modulation type
+ @type constellation: gnuradio.digital.gr_constellation
+ @param samples_per_symbol: samples per symbol >= 2
+ @type samples_per_symbol: float
+ @param excess_bw: Root-raised cosine filter excess bandwidth
+ @type excess_bw: float
+ @param gray_coded: turn gray coding on/off
+ @type gray_coded: bool
+ @param freq_bw: loop filter lock-in bandwidth
+ @type freq_bw: float
+ @param timing_bw: timing recovery loop lock-in bandwidth
+ @type timing_bw: float
+ @param phase_bw: phase recovery loop bandwidth
+ @type phase_bw: float
+ @param verbose: Print information about modulator?
+ @type verbose: bool
+ @param debug: Print modualtion data to files?
+ @type debug: bool
+ """
+
+ gr.hier_block2.__init__(self, "generic_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+
+ self._constellation = constellation.base()
+ self._samples_per_symbol = samples_per_symbol
+ self._excess_bw = excess_bw
+ self._phase_bw = phase_bw
+ self._freq_bw = freq_bw
+ self._timing_bw = timing_bw
+ self._timing_max_dev= _def_timing_max_dev
+ self._differential = differential
+
+ if self._samples_per_symbol < 2:
+ raise TypeError, ("sbp must be >= 2, is %d" % self._samples_per_symbol)
+
+ arity = pow(2,self.bits_per_symbol())
+
+ nfilts = 32
+ ntaps = 11 * int(self._samples_per_symbol*nfilts)
+
+ # Automatic gain control
+ self.agc = gr.agc2_cc(0.6e-1, 1e-3, 1, 1, 100)
+
+ # Frequency correction
+ fll_ntaps = 55
+ self.freq_recov = digital_swig.fll_band_edge_cc(self._samples_per_symbol, self._excess_bw,
+ fll_ntaps, self._freq_bw)
+
+ # symbol timing recovery with RRC data filter
+ taps = gr.firdes.root_raised_cosine(nfilts, nfilts*self._samples_per_symbol,
+ 1.0, self._excess_bw, ntaps)
+ self.time_recov = gr.pfb_clock_sync_ccf(self._samples_per_symbol,
+ self._timing_bw, taps,
+ nfilts, nfilts//2, self._timing_max_dev)
+
+ fmin = -0.25
+ fmax = 0.25
+ self.receiver = digital_swig.constellation_receiver_cb(
+ self._constellation, self._phase_bw,
+ fmin, fmax)
+
+ # Do differential decoding based on phase change of symbols
+ if differential:
+ self.diffdec = gr.diff_decoder_bb(arity)
+
+ if gray_coded:
+ self.symbol_mapper = gr.map_bb(
+ mod_codes.invert_code(self._constellation.pre_diff_code()))
+
+ # unpack the k bit vector into a stream of bits
+ self.unpack = gr.unpack_k_bits_bb(self.bits_per_symbol())
+
+ if verbose:
+ self._print_verbage()
+
+ if log:
+ self._setup_logging()
+
+ # Connect and Initialize base class
+ blocks = [self, self.agc, self.freq_recov,
+ self.time_recov, self.receiver]
+ if differential:
+ blocks.append(self.diffdec)
+ if self._constellation.apply_pre_diff_code():
+ blocks.append(self.symbol_mapper)
+ blocks += [self.unpack, self]
+ self.connect(*blocks)
+
+ def samples_per_symbol(self):
+ return self._samples_per_symbol
+
+ def bits_per_symbol(self): # staticmethod that's also callable on an instance
+ return self._constellation.bits_per_symbol()
+
+ def _print_verbage(self):
+ print "\nDemodulator:"
+ print "bits per symbol: %d" % self.bits_per_symbol()
+ print "RRC roll-off factor: %.2f" % self._excess_bw
+ print "FLL bandwidth: %.2e" % self._freq_bw
+ print "Timing bandwidth: %.2e" % self._timing_bw
+ print "Phase bandwidth: %.2e" % self._phase_bw
+
+ def _setup_logging(self):
+ print "Modulation logging turned on."
+ self.connect(self.agc,
+ gr.file_sink(gr.sizeof_gr_complex, "rx_agc.32fc"))
+ self.connect((self.freq_recov, 0),
+ gr.file_sink(gr.sizeof_gr_complex, "rx_freq_recov.32fc"))
+ self.connect((self.freq_recov, 1),
+ gr.file_sink(gr.sizeof_float, "rx_freq_recov_freq.32f"))
+ self.connect((self.freq_recov, 2),
+ gr.file_sink(gr.sizeof_float, "rx_freq_recov_phase.32f"))
+ self.connect((self.freq_recov, 3),
+ gr.file_sink(gr.sizeof_float, "rx_freq_recov_error.32f"))
+ self.connect((self.time_recov, 0),
+ gr.file_sink(gr.sizeof_gr_complex, "rx_time_recov.32fc"))
+ self.connect((self.time_recov, 1),
+ gr.file_sink(gr.sizeof_float, "rx_time_recov_error.32f"))
+ self.connect((self.time_recov, 2),
+ gr.file_sink(gr.sizeof_float, "rx_time_recov_rate.32f"))
+ self.connect((self.time_recov, 3),
+ gr.file_sink(gr.sizeof_float, "rx_time_recov_phase.32f"))
+ self.connect((self.receiver, 0),
+ gr.file_sink(gr.sizeof_char, "rx_receiver.8b"))
+ self.connect((self.receiver, 1),
+ gr.file_sink(gr.sizeof_float, "rx_receiver_error.32f"))
+ self.connect((self.receiver, 2),
+ gr.file_sink(gr.sizeof_float, "rx_receiver_phase.32f"))
+ self.connect((self.receiver, 3),
+ gr.file_sink(gr.sizeof_float, "rx_receiver_freq.32f"))
+ if self._differential:
+ self.connect(self.diffdec,
+ gr.file_sink(gr.sizeof_char, "rx_diffdec.8b"))
+ if self._constellation.apply_pre_diff_code():
+ self.connect(self.symbol_mapper,
+ gr.file_sink(gr.sizeof_char, "rx_symbol_mapper.8b"))
+ self.connect(self.unpack,
+ gr.file_sink(gr.sizeof_char, "rx_unpack.8b"))
+
+ def add_options(parser):
+ """
+ Adds generic demodulation options to the standard parser
+ """
+ # Add options shared with modulator.
+ add_common_options(parser)
+ # Add options specific to demodulator.
+ parser.add_option("", "--freq-bw", type="float", default=_def_freq_bw,
+ help="set frequency lock loop lock-in bandwidth [default=%default]")
+ parser.add_option("", "--phase-bw", type="float", default=_def_phase_bw,
+ help="set phase tracking loop lock-in bandwidth [default=%default]")
+ parser.add_option("", "--timing-bw", type="float", default=_def_timing_bw,
+ help="set timing symbol sync loop gain lock-in bandwidth [default=%default]")
+ add_options=staticmethod(add_options)
+
+ def extract_kwargs_from_options(cls, options):
+ """
+ Given command line options, create dictionary suitable for passing to __init__
+ """
+ return extract_kwargs_from_options_for_class(cls, options)
+ extract_kwargs_from_options=classmethod(extract_kwargs_from_options)
+
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py b/gr-digital/python/gmsk.py
index 3b6c016a0..c7a50f422 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/gmsk.py
+++ b/gr-digital/python/gmsk.py
@@ -25,7 +25,9 @@
# See gnuradio-examples/python/digital for examples
from gnuradio import gr
-from gnuradio import modulation_utils
+import digital_swig
+import modulation_utils2
+
from math import pi
import numpy
from pprint import pprint
@@ -37,11 +39,9 @@ _def_bt = 0.35
_def_verbose = False
_def_log = False
-_def_gain_mu = None
-_def_mu = 0.5
-_def_freq_error = 0.0
-_def_omega_relative_limit = 0.005
-
+# Symbol timing recovery
+_def_timing_bw = 2*pi/100.0
+_def_timing_max_dev = 1.5
# /////////////////////////////////////////////////////////////////////////////
# GMSK modulator
@@ -78,8 +78,11 @@ class gmsk_mod(gr.hier_block2):
self._samples_per_symbol = samples_per_symbol
self._bt = bt
- if not isinstance(samples_per_symbol, int) or samples_per_symbol < 2:
- raise TypeError, ("samples_per_symbol must be an integer >= 2, is %r" % (samples_per_symbol,))
+ self._differential = False # make consistant with other modulators
+
+ if samples_per_symbol < 2:
+ raise TypeError, ("samples_per_symbol must >= 2, is %r" % \
+ (samples_per_symbol,))
ntaps = 4 * samples_per_symbol # up to 3 bits in filter at once
sensitivity = (pi / 2) / samples_per_symbol # phase change per bit = pi / 2
@@ -93,12 +96,12 @@ class gmsk_mod(gr.hier_block2):
1, # gain
samples_per_symbol, # symbol_rate
bt, # bandwidth * symbol time
- ntaps # number of taps
+ int(ntaps) # number of taps
)
- self.sqwave = (1,) * samples_per_symbol # rectangular window
+ self.sqwave = (1,) * int(samples_per_symbol) # rectangular window
self.taps = numpy.convolve(numpy.array(self.gaussian_taps),numpy.array(self.sqwave))
- self.gaussian_filter = gr.interp_fir_filter_fff(samples_per_symbol, self.taps)
+ self.gaussian_filter = gr.pfb_arb_resampler_fff(samples_per_symbol, self.taps)
# FM modulation
self.fmmod = gr.frequency_modulator_fc(sensitivity)
@@ -128,11 +131,11 @@ class gmsk_mod(gr.hier_block2):
def _setup_logging(self):
print "Modulation logging turned on."
self.connect(self.nrz,
- gr.file_sink(gr.sizeof_float, "nrz.dat"))
+ gr.file_sink(gr.sizeof_float, "tx_gmsk_nrz.32f"))
self.connect(self.gaussian_filter,
- gr.file_sink(gr.sizeof_float, "gaussian_filter.dat"))
+ gr.file_sink(gr.sizeof_float, "tx_gmsk_gaussian_filter.32f"))
self.connect(self.fmmod,
- gr.file_sink(gr.sizeof_gr_complex, "fmmod.dat"))
+ gr.file_sink(gr.sizeof_gr_complex, "tx_gmsk_fmmod.32fc"))
def add_options(parser):
@@ -148,7 +151,7 @@ class gmsk_mod(gr.hier_block2):
"""
Given command line options, create dictionary suitable for passing to __init__
"""
- return modulation_utils.extract_kwargs_from_options(gmsk_mod.__init__,
+ return modulation_utils2.extract_kwargs_from_options(gmsk_mod.__init__,
('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
@@ -162,10 +165,8 @@ class gmsk_demod(gr.hier_block2):
def __init__(self,
samples_per_symbol=_def_samples_per_symbol,
- gain_mu=_def_gain_mu,
- mu=_def_mu,
- omega_relative_limit=_def_omega_relative_limit,
- freq_error=_def_freq_error,
+ bt=_def_bt,
+ timing_bw=_def_timing_bw,
verbose=_def_verbose,
log=_def_log):
"""
@@ -177,21 +178,12 @@ class gmsk_demod(gr.hier_block2):
@param samples_per_symbol: samples per baud
@type samples_per_symbol: integer
+ @param timing_bw: timing recovery loop lock-in bandwidth
+ @type timing_bw: float
@param verbose: Print information about modulator?
@type verbose: bool
@param log: Print modualtion data to files?
@type log: bool
-
- Clock recovery parameters. These all have reasonble defaults.
-
- @param gain_mu: controls rate of mu adjustment
- @type gain_mu: float
- @param mu: fractional delay [0.0, 1.0]
- @type mu: float
- @param omega_relative_limit: sets max variation in omega
- @type omega_relative_limit: float, typically 0.000200 (200 ppm)
- @param freq_error: bit rate error as a fraction
- @param float
"""
gr.hier_block2.__init__(self, "gmsk_demod",
@@ -199,33 +191,33 @@ class gmsk_demod(gr.hier_block2):
gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
self._samples_per_symbol = samples_per_symbol
- self._gain_mu = gain_mu
- self._mu = mu
- self._omega_relative_limit = omega_relative_limit
- self._freq_error = freq_error
+ self._bt = bt
+ self._timing_bw = timing_bw
+ self._timing_max_dev= _def_timing_max_dev
+
+ self._differential = False # make consistant with other modulators
if samples_per_symbol < 2:
raise TypeError, "samples_per_symbol >= 2, is %f" % samples_per_symbol
- self._omega = samples_per_symbol*(1+self._freq_error)
-
- if not self._gain_mu:
- self._gain_mu = 0.175
-
- self._gain_omega = .25 * self._gain_mu * self._gain_mu # critically damped
-
# Demodulate FM
sensitivity = (pi / 2) / samples_per_symbol
self.fmdemod = gr.quadrature_demod_cf(1.0 / sensitivity)
# the clock recovery block tracks the symbol clock and resamples as needed.
# the output of the block is a stream of soft symbols (float)
- self.clock_recovery = gr.clock_recovery_mm_ff(self._omega, self._gain_omega,
- self._mu, self._gain_mu,
- self._omega_relative_limit)
-
+ nfilts = 32
+ ntaps = 11 * int(self._samples_per_symbol*nfilts)
+ taps = gr.firdes.gaussian(nfilts,
+ nfilts*self._samples_per_symbol,
+ self._bt, ntaps)
+ self.clock_recovery = \
+ gr.pfb_clock_sync_fff(self._samples_per_symbol,
+ self._timing_bw, taps,
+ nfilts, nfilts//2, self._timing_max_dev)
+
# slice the floats at 0, outputting 1 bit (the LSB of the output byte) per sample
- self.slicer = gr.binary_slicer_fb()
+ self.slicer = digital_swig.binary_slicer_fb()
if verbose:
self._print_verbage()
@@ -245,48 +237,40 @@ class gmsk_demod(gr.hier_block2):
def _print_verbage(self):
- print "bits per symbol = %d" % self.bits_per_symbol()
- print "M&M clock recovery omega = %f" % self._omega
- print "M&M clock recovery gain mu = %f" % self._gain_mu
- print "M&M clock recovery mu = %f" % self._mu
- print "M&M clock recovery omega rel. limit = %f" % self._omega_relative_limit
- print "frequency error = %f" % self._freq_error
+ print "bits per symbol: %d" % self.bits_per_symbol()
+ print "Bandwidth-Time Prod: %f" % self._bt
+ print "Timing bandwidth: %.2e" % self._timing_bw
def _setup_logging(self):
print "Demodulation logging turned on."
self.connect(self.fmdemod,
- gr.file_sink(gr.sizeof_float, "fmdemod.dat"))
+ gr.file_sink(gr.sizeof_float, "rx_gmsk_fmdemod.32f"))
self.connect(self.clock_recovery,
- gr.file_sink(gr.sizeof_float, "clock_recovery.dat"))
+ gr.file_sink(gr.sizeof_float, "rx_gmsk_clock_recovery.32f"))
self.connect(self.slicer,
- gr.file_sink(gr.sizeof_char, "slicer.dat"))
+ gr.file_sink(gr.sizeof_char, "rx_gmsk_slicer.8b"))
def add_options(parser):
"""
Adds GMSK demodulation-specific options to the standard parser
"""
- parser.add_option("", "--gain-mu", type="float", default=_def_gain_mu,
- help="M&M clock recovery gain mu [default=%default] (GMSK/PSK)")
- parser.add_option("", "--mu", type="float", default=_def_mu,
- help="M&M clock recovery mu [default=%default] (GMSK/PSK)")
- parser.add_option("", "--omega-relative-limit", type="float", default=_def_omega_relative_limit,
- help="M&M clock recovery omega relative limit [default=%default] (GMSK/PSK)")
- parser.add_option("", "--freq-error", type="float", default=_def_freq_error,
- help="M&M clock recovery frequency error [default=%default] (GMSK)")
+ parser.add_option("", "--timing-bw", type="float", default=_def_timing_bw,
+ help="set timing symbol sync loop gain lock-in bandwidth [default=%default]")
+ parser.add_option("", "--bt", type="float", default=_def_bt,
+ help="set bandwidth-time product [default=%default] (GMSK)")
add_options=staticmethod(add_options)
def extract_kwargs_from_options(options):
"""
Given command line options, create dictionary suitable for passing to __init__
"""
- return modulation_utils.extract_kwargs_from_options(gmsk_demod.__init__,
- ('self',), options)
+ return modulation_utils2.extract_kwargs_from_options(gmsk_demod.__init__,
+ ('self',), options)
extract_kwargs_from_options=staticmethod(extract_kwargs_from_options)
-
#
# Add these to the mod/demod registry
#
-modulation_utils.add_type_1_mod('gmsk', gmsk_mod)
-modulation_utils.add_type_1_demod('gmsk', gmsk_demod)
+modulation_utils2.add_type_1_mod('gmsk', gmsk_mod)
+modulation_utils2.add_type_1_demod('gmsk', gmsk_demod)
diff --git a/gnuradio-core/src/python/gnuradio/modulation_utils.py b/gr-digital/python/modulation_utils2.py
index 71ba77389..cb3a9812d 100644
--- a/gnuradio-core/src/python/gnuradio/modulation_utils.py
+++ b/gr-digital/python/modulation_utils2.py
@@ -1,5 +1,5 @@
#
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -47,6 +47,15 @@ def type_1_demods():
def add_type_1_demod(name, demod_class):
_type_1_demodulators[name] = demod_class
+# Also record the constellation making functions of the modulations
+_type_1_constellations = {}
+
+def type_1_constellations():
+ return _type_1_constellations
+
+def add_type_1_constellation(name, constellation):
+ _type_1_constellations[name] = constellation
+
def extract_kwargs_from_options(function, excluded_args, options):
"""
@@ -71,6 +80,7 @@ def extract_kwargs_from_options(function, excluded_args, options):
@param options: result of command argument parsing
@type options: optparse.Values
"""
+
# Try this in C++ ;)
args, varargs, varkw, defaults = inspect.getargspec(function)
d = {}
@@ -79,3 +89,14 @@ def extract_kwargs_from_options(function, excluded_args, options):
if getattr(options, kw) is not None:
d[kw] = getattr(options, kw)
return d
+
+def extract_kwargs_from_options_for_class(cls, options):
+ """
+ Given command line options, create dictionary suitable for passing to __init__
+ """
+ d = extract_kwargs_from_options(
+ cls.__init__, ('self',), options)
+ for base in cls.__bases__:
+ if hasattr(base, 'extract_kwargs_from_options'):
+ d.update(base.extract_kwargs_from_options(options))
+ return d
diff --git a/gr-digital/python/ofdm.py b/gr-digital/python/ofdm.py
new file mode 100644
index 000000000..e05f074f4
--- /dev/null
+++ b/gr-digital/python/ofdm.py
@@ -0,0 +1,295 @@
+#!/usr/bin/env python
+#
+# Copyright 2006,2007,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.
+#
+
+import math
+from gnuradio import gr, ofdm_packet_utils, modulation_utils2
+import gnuradio.gr.gr_threading as _threading
+import psk, qam
+
+from gnuradio.blks2impl.ofdm_receiver import ofdm_receiver
+
+def _add_common_options(normal, expert):
+ """
+ Adds OFDM-specific options to the Options Parser that are common
+ both to the modulator and demodulator.
+ """
+ mods_list = ", ".join(modulation_utils2.type_1_constellations().keys())
+ print dir(modulation_utils2)
+ print "MODS LIST: ", mods_list
+ print modulation_utils2.type_1_mods()
+ normal.add_option("-m", "--modulation", type="string", default="psk",
+ help="set modulation type (" + mods_list + ") [default=%default]")
+ normal.add_option("-c", "--constellation-points", type="int", default=2,
+ help="set number of constellation points [default=%default]")
+ expert.add_option("", "--fft-length", type="intx", default=512,
+ help="set the number of FFT bins [default=%default]")
+ expert.add_option("", "--occupied-tones", type="intx", default=200,
+ help="set the number of occupied FFT bins [default=%default]")
+ expert.add_option("", "--cp-length", type="intx", default=128,
+ help="set the number of bits in the cyclic prefix [default=%default]")
+
+# /////////////////////////////////////////////////////////////////////////////
+# mod/demod with packets as i/o
+# /////////////////////////////////////////////////////////////////////////////
+
+class ofdm_mod(gr.hier_block2):
+ """
+ Modulates an OFDM stream. Based on the options fft_length, occupied_tones, and
+ cp_length, this block creates OFDM symbols using a specified modulation option.
+
+ Send packets by calling send_pkt
+ """
+ def __init__(self, options, msgq_limit=2, pad_for_usrp=True):
+ """
+ Hierarchical block for sending packets
+
+ Packets to be sent are enqueued by calling send_pkt.
+ The output is the complex modulated signal at baseband.
+
+ @param options: pass modulation options from higher layers (fft length, occupied tones, etc.)
+ @param msgq_limit: maximum number of messages in message queue
+ @type msgq_limit: int
+ @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples
+ """
+
+ gr.hier_block2.__init__(self, "ofdm_mod",
+ gr.io_signature(0, 0, 0), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+
+ self._pad_for_usrp = pad_for_usrp
+ self._modulation = options.modulation
+ self._fft_length = options.fft_length
+ self._occupied_tones = options.occupied_tones
+ self._cp_length = options.cp_length
+
+ print (options)
+ arity = options.constellation_points
+
+ win = [] #[1 for i in range(self._fft_length)]
+
+ # Use freq domain to get doubled-up known symbol for correlation in time domain
+ zeros_on_left = int(math.ceil((self._fft_length - self._occupied_tones)/2.0))
+ ksfreq = known_symbols_4512_3[0:self._occupied_tones]
+ for i in range(len(ksfreq)):
+ if((zeros_on_left + i) & 1):
+ ksfreq[i] = 0
+
+ # hard-coded known symbols
+ preambles = (ksfreq,)
+
+ padded_preambles = list()
+ for pre in preambles:
+ padded = self._fft_length*[0,]
+ padded[zeros_on_left : zeros_on_left + self._occupied_tones] = pre
+ padded_preambles.append(padded)
+
+ symbol_length = options.fft_length + options.cp_length
+
+ print modulation_utils2.type_1_constellations
+ const = modulation_utils2.type_1_constellations()[self._modulation](arity).points()
+
+ self._pkt_input = gr.ofdm_mapper_bcv(const, msgq_limit,
+ options.occupied_tones, options.fft_length)
+
+ self.preambles = gr.ofdm_insert_preamble(self._fft_length, padded_preambles)
+ self.ifft = gr.fft_vcc(self._fft_length, False, win, True)
+ self.cp_adder = gr.ofdm_cyclic_prefixer(self._fft_length, symbol_length)
+ self.scale = gr.multiply_const_cc(1.0 / math.sqrt(self._fft_length))
+
+ self.connect((self._pkt_input, 0), (self.preambles, 0))
+ self.connect((self._pkt_input, 1), (self.preambles, 1))
+ self.connect(self.preambles, self.ifft, self.cp_adder, self.scale, self)
+
+ if options.verbose:
+ self._print_verbage()
+
+ if options.log:
+ self.connect(self._pkt_input, gr.file_sink(gr.sizeof_gr_complex*options.fft_length,
+ "ofdm_mapper_c.dat"))
+ self.connect(self.preambles, gr.file_sink(gr.sizeof_gr_complex*options.fft_length,
+ "ofdm_preambles.dat"))
+ self.connect(self.ifft, gr.file_sink(gr.sizeof_gr_complex*options.fft_length,
+ "ofdm_ifft_c.dat"))
+ self.connect(self.cp_adder, gr.file_sink(gr.sizeof_gr_complex,
+ "ofdm_cp_adder_c.dat"))
+
+ def send_pkt(self, payload='', eof=False):
+ """
+ Send the payload.
+
+ @param payload: data to send
+ @type payload: string
+ """
+ if eof:
+ msg = gr.message(1) # tell self._pkt_input we're not sending any more packets
+ else:
+ # print "original_payload =", string_to_hex_list(payload)
+ pkt = ofdm_packet_utils.make_packet(payload, 1, 1, self._pad_for_usrp, whitening=True)
+
+ #print "pkt =", string_to_hex_list(pkt)
+ msg = gr.message_from_string(pkt)
+ self._pkt_input.msgq().insert_tail(msg)
+
+ def add_options(normal, expert):
+ """
+ Adds OFDM-specific options to the Options Parser
+ """
+ _add_common_options(normal, expert)
+ for mod in modulation_utils2.type_1_mods().values():
+ mod.add_options(expert)
+
+ # Make a static method to call before instantiation
+ add_options = staticmethod(add_options)
+
+ def _print_verbage(self):
+ """
+ Prints information about the OFDM modulator
+ """
+ print "\nOFDM Modulator:"
+ print "Modulation Type: %s" % (self._modulation)
+ print "FFT length: %3d" % (self._fft_length)
+ print "Occupied Tones: %3d" % (self._occupied_tones)
+ print "CP length: %3d" % (self._cp_length)
+
+
+class ofdm_demod(gr.hier_block2):
+ """
+ Demodulates a received OFDM stream. Based on the options fft_length, occupied_tones, and
+ cp_length, this block performs synchronization, FFT, and demodulation of incoming OFDM
+ symbols and passes packets up the a higher layer.
+
+ The input is complex baseband. When packets are demodulated, they are passed to the
+ app via the callback.
+ """
+
+ def __init__(self, options, callback=None):
+ """
+ Hierarchical block for demodulating and deframing packets.
+
+ The input is the complex modulated signal at baseband.
+ Demodulated packets are sent to the handler.
+
+ @param options: pass modulation options from higher layers (fft length, occupied tones, etc.)
+ @param callback: function of two args: ok, payload
+ @type callback: ok: bool; payload: string
+ """
+ gr.hier_block2.__init__(self, "ofdm_demod",
+ gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
+
+
+ self._rcvd_pktq = gr.msg_queue() # holds packets from the PHY
+
+ self._modulation = options.modulation
+ self._fft_length = options.fft_length
+ self._occupied_tones = options.occupied_tones
+ self._cp_length = options.cp_length
+ self._snr = options.snr
+
+ arity = options.constellation_points
+ print("con points is %s" % options.constellation_points)
+
+ # Use freq domain to get doubled-up known symbol for correlation in time domain
+ zeros_on_left = int(math.ceil((self._fft_length - self._occupied_tones)/2.0))
+ ksfreq = known_symbols_4512_3[0:self._occupied_tones]
+ for i in range(len(ksfreq)):
+ if((zeros_on_left + i) & 1):
+ ksfreq[i] = 0
+
+ # hard-coded known symbols
+ preambles = (ksfreq,)
+
+ symbol_length = self._fft_length + self._cp_length
+ self.ofdm_recv = ofdm_receiver(self._fft_length, self._cp_length,
+ self._occupied_tones, self._snr, preambles,
+ options.log)
+
+ constell = modulation_utils2.type_1_constellations()[self._modulation](arity)
+
+ phgain = 0.25
+ frgain = phgain*phgain / 4.0
+ self.ofdm_demod = gr.ofdm_frame_sink2(constell.base(),
+ self._rcvd_pktq,
+ self._occupied_tones,
+ phgain, frgain)
+
+ self.connect(self, self.ofdm_recv)
+ self.connect((self.ofdm_recv, 0), (self.ofdm_demod, 0))
+ self.connect((self.ofdm_recv, 1), (self.ofdm_demod, 1))
+
+ # added output signature to work around bug, though it might not be a bad
+ # thing to export, anyway
+ self.connect(self.ofdm_recv.chan_filt, self)
+
+ if options.log:
+ self.connect(self.ofdm_demod, gr.file_sink(gr.sizeof_gr_complex*self._occupied_tones, "ofdm_frame_sink_c.dat"))
+ else:
+ self.connect(self.ofdm_demod, gr.null_sink(gr.sizeof_gr_complex*self._occupied_tones))
+
+ if options.verbose:
+ self._print_verbage()
+
+ self._watcher = _queue_watcher_thread(self._rcvd_pktq, callback)
+
+ def add_options(normal, expert):
+ """
+ Adds OFDM-specific options to the Options Parser
+ """
+ _add_common_options(normal, expert)
+ for mod in modulation_utils2.type_1_mods().values():
+ mod.add_options(expert)
+ # Make a static method to call before instantiation
+ add_options = staticmethod(add_options)
+
+ def _print_verbage(self):
+ """
+ Prints information about the OFDM demodulator
+ """
+ print "\nOFDM Demodulator:"
+ print "Modulation Type: %s" % (self._modulation)
+ print "FFT length: %3d" % (self._fft_length)
+ print "Occupied Tones: %3d" % (self._occupied_tones)
+ print "CP length: %3d" % (self._cp_length)
+
+
+
+class _queue_watcher_thread(_threading.Thread):
+ def __init__(self, rcvd_pktq, callback):
+ _threading.Thread.__init__(self)
+ self.setDaemon(1)
+ self.rcvd_pktq = rcvd_pktq
+ self.callback = callback
+ self.keep_running = True
+ self.start()
+
+
+ def run(self):
+ while self.keep_running:
+ msg = self.rcvd_pktq.delete_head()
+ ok, payload = ofdm_packet_utils.unmake_packet(msg.to_string())
+ if self.callback:
+ self.callback(ok, payload)
+
+# Generating known symbols with:
+# i = [2*random.randint(0,1)-1 for i in range(4512)]
+
+known_symbols_4512_3 = [-1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 1, -1]
diff --git a/gnuradio-core/src/python/gnuradio/packet_utils.py b/gr-digital/python/packet_utils.py
index e36b05413..2e216ff50 100644
--- a/gnuradio-core/src/python/gnuradio/packet_utils.py
+++ b/gr-digital/python/packet_utils.py
@@ -22,7 +22,7 @@
import struct
import numpy
from gnuradio import gru
-
+import crc
def conv_packed_binary_string_to_1_0_string(s):
"""
@@ -127,7 +127,7 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol,
(packed_access_code, padded) = conv_1_0_string_to_packed_binary_string(access_code)
(packed_preamble, ignore) = conv_1_0_string_to_packed_binary_string(preamble)
- payload_with_crc = gru.gen_and_append_crc32(payload)
+ payload_with_crc = crc.gen_and_append_crc32(payload)
#print "outbound crc =", string_to_hex_list(payload_with_crc[-4:])
L = len(payload_with_crc)
@@ -184,7 +184,7 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=True
else:
payload_with_crc = (whitened_payload_with_crc)
- ok, payload = gru.check_crc32(payload_with_crc)
+ ok, payload = crc.check_crc32(payload_with_crc)
if 0:
print "payload_with_crc =", string_to_hex_list(payload_with_crc)
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py b/gr-digital/python/pkt.py
index 908437ef2..8650bdbb0 100644
--- a/gnuradio-core/src/python/gnuradio/blks2impl/pkt.py
+++ b/gr-digital/python/pkt.py
@@ -20,8 +20,10 @@
#
from math import pi
-from gnuradio import gr, packet_utils
+from gnuradio import gr
import gnuradio.gr.gr_threading as _threading
+import packet_utils
+import digital_swig
# /////////////////////////////////////////////////////////////////////////////
@@ -34,7 +36,8 @@ class mod_pkts(gr.hier_block2):
Send packets by calling send_pkt
"""
- def __init__(self, modulator, access_code=None, msgq_limit=2, pad_for_usrp=True, use_whitener_offset=False):
+ def __init__(self, modulator, access_code=None, msgq_limit=2, pad_for_usrp=True,
+ use_whitener_offset=False, modulate=True):
"""
Hierarchical block for sending packets
@@ -138,7 +141,7 @@ class demod_pkts(gr.hier_block2):
threshold = 12 # FIXME raise exception
self._rcvd_pktq = gr.msg_queue() # holds packets from the PHY
- self.correlator = gr.correlate_access_code_bb(access_code, threshold)
+ self.correlator = digital_swig.correlate_access_code_bb(access_code, threshold)
self.framer_sink = gr.framer_sink_1(self._rcvd_pktq)
self.connect(self, self._demodulator, self.correlator, self.framer_sink)
diff --git a/gr-digital/python/psk.py b/gr-digital/python/psk.py
new file mode 100644
index 000000000..acedf3b69
--- /dev/null
+++ b/gr-digital/python/psk.py
@@ -0,0 +1,94 @@
+#
+# Copyright 2005,2006 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 math import pi, sqrt, log10
+import math, cmath
+
+# The following algorithm generates Gray coded constellations for M-PSK for M=[2,4,8]
+def make_gray_constellation(m):
+ # number of bits/symbol (log2(M))
+ k = int(log10(m) / log10(2.0))
+
+ coeff = 1
+ const_map = []
+ bits = [0]*3
+ for i in range(m):
+ # get a vector of the k bits to use in this mapping
+ bits[3-k:3] = [((i&(0x01 << k-j-1)) >> k-j-1) for j in range(k)]
+
+ theta = -(2*bits[0]-1)*(2*pi/m)*(bits[0]+abs(bits[1]-bits[2])+2*bits[1])
+ re = math.cos(theta)
+ im = math.sin(theta)
+ const_map.append(complex(re, im)) # plug it into the constellation
+
+ # return the constellation; by default, it is normalized
+ return const_map
+
+# This makes a constellation that increments around the unit circle
+def make_constellation(m):
+ return [cmath.exp(i * 2 * pi / m * 1j) for i in range(m)]
+
+# Common definition of constellations for Tx and Rx
+constellation = {
+ 2 : make_constellation(2), # BPSK
+ 4 : make_constellation(4), # QPSK
+ 8 : make_constellation(8) # 8PSK
+ }
+
+gray_constellation = {
+ 2 : make_gray_constellation(2), # BPSK
+ 4 : make_gray_constellation(4), # QPSK
+ 8 : make_gray_constellation(8) # 8PSK
+ }
+
+# -----------------------
+# Do Gray code
+# -----------------------
+# binary to gray coding -- constellation does Gray coding
+binary_to_gray = {
+ 2 : range(2),
+ 4 : [0,1,3,2],
+ 8 : [0, 1, 3, 2, 7, 6, 4, 5]
+ }
+
+# gray to binary
+gray_to_binary = {
+ 2 : range(2),
+ 4 : [0,1,3,2],
+ 8 : [0, 1, 3, 2, 6, 7, 5, 4]
+ }
+
+# -----------------------
+# Don't Gray code
+# -----------------------
+# identity mapping
+binary_to_ungray = {
+ 2 : range(2),
+ 4 : range(4),
+ 8 : range(8)
+ }
+
+# identity mapping
+ungray_to_binary = {
+ 2 : range(2),
+ 4 : range(4),
+ 8 : range(8)
+ }
diff --git a/gr-digital/python/psk2.py b/gr-digital/python/psk2.py
new file mode 100644
index 000000000..82781e63b
--- /dev/null
+++ b/gr-digital/python/psk2.py
@@ -0,0 +1,122 @@
+#
+# 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 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.
+#
+
+"""
+PSK modulation and demodulation.
+"""
+
+from math import pi, log
+from cmath import exp
+
+import digital_swig
+import modulation_utils2
+from utils import mod_codes, gray_code
+from generic_mod_demod import generic_mod, generic_demod
+
+# Default number of points in constellation.
+_def_constellation_points = 4
+# The default encoding (e.g. gray-code, set-partition)
+_def_mod_code = mod_codes.GRAY_CODE
+
+def create_encodings(mod_code, arity):
+ post_diff_code = None
+ if mod_code not in mod_codes.codes:
+ raise ValueError('That modulation code does not exist.')
+ if mod_code == mod_codes.GRAY_CODE:
+ pre_diff_code = gray_code.gray_code(arity)
+ elif mod_code == mod_codes.SET_PARTITION_CODE:
+ pre_diff_code = set_partition_code.set_partition_code(arity)
+ elif mod_code == mod_codes.NO_CODE:
+ pre_diff_code = []
+ else:
+ raise ValueError('That modulation code is not implemented for this constellation.')
+ return (pre_diff_code, post_diff_code)
+
+# /////////////////////////////////////////////////////////////////////////////
+# PSK constellation
+# /////////////////////////////////////////////////////////////////////////////
+
+def psk_constellation(m=_def_constellation_points, mod_code=_def_mod_code):
+ """
+ Creates a PSK constellation object.
+ """
+ k = log(m) / log(2.0)
+ if (k != int(k)):
+ raise StandardError('Number of constellation points must be a power of two.')
+ points = [exp(2*pi*(0+1j)*i/m) for i in range(0,m)]
+ pre_diff_code, post_diff_code = create_encodings(mod_code, m)
+ if post_diff_code is not None:
+ inverse_post_diff_code = mod_codes.invert_code(post_diff_code)
+ points = [points[x] for x in inverse_post_diff_code]
+ constellation = digital_swig.constellation_psk(points, pre_diff_code, m)
+ return constellation
+
+# /////////////////////////////////////////////////////////////////////////////
+# PSK modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class psk_mod(generic_mod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ mod_code=_def_mod_code,
+ *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered PSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_mod block for list of parameters.
+ """
+
+ constellation = psk_constellation(constellation_points, mod_code)
+ super(psk_mod, self).__init__(constellation, *args, **kwargs)
+
+# /////////////////////////////////////////////////////////////////////////////
+# PSK demodulator
+#
+# /////////////////////////////////////////////////////////////////////////////
+
+class psk_demod(generic_demod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ mod_code=_def_mod_code,
+ *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered PSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_demod block for list of parameters.
+ """
+
+ constellation = psk_constellation(constellation_points, mod_code)
+ super(psk_demod, self).__init__(constellation, *args, **kwargs)
+
+#
+# Add these to the mod/demod registry
+#
+modulation_utils2.add_type_1_mod('psk', psk_mod)
+modulation_utils2.add_type_1_demod('psk', psk_demod)
+modulation_utils2.add_type_1_constellation('psk', psk_constellation)
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_constellation_decoder_cb.py b/gr-digital/python/qa_binary_slicer_fb.py
index 27e1802e0..944dc1b5a 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_constellation_decoder_cb.py
+++ b/gr-digital/python/qa_binary_slicer_fb.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2004,2007,2010 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,8 @@
#
from gnuradio import gr, gr_unittest
-import math
+import digital_swig
+import math, random
class test_constellation_decoder (gr_unittest.TestCase):
@@ -31,17 +32,18 @@ class test_constellation_decoder (gr_unittest.TestCase):
def tearDown (self):
self.tb = None
- def test_constellation_decoder_cb (self):
- symbol_positions = [1 + 0j, 0 + 1j , -1 + 0j, 0 - 1j]
- symbol_values_out = [0, 1, 2, 3]
- expected_result = ( 0, 3, 2, 1, 0, 0, 3)
- src_data = (0.5 + 0j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j, 0.8 - 0j, 0.5 + 0j, 0.1 - 1.2j)
- src = gr.vector_source_c (src_data)
- op = gr.constellation_decoder_cb (symbol_positions, symbol_values_out)
+ def test_binary_slicer_fb (self):
+ expected_result = ( 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1)
+ src_data = (-1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1)
+ src_data = [s + (1 - random.random()) for s in src_data] # add some noise
+ src = gr.vector_source_f (src_data)
+ op = digital_swig.binary_slicer_fb ()
dst = gr.vector_sink_b ()
+
self.tb.connect (src, op)
self.tb.connect (op, dst)
self.tb.run () # run the graph and wait for it to finish
+
actual_result = dst.data () # fetch the contents of the sink
#print "actual result", actual_result
#print "expected result", expected_result
diff --git a/gr-digital/python/qa_clock_recovery_mm.py b/gr-digital/python/qa_clock_recovery_mm.py
new file mode 100755
index 000000000..5ef86eda0
--- /dev/null
+++ b/gr-digital/python/qa_clock_recovery_mm.py
@@ -0,0 +1,176 @@
+#!/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, gr_unittest
+import digital_swig, psk2
+import random, cmath
+
+class test_clock_recovery_mm(gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test01 (self):
+ # Test complex/complex version
+ omega = 2
+ gain_omega = 0.001
+ mu = 0.5
+ gain_mu = 0.01
+ omega_rel_lim = 0.001
+
+ self.test = digital_swig.clock_recovery_mm_cc(omega, gain_omega,
+ mu, gain_mu,
+ omega_rel_lim)
+
+ data = 100*[complex(1, 1),]
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = 100*[complex(0.99972, 0.99972)] # doesn't quite get to 1.0
+ dst_data = self.snk.data()
+
+ # Only compare last Ncmp samples
+ Ncmp = 30
+ len_e = len(expected_result)
+ len_d = len(dst_data)
+ expected_result = expected_result[len_e - Ncmp:]
+ dst_data = dst_data[len_d - Ncmp:]
+
+ #print expected_result
+ #print dst_data
+
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
+
+
+ def test02 (self):
+ # Test float/float version
+ omega = 2
+ gain_omega = 0.01
+ mu = 0.5
+ gain_mu = 0.01
+ omega_rel_lim = 0.001
+
+ self.test = digital_swig.clock_recovery_mm_ff(omega, gain_omega,
+ mu, gain_mu,
+ omega_rel_lim)
+
+ data = 100*[1,]
+ self.src = gr.vector_source_f(data, False)
+ self.snk = gr.vector_sink_f()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = 100*[0.99972, ] # doesn't quite get to 1.0
+ dst_data = self.snk.data()
+
+ # Only compare last Ncmp samples
+ Ncmp = 30
+ len_e = len(expected_result)
+ len_d = len(dst_data)
+ expected_result = expected_result[len_e - Ncmp:]
+ dst_data = dst_data[len_d - Ncmp:]
+
+ #print expected_result
+ #print dst_data
+
+ self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 5)
+
+
+ def test03 (self):
+ # Test complex/complex version with varying input
+ omega = 2
+ gain_omega = 0.01
+ mu = 0.25
+ gain_mu = 0.1
+ omega_rel_lim = 0.0001
+
+ self.test = digital_swig.clock_recovery_mm_cc(omega, gain_omega,
+ mu, gain_mu,
+ omega_rel_lim)
+
+ data = 1000*[complex(1, 1), complex(1, 1), complex(-1, -1), complex(-1, -1)]
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = 1000*[complex(-1.2, -1.2), complex(1.2, 1.2)]
+ dst_data = self.snk.data()
+
+ # Only compare last Ncmp samples
+ Ncmp = 100
+ len_e = len(expected_result)
+ len_d = len(dst_data)
+ expected_result = expected_result[len_e - Ncmp:]
+ dst_data = dst_data[len_d - Ncmp:]
+
+ #print expected_result
+ #print dst_data
+
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 1)
+
+
+ def test04 (self):
+ # Test float/float version
+ omega = 2
+ gain_omega = 0.01
+ mu = 0.25
+ gain_mu = 0.1
+ omega_rel_lim = 0.001
+
+ self.test = digital_swig.clock_recovery_mm_ff(omega, gain_omega,
+ mu, gain_mu,
+ omega_rel_lim)
+
+ data = 1000*[1, 1, -1, -1]
+ self.src = gr.vector_source_f(data, False)
+ self.snk = gr.vector_sink_f()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = 1000*[-1.31, 1.31]
+ dst_data = self.snk.data()
+
+ # Only compare last Ncmp samples
+ Ncmp = 100
+ len_e = len(expected_result)
+ len_d = len(dst_data)
+ expected_result = expected_result[len_e - Ncmp:]
+ dst_data = dst_data[len_d - Ncmp:]
+
+ #print expected_result
+ #print dst_data
+
+ self.assertFloatTuplesAlmostEqual (expected_result, dst_data, 1)
+
+
+if __name__ == '__main__':
+ gr_unittest.run(test_clock_recovery_mm, "test_clock_recovery_mm.xml")
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_cma_equalizer.py b/gr-digital/python/qa_cma_equalizer.py
index 79e9cd092..75fb0f05e 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_cma_equalizer.py
+++ b/gr-digital/python/qa_cma_equalizer.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006,2007,2010 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,6 +21,7 @@
#
from gnuradio import gr, gr_unittest
+import digital_swig
class test_cma_equalizer_fir(gr_unittest.TestCase):
@@ -32,7 +33,7 @@ class test_cma_equalizer_fir(gr_unittest.TestCase):
def transform(self, src_data):
SRC = gr.vector_source_c(src_data, False)
- EQU = gr.cma_equalizer_cc(4, 1.0, .001)
+ EQU = digital_swig.cma_equalizer_cc(4, 1.0, .001, 1)
DST = gr.vector_sink_c()
self.tb.connect(SRC, EQU, DST)
self.tb.run()
diff --git a/gr-digital/python/qa_constellation.py b/gr-digital/python/qa_constellation.py
new file mode 100755
index 000000000..264ff7de6
--- /dev/null
+++ b/gr-digital/python/qa_constellation.py
@@ -0,0 +1,204 @@
+#!/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.
+#
+
+import random
+from cmath import exp, pi, log
+
+from gnuradio import gr, gr_unittest, blks2
+from utils import mod_codes
+import digital_swig
+
+# import from local folder
+import psk2
+import qam
+
+tested_mod_codes = (mod_codes.NO_CODE, mod_codes.GRAY_CODE)
+
+# A list of the constellations to test.
+# Each constellation is given by a 3-tuple.
+# First item is a function to generate the constellation
+# Second item is a dictionary of arguments for function with lists of
+# possible values.
+# Third item is whether differential encoding should be tested.
+# Fourth item is the name of the argument to constructor that specifices
+# whether differential encoding is used.
+
+def twod_constell():
+ """
+
+ """
+ points = ((1+0j), (0+1j),
+ (-1+0j), (0-1j))
+ rot_sym = 2
+ dim = 2
+ return digital_swig.constellation_calcdist(points, [], rot_sym, dim)
+
+def threed_constell():
+ oned_points = ((1+0j), (0+1j), (-1+0j), (0-1j))
+ points = []
+ r4 = range(0, 4)
+ for ia in r4:
+ for ib in r4:
+ for ic in r4:
+ points += [oned_points[ia], oned_points[ib], oned_points[ic]]
+ rot_sym = 4
+ dim = 3
+ return digital_swig.constellation_calcdist(points, [], rot_sym, dim)
+
+tested_constellation_info = (
+ (psk2.psk_constellation,
+ {'m': (2, 4, 8, 16, 32, 64),
+ 'mod_code': tested_mod_codes, },
+ True, None),
+ (digital_swig.constellation_bpsk, {}, True, None),
+ (digital_swig.constellation_qpsk, {}, False, None),
+ (digital_swig.constellation_dqpsk, {}, True, None),
+ (digital_swig.constellation_8psk, {}, False, None),
+ (twod_constell, {}, True, None),
+ (threed_constell, {}, True, None),
+ )
+
+def tested_constellations():
+ """
+ Generator to produce (constellation, differential) tuples for testing purposes.
+ """
+ for constructor, poss_args, differential, diff_argname in tested_constellation_info:
+ if differential:
+ diff_poss = (True, False)
+ else:
+ diff_poss = (False,)
+ poss_args = [[argname, argvalues, 0] for argname, argvalues in poss_args.items()]
+ for current_diff in diff_poss:
+ # Add an index into args to keep track of current position in argvalues
+ while True:
+ current_args = dict([(argname, argvalues[argindex])
+ for argname, argvalues, argindex in poss_args])
+ if diff_argname is not None:
+ current_args[diff_argname] = current_diff
+ constellation = constructor(**current_args)
+ yield (constellation, current_diff)
+ for this_poss_arg in poss_args:
+ argname, argvalues, argindex = this_poss_arg
+ if argindex < len(argvalues) - 1:
+ this_poss_arg[2] += 1
+ break
+ else:
+ this_poss_arg[2] = 0
+ if sum([argindex for argname, argvalues, argindex in poss_args]) == 0:
+ break
+
+
+class test_constellation (gr_unittest.TestCase):
+
+ src_length = 256
+
+ def setUp(self):
+ # Generate a list of random bits.
+ self.src_data = tuple([random.randint(0,1) for i in range(0, self.src_length)])
+
+ def tearDown(self):
+ pass
+
+ def test_hard_decision(self):
+ for constellation, differential in tested_constellations():
+ if differential:
+ rs = constellation.rotational_symmetry()
+ rotations = [exp(i*2*pi*(0+1j)/rs) for i in range(0, rs)]
+ else:
+ rotations = [None]
+ for rotation in rotations:
+ src = gr.vector_source_b(self.src_data)
+ content = mod_demod(constellation, differential, rotation)
+ dst = gr.vector_sink_b()
+ self.tb = gr.top_block()
+ self.tb.connect(src, content, dst)
+ self.tb.run()
+ data = dst.data()
+ # Don't worry about cut off data for now.
+ first = constellation.bits_per_symbol()
+ self.assertEqual (self.src_data[first:len(data)], data[first:])
+
+
+class mod_demod(gr.hier_block2):
+ def __init__(self, constellation, differential, rotation):
+ if constellation.arity() > 256:
+ # If this becomes limiting some of the blocks should be generalised so
+ # that they can work with shorts and ints as well as chars.
+ raise ValueError("Constellation cannot contain more than 256 points.")
+
+ gr.hier_block2.__init__(self, "mod_demod",
+ gr.io_signature(1, 1, gr.sizeof_char), # Input signature
+ gr.io_signature(1, 1, gr.sizeof_char)) # Output signature
+
+ arity = constellation.arity()
+
+ # TX
+ self.constellation = constellation
+ self.differential = differential
+ self.blocks = [self]
+ # We expect a stream of unpacked bits.
+ # First step is to pack them.
+ self.blocks.append(
+ gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST))
+ # Second step we unpack them such that we have k bits in each byte where
+ # each constellation symbol hold k bits.
+ self.blocks.append(
+ gr.packed_to_unpacked_bb(self.constellation.bits_per_symbol(),
+ gr.GR_MSB_FIRST))
+ # Apply any pre-differential coding
+ # Gray-coding is done here if we're also using differential coding.
+ if self.constellation.apply_pre_diff_code():
+ self.blocks.append(gr.map_bb(self.constellation.pre_diff_code()))
+ # Differential encoding.
+ if self.differential:
+ self.blocks.append(gr.diff_encoder_bb(arity))
+ # Convert to constellation symbols.
+ self.blocks.append(gr.chunks_to_symbols_bc(self.constellation.points(),
+ self.constellation.dimensionality()))
+ # CHANNEL
+ # Channel just consists of a rotation to check differential coding.
+ if rotation is not None:
+ self.blocks.append(gr.multiply_const_cc(rotation))
+
+ # RX
+ # Convert the constellation symbols back to binary values.
+ self.blocks.append(digital_swig.constellation_decoder_cb(self.constellation.base()))
+ # Differential decoding.
+ if self.differential:
+ self.blocks.append(gr.diff_decoder_bb(arity))
+ # Decode any pre-differential coding.
+ if self.constellation.apply_pre_diff_code():
+ self.blocks.append(gr.map_bb(
+ mod_codes.invert_code(self.constellation.pre_diff_code())))
+ # unpack the k bit vector into a stream of bits
+ self.blocks.append(gr.unpack_k_bits_bb(
+ self.constellation.bits_per_symbol()))
+ # connect to block output
+ check_index = len(self.blocks)
+ self.blocks = self.blocks[:check_index]
+ self.blocks.append(self)
+
+ self.connect(*self.blocks)
+
+
+if __name__ == '__main__':
+ gr_unittest.run(test_constellation, "test_constellation.xml")
diff --git a/gr-digital/python/qa_constellation_decoder_cb.py b/gr-digital/python/qa_constellation_decoder_cb.py
new file mode 100755
index 000000000..5401a07fc
--- /dev/null
+++ b/gr-digital/python/qa_constellation_decoder_cb.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+#
+# Copyright 2004,2007,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,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+import digital_swig
+import math
+
+class test_constellation_decoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test_constellation_decoder_cb_bpsk (self):
+ cnst = digital_swig.constellation_bpsk()
+ src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j,
+ 0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j)
+ expected_result = ( 1, 1, 0, 0,
+ 1, 0, 1)
+ src = gr.vector_source_c (src_data)
+ op = digital_swig.constellation_decoder_cb (cnst.base())
+ dst = gr.vector_sink_b ()
+
+ self.tb.connect (src, op)
+ self.tb.connect (op, dst)
+ self.tb.run () # run the graph and wait for it to finish
+
+ actual_result = dst.data () # fetch the contents of the sink
+ #print "actual result", actual_result
+ #print "expected result", expected_result
+ self.assertFloatTuplesAlmostEqual (expected_result, actual_result)
+
+ def test_constellation_decoder_cb_qpsk (self):
+ cnst = digital_swig.constellation_qpsk()
+ src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j,
+ 0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j)
+ expected_result = ( 3, 1, 0, 2,
+ 3, 2, 1)
+ src = gr.vector_source_c (src_data)
+ op = digital_swig.constellation_decoder_cb (cnst.base())
+ dst = gr.vector_sink_b ()
+
+ self.tb.connect (src, op)
+ self.tb.connect (op, dst)
+ self.tb.run () # run the graph and wait for it to finish
+
+ actual_result = dst.data () # fetch the contents of the sink
+ #print "actual result", actual_result
+ #print "expected result", expected_result
+ self.assertFloatTuplesAlmostEqual (expected_result, actual_result)
+
+
+if __name__ == '__main__':
+ gr_unittest.run(test_constellation_decoder, "test_constellation_decoder.xml")
+
diff --git a/gr-digital/python/qa_constellation_receiver.py b/gr-digital/python/qa_constellation_receiver.py
new file mode 100755
index 000000000..25107e4a7
--- /dev/null
+++ b/gr-digital/python/qa_constellation_receiver.py
@@ -0,0 +1,134 @@
+#!/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.
+#
+
+import random
+
+from gnuradio import gr, blks2, gr_unittest
+from utils import mod_codes, alignment
+import digital_swig, packet_utils
+from generic_mod_demod import generic_mod, generic_demod
+
+from qa_constellation import tested_constellations, twod_constell
+
+import math
+
+# Set a seed so that if errors turn up they are reproducible.
+# 1234 fails
+random.seed(1239)
+
+# TESTING PARAMETERS
+# The number of symbols to test with.
+# We need this many to let the frequency recovery block converge.
+DATA_LENGTH = 10000
+# Test fails if fraction of output that is correct is less than this.
+REQ_CORRECT = 0.8
+
+# CHANNEL PARAMETERS
+NOISE_VOLTAGE = 0.01
+FREQUENCY_OFFSET = 0.01
+TIMING_OFFSET = 1.0
+
+# RECEIVER PARAMETERS
+FREQ_BW = 2*math.pi/100.0
+PHASE_BW = 2*math.pi/100.0
+
+
+class test_constellation_receiver (gr_unittest.TestCase):
+
+ # We ignore the first half of the output data since often it takes
+ # a while for the receiver to lock on.
+ ignore_fraction = 0.8
+ seed = 1234
+ max_data_length = DATA_LENGTH * 6
+ max_num_samples = 1000
+
+ def test_basic(self):
+ """
+ Tests a bunch of different constellations by using generic
+ modulation, a channel, and generic demodulation. The generic
+ demodulation uses constellation_receiver which is what
+ we're really trying to test.
+ """
+
+ # Assumes not more than 64 points in a constellation
+ # Generates some random input data to use.
+ self.src_data = tuple(
+ [random.randint(0,1) for i in range(0, self.max_data_length)])
+ # Generates some random indices to use for comparing input and
+ # output data (a full comparison is too slow in python).
+ self.indices = alignment.random_sample(
+ self.max_data_length, self.max_num_samples, self.seed)
+
+ for constellation, differential in tested_constellations():
+ # The constellation_receiver doesn't work for constellations
+ # of multple dimensions (i.e. multiple complex numbers to a
+ # single symbol).
+ # That is not implemented since the receiver has no way of
+ # knowing where the beginning of a symbol is.
+ # It also doesn't work for non-differential modulation.
+ if constellation.dimensionality() != 1 or not differential:
+ continue
+ data_length = DATA_LENGTH * constellation.bits_per_symbol()
+ tb = rec_test_tb(constellation, differential,
+ src_data=self.src_data[:data_length])
+ tb.run()
+ data = tb.dst.data()
+ d1 = tb.src_data[:int(len(tb.src_data)*self.ignore_fraction)]
+ d2 = data[:int(len(data)*self.ignore_fraction)]
+ correct, overlap, offset, indices = alignment.align_sequences(
+ d1, d2, indices=self.indices)
+ self.assertTrue(correct > REQ_CORRECT)
+
+
+class rec_test_tb (gr.top_block):
+ """
+ Takes a constellation an runs a generic modulation, channel,
+ and generic demodulation.
+ """
+ def __init__(self, constellation, differential,
+ data_length=None, src_data=None):
+ """
+ constellation -- a constellation object
+ differential -- whether differential encoding is used
+ data_length -- the number of bits of data to use
+ src_data -- a list of the bits to use
+ """
+ super(rec_test_tb, self).__init__()
+ # Transmission Blocks
+ if src_data is None:
+ self.src_data = tuple([random.randint(0,1) for i in range(0, data_length)])
+ else:
+ self.src_data = src_data
+ packer = gr.unpacked_to_packed_bb(1, gr.GR_MSB_FIRST)
+ src = gr.vector_source_b(self.src_data)
+ mod = generic_mod(constellation, differential=differential)
+ # Channel
+ channel = gr.channel_model(NOISE_VOLTAGE, FREQUENCY_OFFSET, TIMING_OFFSET)
+ # Receiver Blocks
+ demod = generic_demod(constellation, differential=differential,
+ freq_bw=FREQ_BW,
+ phase_bw=PHASE_BW)
+ self.dst = gr.vector_sink_b()
+ self.connect(src, packer, mod, channel, demod, self.dst)
+
+if __name__ == '__main__':
+ gr_unittest.run(test_constellation_receiver, "test_constellation_receiver.xml")
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py b/gr-digital/python/qa_correlate_access_code.py
index b3575f4e6..6b6f25051 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_correlate_access_code.py
+++ b/gr-digital/python/qa_correlate_access_code.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006,2007,2010 Free Software Foundation, Inc.
+# Copyright 2006,2007,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,6 +21,7 @@
#
from gnuradio import gr, gr_unittest
+import digital_swig
import math
default_access_code = '\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC'
@@ -52,7 +53,7 @@ class test_correlate_access_code(gr_unittest.TestCase):
src_data = (1, 0, 1, 1, 1, 1, 0, 1, 1) + pad + (0,) * 7
expected_result = pad + (1, 0, 1, 1, 3, 1, 0, 1, 1, 2) + (0,) * 6
src = gr.vector_source_b (src_data)
- op = gr.correlate_access_code_bb("1011", 0)
+ op = digital_swig.correlate_access_code_bb("1011", 0)
dst = gr.vector_sink_b ()
self.tb.connect (src, op, dst)
self.tb.run ()
@@ -69,7 +70,7 @@ class test_correlate_access_code(gr_unittest.TestCase):
src_data = code + (1, 0, 1, 1) + pad
expected_result = pad + code + (3, 0, 1, 1)
src = gr.vector_source_b (src_data)
- op = gr.correlate_access_code_bb(access_code, 0)
+ op = digital_swig.correlate_access_code_bb(access_code, 0)
dst = gr.vector_sink_b ()
self.tb.connect (src, op, dst)
self.tb.run ()
diff --git a/gr-digital/python/qa_costas_loop_cc.py b/gr-digital/python/qa_costas_loop_cc.py
new file mode 100755
index 000000000..124159dba
--- /dev/null
+++ b/gr-digital/python/qa_costas_loop_cc.py
@@ -0,0 +1,151 @@
+#!/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, gr_unittest
+import digital_swig, psk2
+import random, cmath
+
+class test_costas_loop_cc(gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test01 (self):
+ # test basic functionality by setting all gains to 0
+ natfreq = 0.0
+ order = 2
+ self.test = digital_swig.costas_loop_cc(natfreq, order)
+
+ data = 100*[complex(1,0),]
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = data
+ dst_data = self.snk.data()
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
+
+ def test02 (self):
+ # Make sure it doesn't diverge given perfect data
+ natfreq = 0.25
+ order = 2
+ self.test = digital_swig.costas_loop_cc(natfreq, order)
+
+ data = [complex(2*random.randint(0,1)-1, 0) for i in xrange(100)]
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = data
+ dst_data = self.snk.data()
+
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 5)
+
+ def test03 (self):
+ # BPSK Convergence test with static rotation
+ natfreq = 0.25
+ order = 2
+ self.test = digital_swig.costas_loop_cc(natfreq, order)
+
+ rot = cmath.exp(0.2j) # some small rotation
+ data = [complex(2*random.randint(0,1)-1, 0) for i in xrange(100)]
+
+ N = 40 # settling time
+ expected_result = data[N:]
+ data = [rot*d for d in data]
+
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ dst_data = self.snk.data()[N:]
+
+ # generously compare results; the loop will converge near to, but
+ # not exactly on, the target data
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 2)
+
+ def test04 (self):
+ # QPSK Convergence test with static rotation
+ natfreq = 0.25
+ order = 4
+ self.test = digital_swig.costas_loop_cc(natfreq, order)
+
+ rot = cmath.exp(0.2j) # some small rotation
+ data = [complex(2*random.randint(0,1)-1, 2*random.randint(0,1)-1)
+ for i in xrange(100)]
+
+ N = 40 # settling time
+ expected_result = data[N:]
+ data = [rot*d for d in data]
+
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ dst_data = self.snk.data()[N:]
+
+ # generously compare results; the loop will converge near to, but
+ # not exactly on, the target data
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 2)
+
+ def test05 (self):
+ # 8PSK Convergence test with static rotation
+ natfreq = 0.25
+ order = 8
+ self.test = digital_swig.costas_loop_cc(natfreq, order)
+
+ rot = cmath.exp(-cmath.pi/8.0j) # rotate to match Costas rotation
+ const = psk2.psk_constellation(order)
+ data = [random.randint(0,7) for i in xrange(100)]
+ data = [2*rot*const.points()[d] for d in data]
+
+ N = 40 # settling time
+ expected_result = data[N:]
+
+ rot = cmath.exp(0.1j) # some small rotation
+ data = [rot*d for d in data]
+
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ dst_data = self.snk.data()[N:]
+
+ # generously compare results; the loop will converge near to, but
+ # not exactly on, the target data
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 2)
+
+if __name__ == '__main__':
+ gr_unittest.run(test_costas_loop_cc, "test_costas_loop_cc.xml")
diff --git a/gr-digital/python/qa_cpm.py b/gr-digital/python/qa_cpm.py
new file mode 100755
index 000000000..12a84c76c
--- /dev/null
+++ b/gr-digital/python/qa_cpm.py
@@ -0,0 +1,91 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 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, gr_unittest
+import digital_swig
+import numpy
+
+class test_cpm(gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def do_check_phase_shift(self, type, name):
+ sps = 2
+ L = 1
+ in_bits = (1,) * 20
+ src = gr.vector_source_b(in_bits, False)
+ cpm = digital_swig.cpmmod_bc(type, 0.5, sps, L)
+ arg = gr.complex_to_arg()
+ sink = gr.vector_sink_f()
+
+ self.tb.connect(src, cpm, arg, sink)
+ self.tb.run()
+
+ symbol_phases = numpy.array(sink.data()[sps*L-1::sps])
+ phase_diff = numpy.mod(numpy.subtract(symbol_phases[1:], symbol_phases[:-1]),
+ (2*numpy.pi,) * (len(symbol_phases)-1))
+ self.assertFloatTuplesAlmostEqual(tuple(phase_diff), (0.5 * numpy.pi,) * len(phase_diff), 5,
+ msg="Phase shift was not correct for CPM method " + name)
+
+ def test_001_lrec(self):
+ self.do_check_phase_shift(gr.cpm.LRC, 'LREC')
+
+ def test_001_lrc(self):
+ self.do_check_phase_shift(gr.cpm.LRC, 'LRC')
+
+ def test_001_lsrc(self):
+ self.do_check_phase_shift(gr.cpm.LSRC, 'LSRC')
+
+ def test_001_ltfm(self):
+ self.do_check_phase_shift(gr.cpm.TFM, 'TFM')
+
+ def test_001_lgmsk(self):
+ sps = 2
+ L = 5
+ bt = 0.3
+ in_bits = (1,) * 20
+ src = gr.vector_source_b(in_bits, False)
+ gmsk = digital_swig.gmskmod_bc(sps, bt, L)
+ arg = gr.complex_to_arg()
+ sink = gr.vector_sink_f()
+
+ self.tb.connect(src, gmsk, arg, sink)
+ self.tb.run()
+
+ symbol_phases = numpy.array(sink.data()[sps*L-1::sps])
+ phase_diff = numpy.mod(numpy.subtract(symbol_phases[1:], symbol_phases[:-1]),
+ (2*numpy.pi,) * (len(symbol_phases)-1))
+ self.assertFloatTuplesAlmostEqual(tuple(phase_diff), (0.5 * numpy.pi,) * len(phase_diff), 5,
+ msg="Phase shift was not correct for GMSK")
+
+ def test_phase_response(self):
+ phase_response = gr.cpm.phase_response(gr.cpm.LREC, 2, 4)
+ self.assertAlmostEqual(numpy.sum(phase_response), 1)
+
+
+if __name__ == '__main__':
+ gr_unittest.run(test_cpm, "test_cpm.xml")
+
diff --git a/gr-digital/python/qa_crc32.py b/gr-digital/python/qa_crc32.py
new file mode 100755
index 000000000..f86813f3f
--- /dev/null
+++ b/gr-digital/python/qa_crc32.py
@@ -0,0 +1,60 @@
+#!/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, gr_unittest
+import digital_swig
+import random, cmath
+
+class test_crc32(gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test01 (self):
+ data = 100*"0"
+ expected_result = 2943744955
+ result = digital_swig.crc32(data)
+ #print hex(result)
+
+ self.assertEqual (expected_result, result)
+
+ def test02 (self):
+ data = 100*"1"
+ expected_result = 2326594156
+ result = digital_swig.crc32(data)
+ #print hex(result)
+
+ self.assertEqual (expected_result, result)
+
+ def test03 (self):
+ data = 10*"0123456789"
+ expected_result = 3774345973
+ result = digital_swig.crc32(data)
+ #print hex(result)
+
+ self.assertEqual (expected_result, result)
+
+if __name__ == '__main__':
+ gr_unittest.run(test_crc32, "test_crc32.xml")
diff --git a/gr-gpio/src/fpga/rbf/Makefile.am b/gr-digital/python/qa_digital.py
index e444d62eb..97e35da56 100644..100755
--- a/gr-gpio/src/fpga/rbf/Makefile.am
+++ b/gr-digital/python/qa_digital.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
#
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,16 +20,16 @@
# Boston, MA 02110-1301, USA.
#
-include $(top_srcdir)/Makefile.common
+from gnuradio import gr, gr_unittest
+import digital_swig
-RBFS = \
- std_2rxhb_2tx_dig.rbf \
- std_2rxint_2tx_dig.rbf
+class test_digital(gr_unittest.TestCase):
-datadir = $(prefix)/share/usrp
-datarev2dir = $(datadir)/rev2
-datarev4dir = $(datadir)/rev4
+ def setUp (self):
+ self.tb = gr.top_block ()
-dist_datarev2_DATA = $(RBFS)
+ def tearDown (self):
+ self.tb = None
-dist_datarev4_DATA = $(RBFS)
+if __name__ == '__main__':
+ gr_unittest.run(test_digital, "test_digital.xml")
diff --git a/gr-digital/python/qa_fll_band_edge.py b/gr-digital/python/qa_fll_band_edge.py
new file mode 100755
index 000000000..088eb2b68
--- /dev/null
+++ b/gr-digital/python/qa_fll_band_edge.py
@@ -0,0 +1,83 @@
+#!/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, gr_unittest
+import digital_swig
+import random, math
+
+class test_fll_band_edge_cc(gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block ()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test01 (self):
+ sps = 4
+ rolloff = 0.35
+ bw = 2*math.pi/100.0
+ ntaps = 45
+
+ # Create pulse shape filter
+ rrc_taps = gr.firdes.root_raised_cosine(
+ sps, sps, 1.0, rolloff, ntaps)
+
+ # The frequency offset to correct
+ foffset = 0.2 / (2.0*math.pi)
+
+ # Create a set of 1's and -1's, pulse shape and interpolate to sps
+ data = [2.0*random.randint(0, 2) - 1.0 for i in xrange(200)]
+ self.src = gr.vector_source_c(data, False)
+ self.rrc = gr.interp_fir_filter_ccf(sps, rrc_taps)
+
+ # Mix symbols with a complex sinusoid to spin them
+ self.nco = gr.sig_source_c(1, gr.GR_SIN_WAVE, foffset, 1)
+ self.mix = gr.multiply_cc()
+
+ # FLL will despin the symbols to an arbitrary phase
+ self.fll = digital_swig.fll_band_edge_cc(sps, rolloff, ntaps, bw)
+
+ # Create sinks for all outputs of the FLL
+ # we will only care about the freq and error outputs
+ self.vsnk_frq = gr.vector_sink_f()
+ self.nsnk_fll = gr.null_sink(gr.sizeof_gr_complex)
+ self.nsnk_phs = gr.null_sink(gr.sizeof_float)
+ self.nsnk_err = gr.null_sink(gr.sizeof_float)
+
+ # Connect the blocks
+ self.tb.connect(self.nco, (self.mix,1))
+ self.tb.connect(self.src, self.rrc, (self.mix,0))
+ self.tb.connect(self.mix, self.fll, self.nsnk_fll)
+ self.tb.connect((self.fll,1), self.vsnk_frq)
+ self.tb.connect((self.fll,2), self.nsnk_phs)
+ self.tb.connect((self.fll,3), self.nsnk_err)
+ self.tb.run()
+
+ N = 700
+ dst_data = self.vsnk_frq.data()[N:]
+
+ expected_result = len(dst_data)* [-0.20,]
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 4)
+
+if __name__ == '__main__':
+ gr_unittest.run(test_fll_band_edge_cc, "test_fll_band_edge_cc.xml")
diff --git a/gr-digital/python/qa_lms_equalizer.py b/gr-digital/python/qa_lms_equalizer.py
new file mode 100755
index 000000000..025c785aa
--- /dev/null
+++ b/gr-digital/python/qa_lms_equalizer.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# Copyright 2006,2007,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,
+# Boston, MA 02110-1301, USA.
+#
+
+from gnuradio import gr, gr_unittest
+import digital_swig
+
+class test_lms_dd_equalizer(gr_unittest.TestCase):
+
+ def setUp(self):
+ self.tb = gr.top_block()
+
+ def tearDown(self):
+ self.tb = None
+
+ def transform(self, src_data, gain, const):
+ SRC = gr.vector_source_c(src_data, False)
+ EQU = digital_swig.lms_dd_equalizer_cc(4, gain, 1, const.base())
+ DST = gr.vector_sink_c()
+ self.tb.connect(SRC, EQU, DST)
+ self.tb.run()
+ return DST.data()
+
+ def test_001_identity(self):
+ # Constant modulus signal so no adjustments
+ const = digital_swig.constellation_qpsk()
+ src_data = const.points()*1000
+
+ N = 100 # settling time
+ expected_data = src_data[N:]
+ result = self.transform(src_data, 0.1, const)[N:]
+ self.assertComplexTuplesAlmostEqual(expected_data, result, 5)
+
+if __name__ == "__main__":
+ gr_unittest.run(test_lms_dd_equalizer, "test_lms_dd_equalizer.xml")
diff --git a/gr-digital/python/qa_mpsk_receiver.py b/gr-digital/python/qa_mpsk_receiver.py
new file mode 100755
index 000000000..6531e59f7
--- /dev/null
+++ b/gr-digital/python/qa_mpsk_receiver.py
@@ -0,0 +1,121 @@
+#!/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, gr_unittest
+import digital_swig, psk2
+import random, cmath
+
+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.25
+ gain_mu = 0.01
+ omega = 2
+ gain_omega = 0.001
+ omega_rel = 0.001
+
+ self.test = digital_swig.mpsk_receiver_cc(M, theta, loop_bw,
+ fmin, fmax, mu, gain_mu,
+ omega, gain_omega,
+ omega_rel)
+
+ data = 1000*[complex(1,0), complex(1,0), complex(-1,0), complex(-1,0)]
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = 1000*[complex(-0.5,0), complex(0.5,0)]
+ dst_data = self.snk.data()
+
+ # Only compare last Ncmp samples
+ Ncmp = 100
+ len_e = len(expected_result)
+ len_d = len(dst_data)
+ expected_result = expected_result[len_e - Ncmp:]
+ dst_data = dst_data[len_d - Ncmp:]
+
+ #for e,d in zip(expected_result, dst_data):
+ # print e, d
+
+ self.assertComplexTuplesAlmostEqual (expected_result, dst_data, 1)
+
+
+ def test02 (self):
+ # Test QPSK sync
+ M = 4
+ theta = 0
+ loop_bw = 2*cmath.pi/100.0
+ fmin = -0.5
+ fmax = 0.5
+ mu = 0.25
+ gain_mu = 0.01
+ omega = 2
+ gain_omega = 0.001
+ omega_rel = 0.001
+
+ self.test = digital_swig.mpsk_receiver_cc(M, theta, loop_bw,
+ fmin, fmax, mu, gain_mu,
+ omega, gain_omega,
+ omega_rel)
+
+ data = 1000*[complex( 0.707, 0.707), complex( 0.707, 0.707),
+ complex(-0.707, 0.707), complex(-0.707, 0.707),
+ complex(-0.707, -0.707), complex(-0.707, -0.707),
+ complex( 0.707, -0.707), complex( 0.707, -0.707)]
+ self.src = gr.vector_source_c(data, False)
+ self.snk = gr.vector_sink_c()
+
+ self.tb.connect(self.src, self.test, self.snk)
+ self.tb.run()
+
+ expected_result = 1000*[complex(0, -1.0), complex(1.0, 0),
+ complex(0, 1.0), complex(-1.0, 0)]
+ dst_data = self.snk.data()
+
+ # Only compare last Ncmp samples
+ Ncmp = 100
+ len_e = len(expected_result)
+ len_d = len(dst_data)
+ expected_result = expected_result[len_e - Ncmp:]
+ dst_data = dst_data[len_d - Ncmp:]
+
+ #for e,d in zip(expected_result, dst_data):
+ # print 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/qam.py b/gr-digital/python/qam.py
new file mode 100644
index 000000000..a5a2e6c2c
--- /dev/null
+++ b/gr-digital/python/qam.py
@@ -0,0 +1,227 @@
+#
+# 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 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.
+#
+
+"""
+QAM modulation and demodulation.
+"""
+
+from math import pi, sqrt, log
+
+from gnuradio import gr
+from generic_mod_demod import generic_mod, generic_demod
+from utils.gray_code import gray_code
+from utils import mod_codes
+import modulation_utils2
+
+# Default number of points in constellation.
+_def_constellation_points = 16
+# Whether the quadrant bits are coded differentially.
+_def_differential = True
+# Whether gray coding is used. If differential is True then gray
+# coding is used within but not between each quadrant.
+_def_mod_code = mod_codes.NO_CODE
+
+def is_power_of_four(x):
+ v = log(x)/log(4)
+ return int(v) == v
+
+def get_bit(x, n):
+ """ Get the n'th bit of integer x (from little end)."""
+ return (x&(0x01 << n)) >> n
+
+def get_bits(x, n, k):
+ """ Get the k bits of integer x starting at bit n(from little end)."""
+ # Remove the n smallest bits
+ v = x >> n
+ # Remove all bits bigger than n+k-1
+ return v % pow(2, k)
+
+def make_differential_constellation(m, gray_coded):
+ """
+ Create a constellation with m possible symbols where m must be
+ a power of 4.
+
+ Points are laid out in a square grid.
+
+ Bits referring to the quadrant are differentilly encoded,
+ remaining bits are gray coded.
+
+ """
+ sqrtm = pow(m, 0.5)
+ if (not isinstance(m, int) or m < 4 or not is_power_of_four(m)):
+ raise ValueError("m must be a power of 4 integer.")
+ # Each symbol holds k bits.
+ k = int(log(m) / log(2.0))
+ # First create a constellation for one quadrant containing m/4 points.
+ # The quadrant has 'side' points along each side of a quadrant.
+ side = int(sqrtm/2)
+ if gray_coded:
+ # Number rows and columns using gray codes.
+ gcs = gray_code(side)
+ # Get inverse gray codes.
+ i_gcs = dict([(v, key) for key, v in enumerate(gcs)])
+ else:
+ i_gcs = dict([(i, i) for i in range(0, side)])
+ # The distance between points is found.
+ step = 1/(side-0.5)
+
+ gc_to_x = [(i_gcs[gc]+0.5)*step for gc in range(0, side)]
+
+ # Takes the (x, y) location of the point with the quadrant along
+ # with the quadrant number. (x, y) are integers referring to which
+ # point within the quadrant it is.
+ # A complex number representing this location of this point is returned.
+ def get_c(gc_x, gc_y, quad):
+ if quad == 0:
+ return complex(gc_to_x[gc_x], gc_to_x[gc_y])
+ if quad == 1:
+ return complex(-gc_to_x[gc_y], gc_to_x[gc_x])
+ if quad == 2:
+ return complex(-gc_to_x[gc_x], -gc_to_x[gc_y])
+ if quad == 3:
+ return complex(gc_to_x[gc_y], -gc_to_x[gc_x])
+ raise StandardError("Impossible!")
+
+ # First two bits determine quadrant.
+ # Next (k-2)/2 bits determine x position.
+ # Following (k-2)/2 bits determine y position.
+ # How x and y relate to real and imag depends on quadrant (see get_c function).
+ const_map = []
+ for i in range(m):
+ y = get_bits(i, 0, (k-2)/2)
+ x = get_bits(i, (k-2)/2, (k-2)/2)
+ quad = get_bits(i, k-2, 2)
+ const_map.append(get_c(x, y, quad))
+
+ return const_map
+
+def make_non_differential_constellation(m, gray_coded):
+ side = int(pow(m, 0.5))
+ if (not isinstance(m, int) or m < 4 or not is_power_of_four(m)):
+ raise ValueError("m must be a power of 4 integer.")
+ # Each symbol holds k bits.
+ k = int(log(m) / log(2.0))
+ if gray_coded:
+ # Number rows and columns using gray codes.
+ gcs = gray_code(side)
+ # Get inverse gray codes.
+ i_gcs = mod_codes.invert_code(gcs)
+ else:
+ i_gcs = range(0, side)
+ # The distance between points is found.
+ step = 2.0/(side-1)
+
+ gc_to_x = [-1 + i_gcs[gc]*step for gc in range(0, side)]
+ # First k/2 bits determine x position.
+ # Following k/2 bits determine y position.
+ const_map = []
+ for i in range(m):
+ y = gc_to_x[get_bits(i, 0, k/2)]
+ x = gc_to_x[get_bits(i, k/2, k/2)]
+ const_map.append(complex(x,y))
+ return const_map
+
+# /////////////////////////////////////////////////////////////////////////////
+# QAM constellation
+# /////////////////////////////////////////////////////////////////////////////
+
+def qam_constellation(constellation_points=_def_constellation_points,
+ differential=_def_differential,
+ mod_code=_def_mod_code):
+ """
+ Creates a QAM constellation object.
+ """
+ if mod_code == mod_codes.GRAY_CODE:
+ gray_coded = True
+ elif mod_code == mod_codes.NO_CODE:
+ gray_coded = False
+ else:
+ raise ValueError("Mod code is not implemented for QAM")
+ if differential:
+ points = make_differential_constellation(constellation_points, gray_coded)
+ else:
+ points = make_non_differential_constellation(constellation_points, gray_coded)
+ side = int(sqrt(constellation_points))
+ width = 2.0/(side-1)
+ # No pre-diff code
+ # Should add one so that we can gray-code the quadrant bits too.
+ pre_diff_code = []
+ constellation = gr.constellation_rect(points, pre_diff_code, 4, side, side, width, width)
+ return constellation
+
+# /////////////////////////////////////////////////////////////////////////////
+# QAM modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class qam_mod(generic_mod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=_def_differential,
+ mod_code=_def_mod_code,
+ *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered QAM modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_mod block for list of parameters.
+ """
+
+ constellation = qam_constellation(constellation_points, differential, mod_code)
+ # We take care of the gray coding in the constellation generation so it doesn't
+ # need to be done in the block.
+ super(qam_mod, self).__init__(constellation, differential=differential,
+ *args, **kwargs)
+
+# /////////////////////////////////////////////////////////////////////////////
+# QAM demodulator
+#
+# /////////////////////////////////////////////////////////////////////////////
+
+class qam_demod(generic_demod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=_def_differential,
+ mod_code=_def_mod_code,
+ *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered QAM modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_demod block for list of parameters.
+ """
+ constellation = qam_constellation(constellation_points, differential, mod_code)
+ # We take care of the gray coding in the constellation generation so it doesn't
+ # need to be done in the block.
+ super(qam_demod, self).__init__(constellation, differential=differential,
+ *args, **kwargs)
+
+#
+# Add these to the mod/demod registry
+#
+modulation_utils2.add_type_1_mod('qam', qam_mod)
+modulation_utils2.add_type_1_demod('qam', qam_demod)
+modulation_utils2.add_type_1_constellation('qam', qam_constellation)
diff --git a/gr-digital/python/qpsk.py b/gr-digital/python/qpsk.py
new file mode 100644
index 000000000..481b7cb5b
--- /dev/null
+++ b/gr-digital/python/qpsk.py
@@ -0,0 +1,176 @@
+#
+# 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 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.
+#
+
+"""
+QPSK modulation.
+
+Demodulation is not included since the generic_mod_demod
+"""
+
+from gnuradio import gr
+from gnuradio.digital.generic_mod_demod import generic_mod, generic_demod
+import digital_swig
+import modulation_utils2
+
+# Default number of points in constellation.
+_def_constellation_points = 4
+# Whether gray coding is used.
+_def_gray_coded = True
+
+# /////////////////////////////////////////////////////////////////////////////
+# QPSK constellation
+# /////////////////////////////////////////////////////////////////////////////
+
+def qpsk_constellation(m=_def_constellation_points):
+ if m != _def_constellation_points:
+ raise ValueError("QPSK can only have 4 constellation points.")
+ return digital_swig.constellation_qpsk()
+
+# /////////////////////////////////////////////////////////////////////////////
+# QPSK modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class qpsk_mod(generic_mod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ gray_coded=_def_gray_coded,
+ *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered QPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_mod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_qpsk()
+ if constellation_points != 4:
+ raise ValueError("QPSK can only have 4 constellation points.")
+ if not gray_coded:
+ raise ValueError("This QPSK mod/demod works only for gray-coded constellations.")
+ super(qpsk_mod, self).__init__(constellation=constellation,
+ gray_coded=gray_coded,
+ *args, **kwargs)
+
+
+# /////////////////////////////////////////////////////////////////////////////
+# QPSK demodulator
+#
+# /////////////////////////////////////////////////////////////////////////////
+
+class qpsk_demod(generic_demod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered QPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_demod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_qpsk()
+ if constellation_points != 4:
+ raise ValueError('Number of constellation points must be 4 for QPSK.')
+ super(qpsk_demod, self).__init__(constellation=constellation,
+ *args, **kwargs)
+
+
+
+# /////////////////////////////////////////////////////////////////////////////
+# DQPSK constellation
+# /////////////////////////////////////////////////////////////////////////////
+
+def dqpsk_constellation(m=_def_constellation_points):
+ if m != _def_constellation_points:
+ raise ValueError("DQPSK can only have 4 constellation points.")
+ return digital_swig.constellation_dqpsk()
+
+# /////////////////////////////////////////////////////////////////////////////
+# DQPSK modulator
+# /////////////////////////////////////////////////////////////////////////////
+
+class dqpsk_mod(generic_mod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ gray_coded=_def_gray_coded,
+ differential=True, *args, **kwargs):
+ """
+ Hierarchical block for RRC-filtered DQPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_mod block for list of parameters.
+ """
+
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_dqpsk()
+ if constellation_points != 4:
+ raise ValueError('Number of constellation points must be 4 for DQPSK.')
+ super(dqpsk_mod, self).__init__(constellation=constellation,
+ gray_coded=gray_coded,
+ differential=True,
+ *args, **kwargs)
+
+# /////////////////////////////////////////////////////////////////////////////
+# DQPSK demodulator
+#
+# /////////////////////////////////////////////////////////////////////////////
+
+class dqpsk_demod(generic_demod):
+
+ def __init__(self, constellation_points=_def_constellation_points,
+ differential=True, *args, **kwargs):
+
+ """
+ Hierarchical block for RRC-filtered DQPSK modulation.
+
+ The input is a byte stream (unsigned char) and the
+ output is the complex modulated signal at baseband.
+
+ See generic_demod block for list of parameters.
+ """
+ constellation_points = _def_constellation_points
+ constellation = digital_swig.constellation_dqpsk()
+ if constellation_points != 4:
+ raise ValueError('Number of constellation points must be 4 for DQPSK.')
+ super(dqpsk_demod, self).__init__(constellation=constellation,
+ differential=True,
+ *args, **kwargs)
+
+#
+# Add these to the mod/demod registry
+#
+modulation_utils2.add_type_1_mod('qpsk', qpsk_mod)
+modulation_utils2.add_type_1_demod('qpsk', qpsk_demod)
+modulation_utils2.add_type_1_constellation('qpsk', qpsk_constellation)
+modulation_utils2.add_type_1_mod('dqpsk', dqpsk_mod)
+modulation_utils2.add_type_1_demod('dqpsk', dqpsk_demod)
+modulation_utils2.add_type_1_constellation('dqpsk', dqpsk_constellation)
+
diff --git a/gr-gcell/src/run_tests.in b/gr-digital/python/run_tests.in
index f7d51750d..b39e7e847 100644
--- a/gr-gcell/src/run_tests.in
+++ b/gr-digital/python/run_tests.in
@@ -5,6 +5,6 @@
# 3rd parameter is path to Python QA directory
@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-gcell \
- @abs_top_builddir@/gr-gcell \
+ @abs_top_srcdir@/gr-digital \
+ @abs_top_builddir@/gr-digital \
@srcdir@
diff --git a/gr-digital/python/utils/.gitignore b/gr-digital/python/utils/.gitignore
new file mode 100644
index 000000000..60c81fdce
--- /dev/null
+++ b/gr-digital/python/utils/.gitignore
@@ -0,0 +1,3 @@
+run_tests
+Makefile
+Makefile.in
diff --git a/gr-sounder/src/Makefile.am b/gr-digital/python/utils/Makefile.am
index d546da7f8..6da4d61dd 100644
--- a/gr-sounder/src/Makefile.am
+++ b/gr-digital/python/utils/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,14 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = fpga lib
if PYTHON
-SUBDIRS += python
-endif
+utilspythondir = $(grpythondir)/digital/utils
+
+TESTS =
+
+utilspython_PYTHON = \
+ __init__.py \
+ gray_code.py \
+ mod_codes.py \
+ alignment.py
+endif \ No newline at end of file
diff --git a/gr-gpio/src/fpga/Makefile.am b/gr-digital/python/utils/__init__.py
index 2b6f2585e..b3e997f9f 100644
--- a/gr-gpio/src/fpga/Makefile.am
+++ b/gr-digital/python/utils/__init__.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
#
-# Copyright 2008 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -18,6 +19,3 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#
-
-SUBDIRS = include lib top rbf
-
diff --git a/gr-digital/python/utils/alignment.py b/gr-digital/python/utils/alignment.py
new file mode 100644
index 000000000..d32365866
--- /dev/null
+++ b/gr-digital/python/utils/alignment.py
@@ -0,0 +1,139 @@
+#!/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.
+#
+"""
+This module contains functions for aligning sequences.
+
+>>> import random
+>>> random.seed(1234)
+>>> ran_seq = [random.randint(0,1) for i in range(0, 100)]
+>>> offset_seq = [0] * 20 + ran_seq
+>>> correct, overlap, offset = align_sequences(ran_seq, offset_seq)
+>>> print(correct, overlap, offset)
+(1.0, 100, -20)
+>>> offset_err_seq = []
+>>> for bit in offset_seq:
+... if random.randint(0,4) == 4:
+... offset_err_seq.append(random.randint(0,1))
+... else:
+... offset_err_seq.append(bit)
+>>> correct, overlap, offset = align_sequences(ran_seq, offset_err_seq)
+>>> print(overlap, offset)
+(100, -20)
+
+"""
+
+import random
+
+# DEFAULT PARAMETERS
+# If the fraction of matching bits between two sequences is greater than
+# this the sequences are assumed to be aligned.
+def_correct_cutoff = 0.9
+# The maximum offset to test during sequence alignment.
+def_max_offset = 500
+# The maximum number of samples to take from two sequences to check alignment.
+def_num_samples = 1000
+
+def compare_sequences(d1, d2, offset, sample_indices=None):
+ """
+ Takes two binary sequences and an offset and returns the number of
+ matching entries and the number of compared entries.
+ d1 & d2 -- sequences
+ offset -- offset of d2 relative to d1
+ sample_indices -- a list of indices to use for the comparison
+ """
+ max_index = min(len(d1), len(d2)+offset)
+ if sample_indices is None:
+ sample_indices = range(0, max_index)
+ correct = 0
+ total = 0
+ for i in sample_indices:
+ if i >= max_index:
+ break
+ if d1[i] == d2[i-offset]:
+ correct += 1
+ total += 1
+ return (correct, total)
+
+def random_sample(size, num_samples=def_num_samples, seed=None):
+ """
+ Returns a set of random integers between 0 and (size-1).
+ The set contains no more than num_samples integers.
+ """
+ random.seed(seed)
+ if num_samples > size:
+ indices = set(range(0, size))
+ else:
+ if num_samples > size/2:
+ num_samples = num_samples/2
+ indices = set([])
+ while len(indices) < num_samples:
+ index = random.randint(0, size-1)
+ indices.add(index)
+ indices = list(indices)
+ indices.sort()
+ return indices
+
+def align_sequences(d1, d2,
+ num_samples=def_num_samples,
+ max_offset=def_max_offset,
+ correct_cutoff=def_correct_cutoff,
+ seed=None,
+ indices=None):
+ """
+ Takes two sequences and finds the offset and which the two sequences best
+ match. It returns the fraction correct, the number of entries compared,
+ the offset.
+ d1 & d2 -- sequences to compare
+ num_samples -- the maximum number of entries to compare
+ max_offset -- the maximum offset between the sequences that is checked
+ correct_cutoff -- If the fraction of bits correct is greater than this then
+ the offset is assumed to optimum.
+ seed -- a random number seed
+ indices -- an explicit list of the indices used to compare the two sequences
+ """
+ max_overlap = max(len(d1), len(d2))
+ if indices is None:
+ indices = random_sample(max_overlap, num_samples, seed)
+ max_frac_correct = 0
+ best_offset = None
+ best_compared = None
+ best_correct = None
+ pos_range = range(0, min(len(d1), max_offset))
+ neg_range = range(-1, -min(len(d2), max_offset), -1)
+ # Interleave the positive and negative offsets.
+ int_range = [item for items in zip(pos_range, neg_range) for item in items]
+ for offset in int_range:
+ correct, compared = compare_sequences(d1, d2, offset, indices)
+ frac_correct = 1.0*correct/compared
+ if frac_correct > max_frac_correct:
+ max_frac_correct = frac_correct
+ best_offset = offset
+ best_compared = compared
+ best_correct = correct
+ if frac_correct > correct_cutoff:
+ break
+ return max_frac_correct, best_compared, best_offset, indices
+
+if __name__ == "__main__":
+ import doctest
+ doctest.testmod()
+
diff --git a/gr-digital/python/utils/gray_code.py b/gr-digital/python/utils/gray_code.py
new file mode 100644
index 000000000..926a1ded1
--- /dev/null
+++ b/gr-digital/python/utils/gray_code.py
@@ -0,0 +1,66 @@
+#!/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.
+#
+
+class GrayCodeGenerator(object):
+ """
+ Generates and caches gray codes.
+ """
+
+ def __init__(self):
+ self.gcs = [0, 1]
+ # The last power of two passed through.
+ self.lp2 = 2
+ # The next power of two that will be passed through.
+ self.np2 = 4
+ # Curent index
+ self.i = 2
+
+ def get_gray_code(self, length):
+ """
+ Returns a list of gray code of given length.
+ """
+ if len(self.gcs) < length:
+ self.generate_new_gray_code(length)
+ return self.gcs[:length]
+
+ def generate_new_gray_code(self, length):
+ """
+ Generates new gray code and places into cache.
+ """
+ while len(self.gcs) < length:
+ if self.i == self.lp2:
+ # if i is a power of two then gray number is of form 1100000...
+ result = self.i + self.i/2
+ else:
+ # if not we take advantage of the symmetry of all but the last bit
+ # around a power of two.
+ result = self.gcs[2*self.lp2-1-self.i] + self.lp2
+ self.gcs.append(result)
+ self.i += 1
+ if self.i == self.np2:
+ self.lp2 = self.i
+ self.np2 = self.i*2
+
+_gray_code_generator = GrayCodeGenerator()
+
+gray_code = _gray_code_generator.get_gray_code
+
diff --git a/gr-digital/python/utils/mod_codes.py b/gr-digital/python/utils/mod_codes.py
new file mode 100644
index 000000000..caacda5cc
--- /dev/null
+++ b/gr-digital/python/utils/mod_codes.py
@@ -0,0 +1,33 @@
+#!/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.
+#
+
+GRAY_CODE = 'gray'
+SET_PARTITION_CODE = 'set-partition'
+NO_CODE = 'none'
+
+codes = (GRAY_CODE, SET_PARTITION_CODE, NO_CODE)
+
+def invert_code(code):
+ c = enumerate(code)
+ ic = [(b, a) for (a, b) in c]
+ ic.sort()
+ return [a for (b, a) in ic]
diff --git a/gr-digital/swig/.gitignore b/gr-digital/swig/.gitignore
new file mode 100644
index 000000000..7e864f43f
--- /dev/null
+++ b/gr-digital/swig/.gitignore
@@ -0,0 +1,9 @@
+/Makefile
+/Makefile.in
+/pager_swig.py
+/pager_swig.cc
+/*.pyc
+/run_tests
+/run_guile_tests
+/guile
+/python
diff --git a/gr-digital/swig/Makefile.am b/gr-digital/swig/Makefile.am
new file mode 100644
index 000000000..abc24be19
--- /dev/null
+++ b/gr-digital/swig/Makefile.am
@@ -0,0 +1,82 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+include $(top_srcdir)/Makefile.swig
+
+TESTS =
+EXTRA_DIST += $(nobase_guile_DATA)
+
+AM_CPPFLAGS = \
+ $(GR_DIGITAL_INCLUDES) \
+ $(STD_DEFINES_AND_INCLUDES) \
+ $(PYTHON_CPPFLAGS) \
+ $(WITH_INCLUDES)
+
+if GUILE
+nobase_guile_DATA = \
+ gnuradio/digital.scm
+endif
+
+noinst_GUILE = digital.test
+
+
+##############################
+# SWIG interface and library
+TOP_SWIG_IFILES = \
+ digital_swig.i
+
+# Install so that they end up available as:
+# import gnuradio.digital
+# This ends up at:
+# ${prefix}/lib/python${python_version}/site-packages/gnuradio/digital
+digital_swig_pythondir_category = \
+ gnuradio/digital
+
+# additional libraries for linking with the SWIG-generated library
+digital_swig_la_swig_libadd = \
+ $(abs_top_builddir)/gr-digital/lib/libgnuradio-digital.la
+
+# additional SWIG files to be installed
+digital_swig_swiginclude_headers = \
+ digital_binary_slicer_fb.i \
+ digital_clock_recovery_mm_cc.i \
+ digital_clock_recovery_mm_ff.i \
+ digital_constellation.i \
+ digital_constellation_receiver_cb.i \
+ digital_constellation_decoder_cb.i \
+ digital_correlate_access_code_bb.i \
+ digital_costas_loop_cc.i \
+ digital_cma_equalizer_cc.i \
+ digital_crc32.i \
+ digital_fll_band_edge_cc.i \
+ digital_lms_dd_equalizer_cc.i \
+ digital_kurtotic_equalizer_cc.i \
+ digital_mpsk_receiver_cc.i \
+ digital_gmskmod_bc.i \
+ digital_cpmmod_bc.i
+
+digital_swig_swig_args = \
+ $(GR_DIGITAL_INCLUDES)
+
+if GUILE
+TESTS += run_guile_tests
+endif \ No newline at end of file
diff --git a/gr-gcell/src/Makefile.swig.gen b/gr-digital/swig/Makefile.swig.gen
index dcd8bdefb..ff3eff4e9 100644
--- a/gr-gcell/src/Makefile.swig.gen
+++ b/gr-digital/swig/Makefile.swig.gen
@@ -20,37 +20,37 @@
# Boston, MA 02110-1301, USA.
#
-# Makefile.swig.gen for gcell.i
+# Makefile.swig.gen for digital_swig.i
## Default install locations for these files:
##
## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/gcell
+## ${prefix}/lib/python${python_version}/site-packages/[category]/digital_swig
## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gcell
+## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/digital_swig
##
## The following can be overloaded to change the install location, but
## this has to be done in the including Makefile.am -before-
## Makefile.swig is included.
-gcell_pythondir_category ?= gnuradio/gcell
-gcell_pylibdir_category ?= $(gcell_pythondir_category)
-gcell_pythondir = $(pythondir)/$(gcell_pythondir_category)
-gcell_pylibdir = $(pyexecdir)/$(gcell_pylibdir_category)
+digital_swig_pythondir_category ?= gnuradio/digital_swig
+digital_swig_pylibdir_category ?= $(digital_swig_pythondir_category)
+digital_swig_pythondir = $(pythondir)/$(digital_swig_pythondir_category)
+digital_swig_pylibdir = $(pyexecdir)/$(digital_swig_pylibdir_category)
# The .so libraries for the guile modules get installed whereever guile
# is installed, usually /usr/lib/guile/gnuradio/
# FIXME: determince whether these should be installed with gnuradio.
-gcell_scmlibdir = $(libdir)
+digital_swig_scmlibdir = $(libdir)
# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/gcell
+# is installed, usually /usr/share/guile/site/digital_swig
# FIXME: determince whether these should be installed with gnuradio.
-gcell_scmdir = $(guiledir)
+digital_swig_scmdir = $(guiledir)
## SWIG headers are always installed into the same directory.
-gcell_swigincludedir = $(swigincludedir)
+digital_swig_swigincludedir = $(swigincludedir)
## This is a template file for a "generated" Makefile addition (in
## this case, "Makefile.swig.gen"). By including the top-level
@@ -75,71 +75,68 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S*
## Makefile.am by setting the variable value there, then including
## Makefile.swig .
-gcell_swiginclude_HEADERS = \
- gcell.i \
- $(gcell_swiginclude_headers)
+digital_swig_swiginclude_HEADERS = \
+ digital_swig.i \
+ $(digital_swig_swiginclude_headers)
if PYTHON
-gcell_pylib_LTLIBRARIES = \
- _gcell.la
+digital_swig_pylib_LTLIBRARIES = \
+ _digital_swig.la
-_gcell_la_SOURCES = \
- python/gcell.cc \
- $(gcell_la_swig_sources)
+_digital_swig_la_SOURCES = \
+ python/digital_swig.cc \
+ $(digital_swig_la_swig_sources)
-gcell_python_PYTHON = \
- gcell.py \
- $(gcell_python)
+digital_swig_python_PYTHON = \
+ digital_swig.py \
+ $(digital_swig_python)
-_gcell_la_LIBADD = \
+_digital_swig_la_LIBADD = \
$(STD_SWIG_LA_LIB_ADD) \
- $(gcell_la_swig_libadd)
+ $(digital_swig_la_swig_libadd)
-_gcell_la_LDFLAGS = \
+_digital_swig_la_LDFLAGS = \
$(STD_SWIG_LA_LD_FLAGS) \
- $(gcell_la_swig_ldflags)
+ $(digital_swig_la_swig_ldflags)
-_gcell_la_CXXFLAGS = \
+_digital_swig_la_CXXFLAGS = \
$(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(gcell_la_swig_cxxflags)
+ -I$(top_builddir)
-python/gcell.cc: gcell.py
-gcell.py: gcell.i
+python/digital_swig.cc: digital_swig.py
+digital_swig.py: digital_swig.i
# Include the python dependencies for this file
--include python/gcell.d
+-include python/digital_swig.d
endif # end of if python
if GUILE
-gcell_scmlib_LTLIBRARIES = \
- libguile-gnuradio-gcell.la
-libguile_gnuradio_gcell_la_SOURCES = \
- guile/gcell.cc \
- $(gcell_la_swig_sources)
-nobase_gcell_scm_DATA = \
- gnuradio/gcell.scm \
- gnuradio/gcell-primitive.scm
-libguile_gnuradio_gcell_la_LIBADD = \
+digital_swig_scmlib_LTLIBRARIES = \
+ libguile-gnuradio-digital_swig.la
+libguile_gnuradio_digital_swig_la_SOURCES = \
+ guile/digital_swig.cc \
+ $(digital_swig_la_swig_sources)
+nobase_digital_swig_scm_DATA = \
+ gnuradio/digital_swig.scm \
+ gnuradio/digital_swig-primitive.scm
+libguile_gnuradio_digital_swig_la_LIBADD = \
$(STD_SWIG_LA_LIB_ADD) \
- $(gcell_la_swig_libadd)
-libguile_gnuradio_gcell_la_LDFLAGS = \
+ $(digital_swig_la_swig_libadd)
+libguile_gnuradio_digital_swig_la_LDFLAGS = \
$(STD_SWIG_LA_LD_FLAGS) \
- $(gcell_la_swig_ldflags)
-libguile_gnuradio_gcell_la_CXXFLAGS = \
+ $(digital_swig_la_swig_ldflags)
+libguile_gnuradio_digital_swig_la_CXXFLAGS = \
$(STD_SWIG_CXX_FLAGS) \
-I$(top_builddir) \
- $(gcell_la_swig_cxxflags)
+ $(digital_swig_la_swig_cxxflags)
-guile/gcell.cc: gnuradio/gcell.scm
-gnuradio/gcell.scm: gcell.i
-gnuradio/gcell-primitive.scm: gnuradio/gcell.scm
+guile/digital_swig.cc: gnuradio/digital_swig.scm
+gnuradio/digital_swig.scm: digital_swig.i
+gnuradio/digital_swig-primitive.scm: gnuradio/digital_swig.scm
# Include the guile dependencies for this file
--include guile/gcell.d
+-include guile/digital_swig.d
endif # end of GUILE
-
-
diff --git a/gnuradio-core/src/lib/general/gr_crc32.i b/gr-digital/swig/_digital_hier.i
index 7dca5c6a1..022e38644 100644
--- a/gnuradio-core/src/lib/general/gr_crc32.i
+++ b/gr-digital/swig/_digital_hier.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,8 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
-%rename(update_crc32) gr_update_crc32;
-%rename(crc32) gr_crc32;
+%{
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
-unsigned int gr_update_crc32(unsigned int crc, const std::string buf);
-unsigned int gr_crc32(const std::string buf);
+#include <digital_cpmmod_bc.h>
+#include <digital_gmskmod_bc.h>
+%}
+
+%include "digital_cpmmod_bc.i"
+%include "digital_gmskmod_bc.i"
diff --git a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.i b/gr-digital/swig/digital_binary_slicer_fb.i
index b6f4e9312..30603748b 100644
--- a/gnuradio-core/src/lib/general/gr_binary_slicer_fb.i
+++ b/gr-digital/swig/digital_binary_slicer_fb.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,14 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,binary_slicer_fb);
+GR_SWIG_BLOCK_MAGIC(digital,binary_slicer_fb);
-gr_binary_slicer_fb_sptr gr_make_binary_slicer_fb ();
+digital_binary_slicer_fb_sptr digital_make_binary_slicer_fb ();
-class gr_binary_slicer_fb : public gr_sync_block
+class digital_binary_slicer_fb : public gr_sync_block
{
private:
- gr_binary_slicer_fb ();
+ digital_binary_slicer_fb ();
public:
};
diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i b/gr-digital/swig/digital_clock_recovery_mm_cc.i
index 27eb70b95..4ce9a9725 100644
--- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i
+++ b/gr-digital/swig/digital_clock_recovery_mm_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,18 +20,19 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,clock_recovery_mm_cc);
+GR_SWIG_BLOCK_MAGIC(digital,clock_recovery_mm_cc);
-gr_clock_recovery_mm_cc_sptr
-gr_make_clock_recovery_mm_cc (float omega, float gain_omega,
- float mu, float gain_mu,
- float omega_relative_limit) throw(std::exception);
+digital_clock_recovery_mm_cc_sptr
+digital_make_clock_recovery_mm_cc (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit) throw(std::exception);
-class gr_clock_recovery_mm_cc : public gr_sync_block
+class digital_clock_recovery_mm_cc : public gr_sync_block
{
private:
- gr_clock_recovery_mm_cc (float omega, float gain_omega, float mu,
- float gain_mu, float omega_relative_limit);
+ digital_clock_recovery_mm_cc (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit);
public:
float mu() const { return d_mu;}
diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i b/gr-digital/swig/digital_clock_recovery_mm_ff.i
index 1b2437000..054ef9ebf 100644
--- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i
+++ b/gr-digital/swig/digital_clock_recovery_mm_ff.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,18 +20,19 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,clock_recovery_mm_ff);
+GR_SWIG_BLOCK_MAGIC(digital,clock_recovery_mm_ff);
-gr_clock_recovery_mm_ff_sptr
-gr_make_clock_recovery_mm_ff (float omega, float gain_omega,
- float mu, float gain_mu,
- float omega_relative_limit=0.001) throw(std::exception);
+digital_clock_recovery_mm_ff_sptr
+digital_make_clock_recovery_mm_ff (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit=0.001) throw(std::exception);
-class gr_clock_recovery_mm_ff : public gr_sync_block
+class digital_clock_recovery_mm_ff : public gr_sync_block
{
private:
- gr_clock_recovery_mm_ff (float omega, float gain_omega, float mu, float gain_mu,
- float omega_relative_limit);
+ digital_clock_recovery_mm_ff (float omega, float gain_omega,
+ float mu, float gain_mu,
+ float omega_relative_limit);
public:
float mu() const;
diff --git a/gr-digital/swig/digital_cma_equalizer_cc.i b/gr-digital/swig/digital_cma_equalizer_cc.i
new file mode 100644
index 000000000..183e43ef9
--- /dev/null
+++ b/gr-digital/swig/digital_cma_equalizer_cc.i
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(digital,cma_equalizer_cc)
+
+// retrieve info on the base class, without generating wrappers since
+// the base class has a pure virual method.
+%import "gr_adaptive_fir_ccc.i"
+
+digital_cma_equalizer_cc_sptr
+digital_make_cma_equalizer_cc(int num_taps, float modulus,
+ float mu, int sps);
+
+class digital_cma_equalizer_cc : public gr_adaptive_fir_ccc
+{
+private:
+ digital_cma_equalizer_cc(int num_taps, float modulus,
+ float mu, int sps);
+
+public:
+ float get_gain();
+ void set_gain(float mu);
+ float get_modulus();
+ void set_modulus(float mod);
+};
diff --git a/gr-digital/swig/digital_constellation.i b/gr-digital/swig/digital_constellation.i
new file mode 100644
index 000000000..7e0ad6afe
--- /dev/null
+++ b/gr-digital/swig/digital_constellation.i
@@ -0,0 +1,189 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%template(gr_complex_vector) std::vector<gr_complex>;
+%template(unsigned_int_vector) std::vector<unsigned int>;
+
+// Make sure metric types get SWIGed.
+%include "digital_metric_type.h"
+
+class digital_constellation;
+typedef boost::shared_ptr<digital_constellation> digital_constellation_sptr;
+%template(digital_constellation_sptr) boost::shared_ptr<digital_constellation>;
+
+class digital_constellation
+{
+public:
+ digital_constellation (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality);
+ std::vector<gr_complex> points();
+ std::vector<gr_complex> s_points();
+ std::vector<std::vector<gr_complex> > v_points();
+ virtual unsigned int decision_maker (gr_complex *sample) = 0;
+ unsigned int decision_maker_v (std::vector<gr_complex> sample);
+ // void calc_metric(gr_complex *sample, float *metric, trellis_metric_type_t type);
+ // void calc_euclidean_metric(gr_complex *sample, float *metric);
+ // void calc_hard_symbol_metric(gr_complex *sample, float *metric);
+ std::vector<gr_complex> map_to_points_v(unsigned int value);
+ unsigned int bits_per_symbol ();
+ unsigned int arity ();
+ digital_constellation_sptr base ();
+ bool apply_pre_diff_code();
+ void set_pre_diff_code(bool a);
+ std::vector<unsigned int> pre_diff_code();
+ unsigned int rotational_symmetry();
+ unsigned int dimensionality();
+};
+
+class digital_constellation_calcdist;
+typedef boost::shared_ptr<digital_constellation_calcdist> digital_constellation_calcdist_sptr;
+%template(digital_constellation_calcdist_sptr) boost::shared_ptr<digital_constellation_calcdist>;
+%rename(constellation_calcdist) digital_make_constellation_calcdist;
+digital_constellation_calcdist_sptr
+digital_make_constellation_calcdist(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality);
+%ignore digital_constellation_calcdist;
+
+class digital_constellation_calcdist: public digital_constellation
+{
+ public:
+ digital_constellation_calcdist (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int dimensionality);
+ unsigned int decision_maker (const gr_complex *sample);
+};
+
+class digital_constellation_sector: public digital_constellation
+{
+};
+
+class digital_constellation_rect;
+typedef boost::shared_ptr<digital_constellation_rect> digital_constellation_rect_sptr;
+%template(digital_constellation_rect_sptr) boost::shared_ptr<digital_constellation_rect>;
+%rename(constellation_rect) digital_make_constellation_rect;
+digital_constellation_rect_sptr digital_make_constellation_rect(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors, unsigned int imag_sectors,
+ float width_real_sectors, float width_imag_sectors);
+%ignore digital_constellation_rect;
+
+class digital_constellation_rect : public digital_constellation_sector
+{
+public:
+ digital_constellation_rect (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int rotational_symmetry,
+ unsigned int real_sectors, unsigned int imag_sectors,
+ float width_real_sectors, float width_imag_sectors);
+};
+
+class digital_constellation_psk;
+typedef boost::shared_ptr<digital_constellation_psk> digital_constellation_psk_sptr;
+%template(digital_constellation_psk_sptr) boost::shared_ptr<digital_constellation_psk>;
+%rename(constellation_psk) digital_make_constellation_psk;
+digital_constellation_psk_sptr digital_make_constellation_psk(std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors);
+%ignore digital_constellation_psk;
+
+class digital_constellation_psk : public digital_constellation_sector
+{
+public:
+ digital_constellation_psk (std::vector<gr_complex> constellation,
+ std::vector<unsigned int> pre_diff_code,
+ unsigned int n_sectors);
+};
+
+/*
+ BPSK Constellation
+*/
+
+class digital_constellation_bpsk;
+typedef boost::shared_ptr<digital_constellation_bpsk> digital_constellation_bpsk_sptr;
+%template(digital_constellation_bpsk_sptr) boost::shared_ptr<digital_constellation_bpsk>;
+%rename(constellation_bpsk) digital_make_constellation_bpsk;
+digital_constellation_bpsk_sptr digital_make_constellation_bpsk();
+%ignore digital_constellation_bpsk;
+
+class digital_constellation_bpsk : public digital_constellation
+{
+public:
+ digital_constellation_bpsk ();
+};
+
+/*
+ QPSK Constellation
+*/
+
+class digital_constellation_qpsk;
+typedef boost::shared_ptr<digital_constellation_qpsk> digital_constellation_qpsk_sptr;
+%template(digital_constellation_qpsk_sptr) boost::shared_ptr<digital_constellation_qpsk>;
+%rename(constellation_qpsk) digital_make_constellation_qpsk;
+digital_constellation_qpsk_sptr digital_make_constellation_qpsk();
+%ignore digital_constellation_qpsk;
+
+class digital_constellation_qpsk : public digital_constellation
+{
+public:
+ digital_constellation_qpsk ();
+};
+
+/*
+ DQPSK Constellation
+*/
+
+class digital_constellation_dqpsk;
+typedef boost::shared_ptr<digital_constellation_dqpsk> digital_constellation_dqpsk_sptr;
+%template(digital_constellation_dqpsk_sptr) boost::shared_ptr<digital_constellation_dqpsk>;
+%rename(constellation_dqpsk) digital_make_constellation_dqpsk;
+digital_constellation_dqpsk_sptr digital_make_constellation_dqpsk();
+%ignore digital_constellation_dqpsk;
+
+class digital_constellation_dqpsk : public digital_constellation
+{
+public:
+ digital_constellation_dqpsk ();
+};
+
+
+/*
+ 8PSK Constellation
+*/
+
+class digital_constellation_8psk;
+typedef boost::shared_ptr<digital_constellation_8psk> digital_constellation_8psk_sptr;
+%template(digital_constellation_8psk_sptr) boost::shared_ptr<digital_constellation_8psk>;
+%rename(constellation_8psk) digital_make_constellation_8psk;
+digital_constellation_8psk_sptr digital_make_constellation_8psk();
+%ignore digital_constellation_8psk;
+
+class digital_constellation_8psk : public digital_constellation
+{
+public:
+ digital_constellation_8psk ();
+};
diff --git a/gr-digital/swig/digital_constellation_decoder_cb.i b/gr-digital/swig/digital_constellation_decoder_cb.i
new file mode 100644
index 000000000..53d3fe8e0
--- /dev/null
+++ b/gr-digital/swig/digital_constellation_decoder_cb.i
@@ -0,0 +1,38 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(digital,constellation_decoder_cb)
+
+digital_constellation_decoder_cb_sptr
+digital_make_constellation_decoder_cb (digital_constellation_sptr constellation);
+
+class digital_constellation_decoder_cb : public gr_sync_block
+{
+ private:
+ digital_constellation_decoder_cb (digital_constellation_sptr constellation);
+
+ friend digital_constellation_decoder_cb_sptr
+ gr_make_constellation_decoder_cb (digital_constellation_sptr constellation);
+
+ public:
+ ~digital_constellation_decoder_cb();
+};
diff --git a/gnuradio-core/src/lib/general/gr_costas_loop_cc.i b/gr-digital/swig/digital_constellation_receiver_cb.i
index 488cab370..9c4ba645e 100644
--- a/gnuradio-core/src/lib/general/gr_costas_loop_cc.i
+++ b/gr-digital/swig/digital_constellation_receiver_cb.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2006 Free Software Foundation, Inc.
+ * Copyright 2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,25 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,costas_loop_cc);
+GR_SWIG_BLOCK_MAGIC(digital,constellation_receiver_cb);
-gr_costas_loop_cc_sptr
-gr_make_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq,
- int order
- ) throw (std::invalid_argument);
+%include "digital_constellation.i"
+digital_constellation_receiver_cb_sptr
+digital_make_constellation_receiver_cb (digital_constellation_sptr constellation,
+ float loop_bw, float fmin, float fmax);
-class gr_costas_loop_cc : public gr_sync_block
+class digital_constellation_receiver_cb : public gr_block, public gri_control_loop
{
private:
- gr_costas_loop_cc (float alpha, float beta,
- float max_freq, float min_freq, int order);
-
- public:
- void set_alpha(float alpha);
- float alpha();
- void set_beta(float beta);
- float beta();
- float freq();
+ digital_constellation_receiver_cb (digital_contellation_sptr constellation,
+ float loop_bw, float fmin, float fmax);
};
diff --git a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.i b/gr-digital/swig/digital_correlate_access_code_bb.i
index bec4282f1..01087b8e9 100644
--- a/gnuradio-core/src/lib/general/gr_correlate_access_code_bb.i
+++ b/gr-digital/swig/digital_correlate_access_code_bb.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,14 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,correlate_access_code_bb);
+GR_SWIG_BLOCK_MAGIC(digital,correlate_access_code_bb);
/*!
* \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
* \param threshold maximum number of bits that may be wrong
*/
-gr_correlate_access_code_bb_sptr
-gr_make_correlate_access_code_bb (const std::string &access_code, int threshold)
+digital_correlate_access_code_bb_sptr
+digital_make_correlate_access_code_bb (const std::string &access_code, int threshold)
throw(std::out_of_range);
/*!
@@ -43,15 +43,15 @@ gr_make_correlate_access_code_bb (const std::string &access_code, int threshold)
* flag bit and is 1 if the corresponding data bit is the first data
* bit following the access code. Otherwise the flag bit is 0.
*/
-class gr_correlate_access_code_bb : public gr_sync_block
+class digital_correlate_access_code_bb : public gr_sync_block
{
- friend gr_correlate_access_code_bb_sptr
- gr_make_correlate_access_code_bb (const std::string &access_code, int threshold);
+ friend digital_correlate_access_code_bb_sptr
+ digital_make_correlate_access_code_bb (const std::string &access_code, int threshold);
protected:
- gr_correlate_access_code_bb(const std::string &access_code, int threshold);
+ digital_correlate_access_code_bb(const std::string &access_code, int threshold);
public:
- ~gr_correlate_access_code_bb();
+ ~digital_correlate_access_code_bb();
/*!
* \param access_code is represented with 1 byte per bit, e.g., "010101010111000100"
diff --git a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.i b/gr-digital/swig/digital_costas_loop_cc.i
index 3ca488b52..ab09200a0 100644
--- a/gnuradio-core/src/lib/general/gr_lms_dfe_ff.i
+++ b/gr-digital/swig/digital_costas_loop_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2006,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,15 +20,14 @@
* Boston, MA 02110-1301, USA.
*/
+GR_SWIG_BLOCK_MAGIC(digital,costas_loop_cc);
-GR_SWIG_BLOCK_MAGIC(gr,lms_dfe_ff)
+digital_costas_loop_cc_sptr
+digital_make_costas_loop_cc (float loop_bw, int order
+ ) throw (std::invalid_argument);
-gr_lms_dfe_ff_sptr gr_make_lms_dfe_ff (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
-
-class gr_lms_dfe_ff : public gr_sync_block
+class digital_costas_loop_cc : public gr_sync_block, public gri_control_loop
{
private:
- gr_lms_dfe_ff (float lambda_ff, float lambda_fb,
- unsigned int num_fftaps, unsigned int num_fbtaps);
+ digital_costas_loop_cc (float loop_bw, int order);
};
diff --git a/gr-digital/swig/digital_cpmmod_bc.i b/gr-digital/swig/digital_cpmmod_bc.i
new file mode 100644
index 000000000..fa7c50da7
--- /dev/null
+++ b/gr-digital/swig/digital_cpmmod_bc.i
@@ -0,0 +1,40 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(digital, cpmmod_bc)
+
+digital_cpmmod_bc_sptr
+digital_make_cpmmod_bc(int type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta=0.3);
+
+class digital_cpmmod_bc : public gr_hier_block2
+{
+ private:
+ digital_cpmmod_bc(int type, float h,
+ unsigned samples_per_sym,
+ unsigned L, double beta);
+
+ public:
+ std::vector<float> get_taps();
+};
+
diff --git a/gr-digital/swig/digital_crc32.i b/gr-digital/swig/digital_crc32.i
new file mode 100644
index 000000000..806bfad6a
--- /dev/null
+++ b/gr-digital/swig/digital_crc32.i
@@ -0,0 +1,27 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005,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.
+ */
+
+%rename(update_crc32) digital_update_crc32;
+%rename(crc32) digital_crc32;
+
+unsigned int digital_update_crc32(unsigned int crc, const std::string buf);
+unsigned int digital_crc32(const std::string buf);
diff --git a/gr-digital/swig/digital_fll_band_edge_cc.i b/gr-digital/swig/digital_fll_band_edge_cc.i
new file mode 100644
index 000000000..3efcb89ed
--- /dev/null
+++ b/gr-digital/swig/digital_fll_band_edge_cc.i
@@ -0,0 +1,60 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2009,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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(digital,fll_band_edge_cc);
+
+digital_fll_band_edge_cc_sptr digital_make_fll_band_edge_cc (float samps_per_sym,
+ float rolloff,
+ int filter_size,
+ float bandwidth);
+
+class digital_fll_band_edge_cc : public gr_sync_block, public gri_control_loop
+{
+ private:
+ digital_fll_band_edge_cc (float samps_per_sym, float rolloff,
+ int filter_size, float bandwidth);
+
+ public:
+ ~digital_fll_band_edge_cc ();
+
+ void set_loop_bandwidth(float bw);
+ void set_damping_factor(float df);
+ void set_alpha(float alpha);
+ void set_beta(float beta);
+ void set_samples_per_symbol(float sps);
+ void set_rolloff(float rolloff);
+ void set_filter_size(int filter_size);
+ void set_frequency(float freq);
+ void set_phase(float phase);
+
+ float get_loop_bandwidth() const;
+ float get_damping_factor() const;
+ float get_alpha() const;
+ float get_beta() const;
+ float get_samples_per_symbol() const;
+ float get_rolloff() const;
+ int get_filter_size() const;
+ float get_frequency() const;
+ float get_phase() const;
+
+ void print_taps();
+};
diff --git a/gr-digital/swig/digital_gmskmod_bc.i b/gr-digital/swig/digital_gmskmod_bc.i
new file mode 100644
index 000000000..ad7b82237
--- /dev/null
+++ b/gr-digital/swig/digital_gmskmod_bc.i
@@ -0,0 +1,39 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2010 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.
+ */
+
+GR_SWIG_BLOCK_MAGIC(digital, gmskmod_bc)
+
+digital_gmskmod_bc_sptr
+digital_make_gmskmod_bc(unsigned samples_per_sym=2,
+ double bt=0.3, unsigned L=4);
+
+class digital_gmskmod_bc : public gr_hier_block2
+{
+ private:
+ digital_cpmmod_bc(int type, float h,
+ unsigned samples_per_sym,
+ double beta, unsigned L);
+
+ public:
+ std::vector<float> get_taps();
+};
+
diff --git a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.i b/gr-digital/swig/digital_kurtotic_equalizer_cc.i
index 30e2fb8bd..67a9dc6fd 100644
--- a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.i
+++ b/gr-digital/swig/digital_kurtotic_equalizer_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2006,2009 Free Software Foundation, Inc.
+ * Copyright 2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,18 +20,21 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,cma_equalizer_cc)
+GR_SWIG_BLOCK_MAGIC(digital,kurtotic_equalizer_cc)
// retrieve info on the base class, without generating wrappers since
// the base class has a pure virual method.
-%import "gr_adaptive_fir_ccf.i"
+%import "gr_adaptive_fir_ccc.i"
-gr_cma_equalizer_cc_sptr gr_make_cma_equalizer_cc(int num_taps, float modulus, float mu);
+digital_kurtotic_equalizer_cc_sptr
+digital_make_kurtotic_equalizer_cc(int num_taps,
+ float mu);
-class gr_cma_equalizer_cc : public gr_adaptive_fir_ccf
+class digital_kurtotic_equalizer_cc : public gr_adaptive_fir_ccc
{
private:
- gr_cma_equalizer_cc(int num_taps, float modulus, float mu);
+ digital_kurtotic_equalizer_cc(int num_taps, float mu);
public:
+ void set_gain(float mu);
};
diff --git a/gr-digital/swig/digital_lms_dd_equalizer_cc.i b/gr-digital/swig/digital_lms_dd_equalizer_cc.i
new file mode 100644
index 000000000..bd5c6ae29
--- /dev/null
+++ b/gr-digital/swig/digital_lms_dd_equalizer_cc.i
@@ -0,0 +1,46 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+
+GR_SWIG_BLOCK_MAGIC(digital,lms_dd_equalizer_cc)
+
+// retrieve info on the base class, without generating wrappers since
+// the base class has a pure virual method.
+%import "gr_adaptive_fir_ccc.i"
+
+
+digital_lms_dd_equalizer_cc_sptr
+digital_make_lms_dd_equalizer_cc (int num_taps,
+ float mu, int sps,
+ digital_constellation_sptr cnst);
+
+class digital_lms_dd_equalizer_cc : public gr_sync_block
+{
+private:
+ digital_lms_dd_equalizer_cc (int num_taps,
+ float mu, int sps,
+ digital_constellation_sptr cnst);
+
+public:
+ float get_gain();
+ void set_gain(float mu);
+};
diff --git a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.i b/gr-digital/swig/digital_mpsk_receiver_cc.i
index 88cb43e04..b51411f6f 100644
--- a/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.i
+++ b/gr-digital/swig/digital_mpsk_receiver_cc.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004 Free Software Foundation, Inc.
+ * Copyright 2004,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -20,21 +20,22 @@
* Boston, MA 02110-1301, USA.
*/
-GR_SWIG_BLOCK_MAGIC(gr,mpsk_receiver_cc);
+GR_SWIG_BLOCK_MAGIC(digital,mpsk_receiver_cc);
-gr_mpsk_receiver_cc_sptr gr_make_mpsk_receiver_cc (unsigned int M, float theta,
- float alpha, float beta,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
-class gr_mpsk_receiver_cc : public gr_block
+digital_mpsk_receiver_cc_sptr digital_make_mpsk_receiver_cc (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);
+class digital_mpsk_receiver_cc : public gr_block, public gri_control_loop
{
private:
- gr_mpsk_receiver_cc (unsigned int M,float theta,
- float alpha, float beta,
- float fmin, float fmax,
- float mu, float gain_mu,
- float omega, float gain_omega, float omega_rel);
+ digital_mpsk_receiver_cc (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);
public:
float mu() const { return d_mu;}
float omega() const { return d_omega;}
@@ -48,12 +49,4 @@ public:
}
void set_gain_mu (float gain_mu) { d_gain_mu = gain_mu; }
void set_gain_omega (float gain_omega) { d_gain_omega = gain_omega; }
- float alpha() const { return d_alpha; }
- float beta() const { return d_beta; }
- float freq() const { return d_freq; }
- float phase() const { return d_phase; }
- void set_alpha(float alpha) { d_alpha = alpha; }
- void set_beta(float beta) { d_beta = beta; }
- void set_freq(float freq) { d_freq = freq; }
- void set_phase(float phase) { d_phase = phase; }
};
diff --git a/gr-digital/swig/digital_swig.i b/gr-digital/swig/digital_swig.i
new file mode 100644
index 000000000..2e3a3242e
--- /dev/null
+++ b/gr-digital/swig/digital_swig.i
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%include "gnuradio.i"
+
+%include <gri_control_loop.i>
+
+%{
+#include "digital_binary_slicer_fb.h"
+#include "digital_clock_recovery_mm_cc.h"
+#include "digital_clock_recovery_mm_ff.h"
+#include "digital_cma_equalizer_cc.h"
+#include "digital_constellation.h"
+#include "digital_constellation_decoder_cb.h"
+#include "digital_constellation_receiver_cb.h"
+#include "digital_correlate_access_code_bb.h"
+#include "digital_costas_loop_cc.h"
+#include "digital_crc32.h"
+#include "digital_fll_band_edge_cc.h"
+#include "digital_kurtotic_equalizer_cc.h"
+#include "digital_lms_dd_equalizer_cc.h"
+#include "digital_mpsk_receiver_cc.h"
+#include "digital_cpmmod_bc.h"
+#include "digital_gmskmod_bc.h"
+%}
+
+%include "digital_binary_slicer_fb.i"
+%include "digital_clock_recovery_mm_cc.i"
+%include "digital_clock_recovery_mm_ff.i"
+%include "digital_cma_equalizer_cc.i"
+%include "digital_constellation.i"
+%include "digital_constellation_decoder_cb.i"
+%include "digital_constellation_receiver_cb.i"
+%include "digital_correlate_access_code_bb.i"
+%include "digital_costas_loop_cc.i"
+%include "digital_crc32.i"
+%include "digital_fll_band_edge_cc.i"
+%include "digital_kurtotic_equalizer_cc.i"
+%include "digital_lms_dd_equalizer_cc.i"
+%include "digital_mpsk_receiver_cc.i"
+%include "digital_cpmmod_bc.i"
+%include "digital_gmskmod_bc.i"
+
+#if SWIGGUILE
+%scheme %{
+(load-extension-global "libguile-gnuradio-digital_swig" "scm_init_gnuradio_digital_swig_module")
+%}
+
+%goops %{
+(use-modules (gnuradio gnuradio_core_runtime))
+%}
+#endif
diff --git a/gr-digital/swig/gnuradio/.gitignore b/gr-digital/swig/gnuradio/.gitignore
new file mode 100644
index 000000000..c264c571a
--- /dev/null
+++ b/gr-digital/swig/gnuradio/.gitignore
@@ -0,0 +1,2 @@
+digital_swig-primitive.scm
+digital_swig.scm
diff --git a/gr-digital/swig/gnuradio/digital.scm b/gr-digital/swig/gnuradio/digital.scm
new file mode 100644
index 000000000..834bc8d6d
--- /dev/null
+++ b/gr-digital/swig/gnuradio/digital.scm
@@ -0,0 +1,28 @@
+;;;
+;;; 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 this program. If not, see <http://www.gnu.org/licenses/>.
+;;;
+
+;;; Module that just re-exports the digital_swig module
+
+(define-module (gnuradio digital)
+ #:use-module (gnuradio export-safely)
+ #:use-module (gnuradio digital_swig)
+ #:duplicates (merge-generics replace check))
+
+(re-export-all '(gnuradio digital_swig))
+
diff --git a/gr-digital/swig/run_guile_tests.in b/gr-digital/swig/run_guile_tests.in
new file mode 100644
index 000000000..5d08b0dd5
--- /dev/null
+++ b/gr-digital/swig/run_guile_tests.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+. @top_builddir@/setup_guile_test_env
+
+# 1st argument is absolute path to hand coded guile source directory
+# 2nd argument is absolute path to component C++ shared library build directory
+# 3nd argument is absolute path to component SWIG build directory
+
+add_local_paths \
+ @srcdir@ \
+ @abs_builddir@ \
+ @abs_builddir@
+
+@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@
diff --git a/gr-gcell/.gitignore b/gr-gcell/.gitignore
deleted file mode 100644
index 53edad32f..000000000
--- a/gr-gcell/.gitignore
+++ /dev/null
@@ -1,32 +0,0 @@
-/*.cache
-/*.la
-/*.lo
-/*.pc
-/.deps
-/.la
-/.libs
-/.lo
-/Makefile
-/Makefile.in
-/aclocal.m4
-/autom4te.cache
-/config.cache
-/config.h
-/config.h.in
-/config.log
-/config.status
-/configure
-/depcomp
-/install-sh
-/libtool
-/ltmain.sh
-/make.log
-/missing
-/missing
-/mkinstalldirs
-/py-compile
-/stamp-h
-/stamp-h.in
-/stamp-h1
-/stamp-h1.in
-/stamp-h2.in
diff --git a/gr-gcell/Makefile.am b/gr-gcell/Makefile.am
deleted file mode 100644
index 2386f80ae..000000000
--- a/gr-gcell/Makefile.am
+++ /dev/null
@@ -1,24 +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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = src
-
diff --git a/gr-gcell/src/.gitignore b/gr-gcell/src/.gitignore
deleted file mode 100644
index bea05149a..000000000
--- a/gr-gcell/src/.gitignore
+++ /dev/null
@@ -1,39 +0,0 @@
-/*.cache
-/*.la
-/*.lo
-/*.pc
-/.deps
-/.la
-/.libs
-/.lo
-/Makefile
-/Makefile.in
-/aclocal.m4
-/autom4te.cache
-/config.cache
-/config.h
-/config.h.in
-/config.log
-/config.status
-/configure
-/depcomp
-/install-sh
-/libtool
-/ltmain.sh
-/make.log
-/missing
-/missing
-/mkinstalldirs
-/py-compile
-/stamp-h
-/stamp-h.in
-/stamp-h1
-/stamp-h1.in
-/stamp-h2.in
-/run_tests
-/gcell.d
-/gcell.cc
-/gcell.py
-/gnuradio
-/guile
-/python
diff --git a/gr-gcell/src/Makefile.am b/gr-gcell/src/Makefile.am
deleted file mode 100644
index dfbd8f828..000000000
--- a/gr-gcell/src/Makefile.am
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# Copyright 2008,2009,2010 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.
-#
-
-include $(top_srcdir)/Makefile.common
-include $(top_srcdir)/Makefile.swig
-
-TESTS =
-EXTRA_DIST += run_tests.in
-DISTCLEANFILES += run_tests
-
-SUBDIRS = . examples
-
-AM_CPPFLAGS = $(GCELL_INCLUDES) $(STD_DEFINES_AND_INCLUDES) \
- $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
-
-# ----------------------------------------------------------------
-
-noinst_PYTHON = \
- qa_fft.py
-
-
-# ----------------------------------------------------------------
-# The C++ blocks
-# ----------------------------------------------------------------
-
-# the library for the C++ blocks
-lib_LTLIBRARIES = libgnuradio_gcell.la
-
-libgnuradio_gcell_la_SOURCES = \
- gcell_fft_vcc.cc
-
-# C/C++ headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS = \
- gcell_fft_vcc.h
-
-libgnuradio_gcell_la_LIBADD = \
- $(GNURADIO_CORE_LA) \
- $(GCELL_LA)
-
-libgnuradio_gcell_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-# ----------------------------------------------------------------
-# SWIG stuff
-# ----------------------------------------------------------------
-
-TOP_SWIG_IFILES = \
- gcell.i
-
-# Install so that they end up available as:
-# import gnuradio.gcell
-# This ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio
-gcell_pythondir_category = \
- gnuradio
-
-# additional arguments to the SWIG command
-gcell_swig_args = \
- $(GCELL_INCLUDES)
-
-# additional libraries for linking with the SWIG-generated library
-gcell_la_swig_libadd = \
- libgnuradio_gcell.la
-
-# additional SWIG files to be installed
-gcell_swiginclude_headers = \
- gc_job_manager.i \
- gcell_fft_vcc.i
-
-
-if PYTHON
-TESTS += run_tests
-endif
diff --git a/gr-gcell/src/examples/.gitignore b/gr-gcell/src/examples/.gitignore
deleted file mode 100644
index 53edad32f..000000000
--- a/gr-gcell/src/examples/.gitignore
+++ /dev/null
@@ -1,32 +0,0 @@
-/*.cache
-/*.la
-/*.lo
-/*.pc
-/.deps
-/.la
-/.libs
-/.lo
-/Makefile
-/Makefile.in
-/aclocal.m4
-/autom4te.cache
-/config.cache
-/config.h
-/config.h.in
-/config.log
-/config.status
-/configure
-/depcomp
-/install-sh
-/libtool
-/ltmain.sh
-/make.log
-/missing
-/missing
-/mkinstalldirs
-/py-compile
-/stamp-h
-/stamp-h.in
-/stamp-h1
-/stamp-h1.in
-/stamp-h2.in
diff --git a/gr-gcell/src/gc_job_manager.i b/gr-gcell/src/gc_job_manager.i
deleted file mode 100644
index 7bec48e19..000000000
--- a/gr-gcell/src/gc_job_manager.i
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-struct spe_program_handle_t;
-typedef boost::shared_ptr<spe_program_handle_t> spe_program_handle_sptr;
-%template(spe_program_handle_sptr) boost::shared_ptr<spe_program_handle_t>;
-
-class gc_job_manager;
-typedef boost::shared_ptr<gc_job_manager> gc_job_manager_sptr;
-%template(gc_job_manager_sptr) boost::shared_ptr<gc_job_manager>;
-
-
-%rename(program_handle_from_filename) gc_program_handle_from_filename;
-spe_program_handle_sptr
-gc_program_handle_from_filename(const std::string &filename);
-
-%rename(program_handle_from_address) gc_program_handle_from_address;
-spe_program_handle_sptr
-gc_program_handle_from_address(spe_program_handle_t *handle);
-
-
-%rename(jm_options) gc_jm_options;
-struct gc_jm_options {
- unsigned int max_jobs; // max # of job descriptors in system
- unsigned int max_client_threads; // max # of client threads of job manager
- unsigned int nspes; // how many SPEs shall we use? 0 -> all of them
- bool gang_schedule; // shall we gang schedule?
- bool use_affinity; // shall we try for affinity (FIXME not implmented)
- bool enable_logging; // shall we log SPE events?
- uint32_t log2_nlog_entries; // log2 of number of log entries (default is 12 == 4k)
- spe_program_handle_sptr program_handle; // program to load into SPEs
-
- gc_jm_options(spe_program_handle_sptr program_handle_,
- unsigned int nspes_ = 0) :
- max_jobs(0), max_client_threads(0), nspes(nspes_),
- gang_schedule(false), use_affinity(false),
- enable_logging(false), log2_nlog_entries(12),
- program_handle(program_handle_)
- {
- }
-};
-
-%rename(job_manager) gc_make_job_manager;
-gc_job_manager_sptr
-gc_make_job_manager(const gc_jm_options *options);
-
-%inline {
- void set_singleton(gc_job_manager_sptr mgr)
- {
- gc_job_manager::set_singleton(mgr);
- }
-
- gc_job_manager_sptr singleton()
- {
- return gc_job_manager::singleton();
- }
-}
diff --git a/gr-gcell/src/gcell.i b/gr-gcell/src/gcell.i
deleted file mode 100644
index 7437b9d4e..000000000
--- a/gr-gcell/src/gcell.i
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-%include "gnuradio.i" // the common stuff
-
-%{
-#include <gcell/gc_job_manager.h>
-#include <gcell_fft_vcc.h>
-%}
-
-%include "gc_job_manager.i"
-%include "gcell_fft_vcc.i"
-
-#if SWIGGUILE
-%scheme %{
-(load-extension-global "libguile-gnuradio-gcell" "scm_init_gnuradio_gcell_module")
-%}
-
-%goops %{
-(use-modules (gnuradio gnuradio_core_runtime))
-%}
-#endif
diff --git a/gr-gcell/src/gcell_fft_vcc.cc b/gr-gcell/src/gcell_fft_vcc.cc
deleted file mode 100644
index ae40b6fad..000000000
--- a/gr-gcell/src/gcell_fft_vcc.cc
+++ /dev/null
@@ -1,160 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,2007,2008,2010 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 <gcell_fft_vcc.h>
-#include <gr_io_signature.h>
-#include <gcell/gc_job_manager.h>
-#include <gcell/gc_aligned_alloc.h>
-#include <gcell/gcp_fft_1d_r2.h>
-#include <math.h>
-#include <assert.h>
-#include <stdexcept>
-#include <string.h>
-
-
-#define MIN_FFT_SIZE 32
-#define MAX_FFT_SIZE 4096
-
-inline static bool
-is_power_of_2(int x)
-{
- return x != 0 && (x & (x-1)) == 0;
-}
-
-static int
-int_log2(int x) // x is an exact power of 2
-{
- for (int i = 0; i < 32; i++)
- if (x == (1 << i))
- return i;
-
- assert(0);
-}
-
-#if 0
-gr_fft_vcc_sptr
-gcell_make_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift)
-{
- // If it doesn't meet our constraints, use standard implemenation
- if (fft_size < MIN_FFT_SIZE || fft_size > MAX_FFT_SIZE
- || !is_power_of_2(fft_size)
- || (window.size() != 0 && fft_size > MAX_FFT_SIZE/2))
- return gr_make_fft_vcc(fft_size, forward, window, shift);
- else
- return gr_fft_vcc_sptr (new gcell_fft_vcc(fft_size, forward, window, shift));
-}
-#else
-
-gcell_fft_vcc_sptr
-gcell_make_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift)
-{
- return gnuradio::get_initial_sptr(new gcell_fft_vcc(fft_size, forward, window, shift));
-}
-
-#endif
-
-gcell_fft_vcc::gcell_fft_vcc (int fft_size, bool forward,
- const std::vector<float> &window, bool shift)
- : gr_fft_vcc("gcell_fft_vcc", fft_size, forward, window, shift)
-{
- if (fft_size < MIN_FFT_SIZE || fft_size > MAX_FFT_SIZE || !is_power_of_2(fft_size)){
- throw std::invalid_argument("fft_size");
- }
-
- if (window.size() != 0 && fft_size > MAX_FFT_SIZE/2){
- throw std::invalid_argument("fft_size too big to use window");
- }
-
- d_log2_fft_size = int_log2(fft_size);
- d_mgr = gc_job_manager::singleton(); // grab the singleton job manager
- d_twiddle_boost = gc_aligned_alloc_sptr(sizeof(std::complex<float>) * fft_size/4, 128);
- d_twiddle = (std::complex<float>*) d_twiddle_boost.get();
- gcp_fft_1d_r2_twiddle(d_log2_fft_size, d_twiddle);
-}
-
-gcell_fft_vcc::~gcell_fft_vcc ()
-{
-}
-
-int
-gcell_fft_vcc::work(int noutput_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];
-
- // unsigned int input_data_size = input_signature()->sizeof_stream_item(0);
- // unsigned int output_data_size = output_signature()->sizeof_stream_item(0);
-
- float window_buf[MAX_FFT_SIZE/2] __attribute__((aligned (16)));
- float *window = 0;
-
- // If we've got a window, ensure it's 16-byte aligned
- // FIXME move this to set_window
- if (d_window.size()){
- if ((((intptr_t)&d_window[0]) & 0xf) == 0)
- window = &d_window[0]; // OK as is
- else {
- window = window_buf; // copy to aligned buffer
- memcpy(window, &d_window[0], sizeof(float) * d_window.size());
- }
- }
-
- std::vector<gc_job_desc_sptr> jd_sptr(noutput_items);
- gc_job_desc *jd[noutput_items];
- bool done[noutput_items];
-
- // submit noutput_items jobs in parallel
-
- for (int i = 0; i < noutput_items; i++){
- jd_sptr[i] = gcp_fft_1d_r2_submit(d_mgr, d_log2_fft_size,
- d_forward, d_shift,
- &out[i * d_fft_size],
- &in[i * d_fft_size],
- d_twiddle,
- window);
- jd[i] = jd_sptr[i].get();
- }
-
- int n = d_mgr->wait_jobs(noutput_items, jd, done, GC_WAIT_ALL);
- if (n != noutput_items){
- fprintf(stderr, "gcell_fft_vcc: wait_jobs returned %d, expected %d\n",
- n, noutput_items);
- return -1;
- }
-
- for (int i = 0; i < noutput_items; i++){
- if (jd[i]->status != JS_OK){
- fprintf(stderr, "gcell_fft_vcc jd[%d]->status = %s\n",
- i, gc_job_status_string(jd[i]->status).c_str());
- return -1;
- }
- }
-
- return noutput_items;
-}
-
diff --git a/gr-gcell/src/gcell_fft_vcc.h b/gr-gcell/src/gcell_fft_vcc.h
deleted file mode 100644
index 9e3035b44..000000000
--- a/gr-gcell/src/gcell_fft_vcc.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,2007,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.
- */
-
-#ifndef INCLUDED_GCELL_FFT_VCC_H
-#define INCLUDED_GCELL_FFT_VCC_H
-
-#include <gr_fft_vcc.h>
-
-class gc_job_manager;
-
-class gcell_fft_vcc;
-typedef boost::shared_ptr<gcell_fft_vcc> gcell_fft_vcc_sptr;
-
-gcell_fft_vcc_sptr
-gcell_make_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift=false);
-
-/*!
- * \brief Compute forward or reverse FFT. complex vector in / complex vector out.
- * \ingroup dft_blk
- * \ingroup gcell
- *
- * Concrete class that uses gcell to offload FFT to SPEs.
- */
-class gcell_fft_vcc : public gr_fft_vcc
-{
- int d_log2_fft_size;
- boost::shared_ptr<gc_job_manager> d_mgr;
- std::complex<float> *d_twiddle; // twiddle values (16-byte aligned)
- boost::shared_ptr<void> d_twiddle_boost; // automatic storage mgmt
-
- friend gcell_fft_vcc_sptr
- gcell_make_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift);
-
- gcell_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift);
-
- public:
- ~gcell_fft_vcc();
-
- int work(int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-};
-
-
-#endif /* INCLUDED_GCELL_FFT_VCC_H */
diff --git a/gr-gcell/src/gcell_fft_vcc.i b/gr-gcell/src/gcell_fft_vcc.i
deleted file mode 100644
index 1d4a359f9..000000000
--- a/gr-gcell/src/gcell_fft_vcc.i
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#if 1
-
-// This version works.
-
-GR_SWIG_BLOCK_MAGIC(gcell, fft_vcc)
-
-gcell_fft_vcc_sptr
-gcell_make_fft_vcc (int fft_size, bool forward, const std::vector<float> window, bool shift=false);
-
-class gcell_fft_vcc : public gr_sync_block
-{
- protected:
- gcell_fft_vcc (int fft_size, bool forward, const std::vector<float> &window, bool shift);
-
- public:
- bool set_window(const std::vector<float> &window);
-};
-
-#else
-
-// This version gives swig heartburn. We end up with an object that's
-// not quite usable.
-
-GR_SWIG_BLOCK_MAGIC(gcell, fft_vcc);
-
-gcell_fft_vcc_sptr
-gcell_make_fft_vcc (int fft_size, bool forward, const std::vector<float> window, bool shift=false);
-
-class gcell_fft_vcc : public gr_fft_vcc
-{
- protected:
- gr_fft_vcc(int fft_size, bool forward, const std::vector<float> &window, bool shift);
-};
-
-#endif
diff --git a/gr-gcell/src/qa_fft.py b/gr-gcell/src/qa_fft.py
deleted file mode 100755
index 88a4f5207..000000000
--- a/gr-gcell/src/qa_fft.py
+++ /dev/null
@@ -1,162 +0,0 @@
-#!/usr/bin/env python
-#
-# 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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-
-from gnuradio import gr, gr_unittest
-import gcell
-import sys
-import random
-
-primes = (2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,
- 59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,
- 137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,
- 227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311)
-
-
-class test_fft_filter(gr_unittest.TestCase):
-
- def setUp(self):
- ph = gcell.program_handle_from_filename("../../gcell/lib/spu/gcell_all")
- opts = gcell.jm_options(ph, 1)
- self.mgr = gcell.job_manager(opts)
- gcell.set_singleton(self.mgr)
-
- def tearDown(self):
- pass
-
- def assert_fft_ok2(self, expected_result, result_data):
- expected_result = expected_result[:len(result_data)]
- self.assertComplexTuplesAlmostEqual2 (expected_result, result_data,
- abs_eps=1e-9, rel_eps=4e-4)
-
- def assert_fft_float_ok2(self, expected_result, result_data, abs_eps=1e-9, rel_eps=4e-4):
- expected_result = expected_result[:len(result_data)]
- self.assertFloatTuplesAlmostEqual2 (expected_result, result_data,
- abs_eps, rel_eps)
-
- def test_001(self):
- tb = gr.top_block()
- fft_size = 32
- src_data = tuple([complex(primes[2*i], primes[2*i+1]) for i in range(fft_size)])
-
- expected_result = ((4377+4516j),
- (-1706.1268310546875+1638.4256591796875j),
- (-915.2083740234375+660.69427490234375j),
- (-660.370361328125+381.59600830078125j),
- (-499.96044921875+238.41630554199219j),
- (-462.26748657226562+152.88948059082031j),
- (-377.98440551757812+77.5928955078125j),
- (-346.85821533203125+47.152004241943359j),
- (-295+20j),
- (-286.33609008789062-22.257017135620117j),
- (-271.52999877929688-33.081821441650391j),
- (-224.6358642578125-67.019538879394531j),
- (-244.24473571777344-91.524826049804688j),
- (-203.09068298339844-108.54627227783203j),
- (-198.45195007324219-115.90768432617188j),
- (-182.97744750976562-128.12318420410156j),
- (-167-180j),
- (-130.33688354492188-173.83778381347656j),
- (-141.19784545898438-190.28807067871094j),
- (-111.09677124023438-214.48896789550781j),
- (-70.039543151855469-242.41630554199219j),
- (-68.960540771484375-228.30015563964844j),
- (-53.049201965332031-291.47097778320312j),
- (-28.695289611816406-317.64553833007812j),
- (57-300j),
- (45.301143646240234-335.69509887695312j),
- (91.936195373535156-373.32437133789062j),
- (172.09465026855469-439.275146484375j),
- (242.24473571777344-504.47515869140625j),
- (387.81732177734375-666.6788330078125j),
- (689.48553466796875-918.2142333984375j),
- (1646.539306640625-1694.1956787109375j))
-
- src = gr.vector_source_c(src_data)
- s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_size)
- fft = gcell.fft_vcc(fft_size, True, [], False)
- v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_size)
- dst = gr.vector_sink_c()
- tb.connect(src, s2v, fft, v2s, dst)
- tb.run()
- result_data = dst.data()
- #print 'expected:', expected_result
- #print 'results: ', result_data
- #self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5)
- self.assert_fft_ok2(expected_result, result_data)
-
- def test_002(self):
- tb = gr.top_block()
- fft_size = 32
-
- tmp_data = ((4377+4516j),
- (-1706.1268310546875+1638.4256591796875j),
- (-915.2083740234375+660.69427490234375j),
- (-660.370361328125+381.59600830078125j),
- (-499.96044921875+238.41630554199219j),
- (-462.26748657226562+152.88948059082031j),
- (-377.98440551757812+77.5928955078125j),
- (-346.85821533203125+47.152004241943359j),
- (-295+20j),
- (-286.33609008789062-22.257017135620117j),
- (-271.52999877929688-33.081821441650391j),
- (-224.6358642578125-67.019538879394531j),
- (-244.24473571777344-91.524826049804688j),
- (-203.09068298339844-108.54627227783203j),
- (-198.45195007324219-115.90768432617188j),
- (-182.97744750976562-128.12318420410156j),
- (-167-180j),
- (-130.33688354492188-173.83778381347656j),
- (-141.19784545898438-190.28807067871094j),
- (-111.09677124023438-214.48896789550781j),
- (-70.039543151855469-242.41630554199219j),
- (-68.960540771484375-228.30015563964844j),
- (-53.049201965332031-291.47097778320312j),
- (-28.695289611816406-317.64553833007812j),
- (57-300j),
- (45.301143646240234-335.69509887695312j),
- (91.936195373535156-373.32437133789062j),
- (172.09465026855469-439.275146484375j),
- (242.24473571777344-504.47515869140625j),
- (387.81732177734375-666.6788330078125j),
- (689.48553466796875-918.2142333984375j),
- (1646.539306640625-1694.1956787109375j))
-
- src_data = tuple([x/fft_size for x in tmp_data])
-
- expected_result = tuple([complex(primes[2*i], primes[2*i+1]) for i in range(fft_size)])
-
- src = gr.vector_source_c(src_data)
- s2v = gr.stream_to_vector(gr.sizeof_gr_complex, fft_size)
- fft = gcell.fft_vcc(fft_size, False, [], False)
- v2s = gr.vector_to_stream(gr.sizeof_gr_complex, fft_size)
- dst = gr.vector_sink_c()
- tb.connect(src, s2v, fft, v2s, dst)
- tb.run()
- result_data = dst.data()
- #print 'expected:', expected_result
- #print 'results: ', result_data
- #self.assertComplexTuplesAlmostEqual (expected_result, result_data, 5)
- self.assert_fft_ok2(expected_result, result_data)
-
-
-if __name__ == '__main__':
- gr_unittest.main ()
-
diff --git a/gr-gpio/src/Makefile.am b/gr-gpio/src/Makefile.am
deleted file mode 100644
index 5071c2273..000000000
--- a/gr-gpio/src/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright 2007,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.
-#
-
-SUBDIRS = fpga
-if PYTHON
-SUBDIRS += python
-endif
-
diff --git a/gr-gpio/src/fpga/include/Makefile.am b/gr-gpio/src/fpga/include/Makefile.am
deleted file mode 100644
index 3c891e5d6..000000000
--- a/gr-gpio/src/fpga/include/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- common_config_2rxhb_2tx_dig.vh \
- common_config_2rxint_2tx_dig.vh \
- common_config_bottom.vh
diff --git a/gr-gpio/src/fpga/include/common_config_2rxhb_2tx_dig.vh b/gr-gpio/src/fpga/include/common_config_2rxhb_2tx_dig.vh
deleted file mode 100644
index 580082c92..000000000
--- a/gr-gpio/src/fpga/include/common_config_2rxhb_2tx_dig.vh
+++ /dev/null
@@ -1,71 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2006,2007 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// ------------------------------------------------------------
-// If TX_ON is not defined, there is *no* transmit circuitry built
- `define TX_ON
-
-// ------------------------------------------------------------
-// Define 1 and only one of TX_SINGLE, TX_DUAL and TX_QUAD
-// to respectively enable 1, 2 or 4 transmit channels.
-// [Please note that only TX_SINGLE and TX_DUAL are currently valid]
-//`define TX_SINGLE
- `define TX_DUAL
-//`define TX_QUAD
-
-// ------------------------------------------------------------
-// If TX_DIG_ON is defined each transmit channel sends its I lsb and Q lsb to gpio pins
-// The lsb bits of the analog output signal are truncated
- `define TX_DIG_ON
-// ------------------------------------------------------------
-// Define TX_HB_ON to enable the transmit halfband filter
-// [Not implemented]
-//`define TX_HB_ON
-
-// ------------------------------------------------------------
-// IF RX_ON is not defined, there is *no* receive circuitry built
- `define RX_ON
-
-// ------------------------------------------------------------
-// Define 1 and only one of RX_SINGLE, RX_DUAL and RX_QUAD
-// to respectively define 1, 2 or 4 receive channels.
-
-//`define RX_SINGLE
- `define RX_DUAL
-//`define RX_QUAD
-
-// ------------------------------------------------------------
-// Define RX_HB_ON to enable the receive halfband filter
- `define RX_HB_ON
-
-// ------------------------------------------------------------
-// Define RX_NCO_ON to enable the receive Numerical Controlled Osc
- `define RX_NCO_ON
-
-// ------------------------------------------------------------
-// Define RX_CIC_ON to enable the receive Cascaded Integrator Comb filter
- `define RX_CIC_ON
-
-// ------------------------------------------------------------
-// If RX_DIG_ON is defined each receive channel sends has its I lsb and Q lsb replaced by digital input from gpio pins
-// So the analog signals are truncated to 15 bits
- `define RX_DIG_ON
diff --git a/gr-gpio/src/fpga/include/common_config_2rxint_2tx_dig.vh b/gr-gpio/src/fpga/include/common_config_2rxint_2tx_dig.vh
deleted file mode 100644
index 01995543b..000000000
--- a/gr-gpio/src/fpga/include/common_config_2rxint_2tx_dig.vh
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2006,2007 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// ------------------------------------------------------------
-// If TX_ON is not defined, there is *no* transmit circuitry built
- `define TX_ON
-
-// ------------------------------------------------------------
-// Define 1 and only one of TX_SINGLE, TX_DUAL and TX_QUAD
-// to respectively enable 1, 2 or 4 transmit channels.
-// [Please note that only TX_SINGLE and TX_DUAL are currently valid]
-//`define TX_SINGLE
- `define TX_DUAL
-//`define TX_QUAD
-
-// ------------------------------------------------------------
-// If TX_DIG_ON is defined each transmit channel sends its I lsb and Q lsb to gpio pins
-// The lsb bits of the analog output signal are truncated
- `define TX_DIG_ON
-// ------------------------------------------------------------
-// Define TX_HB_ON to enable the transmit halfband filter
-// [Not implemented]
-//`define TX_HB_ON
-
-// ------------------------------------------------------------
-// IF RX_ON is not defined, there is *no* receive circuitry built
- `define RX_ON
-
-// ------------------------------------------------------------
-// Define 1 and only one of RX_SINGLE, RX_DUAL and RX_QUAD
-// to respectively define 1, 2 or 4 receive channels.
-
-//`define RX_SINGLE
- `define RX_DUAL
-//`define RX_QUAD
-
-// ------------------------------------------------------------
-// Define RX_HB_ON to enable the receive halfband filter
-// `define RX_HB_ON
-
-// ------------------------------------------------------------
-// Define RX_NCO_ON to enable the receive Numerical Controlled Osc
- `define RX_NCO_ON
-
-// ------------------------------------------------------------
-// Define RX_CIC_ON to enable the receive Cascaded Integrator Comb filter
-// This is mutually exclusive with RX_INTEG_ON
-// `define RX_CIC_ON
-
-// ------------------------------------------------------------
-// Define RX_INTEG_ON to enable the receive single stage integrate and dump
-// This is mutually exclusive with RX_CIC_ON
- `define RX_INTEG_ON
-
-// ------------------------------------------------------------
-// If RX_DIG_ON is defined each receive channel sends has its I lsb and Q lsb replaced by digital input from gpio pins
-// So the analog signals are truncated to 15 bits
- `define RX_DIG_ON
diff --git a/gr-gpio/src/fpga/include/common_config_bottom.vh b/gr-gpio/src/fpga/include/common_config_bottom.vh
deleted file mode 100644
index 9e032642b..000000000
--- a/gr-gpio/src/fpga/include/common_config_bottom.vh
+++ /dev/null
@@ -1,133 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2006,2007 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// ====================================================================
-// This is the common tail for standard configuation
-// ====================================================================
-//
-// >>>> DO NOT EDIT BELOW HERE <<<<
-//
-// N.B., *all* the remainder of the code should be conditionalized
-// only in terms of:
-//
-// TX_ON, TX_EN_0, TX_EN_1, TX_EN_2, TX_EN_3, TX_CAP_NCHAN, TX_CAP_HB,
-// RX_ON, RX_EN_0, RX_EN_1, RX_EN_2, RX_EN_3, RX_CAP_NCHAN, RX_CAP_HB,
-// RX_NCO_ON, RX_CIC_ON
-// ====================================================================
-
-`ifdef TX_ON
-
- `ifdef TX_SINGLE
- `define TX_EN_0
- `ifdef TX_DIG_ON
- `define TX_EN_DIG_0
- `define TX_CAP_DIG 1
- `endif
- `define TX_CAP_NCHAN 3'd1
- `endif
-
- `ifdef TX_DUAL
- `define TX_EN_0
- `define TX_EN_1
- `define TX_CAP_NCHAN 3'd2
- `ifdef TX_DIG_ON
- `define TX_EN_DIG_0
- `define TX_EN_DIG_1
- `define TX_CAP_DIG 1
- `endif
- `endif
-
- `ifdef TX_QUAD
- `define TX_EN_0
- `define TX_EN_1
- `define TX_EN_2
- `define TX_EN_3
- `ifdef TX_DIG_ON
- `define TX_EN_DIG_0
- `define TX_EN_DIG_1
- `define TX_CAP_DIG 1
- `endif
- `define TX_CAP_NCHAN 3'd4
- `endif
-
- `ifdef TX_HB_ON
- `define TX_CAP_HB 1
- `else
- `define TX_CAP_HB 0
- `endif
-
-`else // !ifdef TX_ON
-
- `define TX_CAP_NCHAN 3'd0
- `define TX_CAP_HB 0
-
-`endif // !ifdef TX_ON
-
-// --------------------------------------------------------------------
-
-`ifdef RX_ON
-
- `ifdef RX_SINGLE
- `define RX_EN_0
- `define RX_CAP_NCHAN 3'd1
- `ifdef RX_DIG_ON
- `define RX_EN_DIG_0
- `define RX_CAP_DIG 1
- `endif
- `endif
-
- `ifdef RX_DUAL
- `define RX_EN_0
- `define RX_EN_1
- `define RX_CAP_NCHAN 3'd2
- `ifdef RX_DIG_ON
- `define RX_EN_DIG_0
- `define RX_EN_DIG_1
- `define RX_CAP_DIG 1
- `endif
- `endif
-
- `ifdef RX_QUAD
- `define RX_EN_0
- `define RX_EN_1
- `define RX_EN_2
- `define RX_EN_3
- `define RX_CAP_NCHAN 3'd4
- `ifdef RX_DIG_ON
- `define RX_EN_DIG_0
- `define RX_EN_DIG_1
- `define RX_CAP_DIG 1
- `endif
- `endif
-
- `ifdef RX_HB_ON
- `define RX_CAP_HB 1
- `else
- `define RX_CAP_HB 0
- `endif
-
-`else // !ifdef RX_ON
-
- `define RX_CAP_NCHAN 3'd0
- `define RX_CAP_HB 0
-
-`endif // !ifdef RX_ON
diff --git a/gr-gpio/src/fpga/lib/Makefile.am b/gr-gpio/src/fpga/lib/Makefile.am
deleted file mode 100644
index 85fec113f..000000000
--- a/gr-gpio/src/fpga/lib/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS =
-
-EXTRA_DIST += \
- gpio_input.v \
- io_pins.v \
- rx_chain_dig.v \
- tx_chain_dig.v \
- integrator.v \
- integ_shifter.v \
- rx_chain.v \ No newline at end of file
diff --git a/gr-gpio/src/fpga/lib/gpio_input.v b/gr-gpio/src/fpga/lib/gpio_input.v
deleted file mode 100644
index 871fe3263..000000000
--- a/gr-gpio/src/fpga/lib/gpio_input.v
+++ /dev/null
@@ -1,80 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module gpio_input
- (input clock, input reset, input enable,
- input out_strobe,
- input wire [6:0] serial_addr, input wire [31:0] serial_data, input serial_strobe,
- input wire [15:0] io_rx_a_in, input wire [15:0] io_rx_b_in,
- //input wire [15:0] io_tx_a_in, input wire [15:0] io_tx_b_in,
- output reg rx_dig0_i, output reg rx_dig0_q,
- output reg rx_dig1_i, output reg rx_dig1_q );
-
- // Buffer at input to chip
-
- reg rx_dig_rx_a_a,rx_dig_rx_b_a,rx_dig_rx_a_b,rx_dig_rx_b_b;
- //TODO possibly use a flancter here
- //This code can optionally be extended to do streaming input from gpio of tx boards
- //The code can also be extended to input more bits
-
- always @(posedge clock)
- begin
- //This is the first point where is determined which physical input gpio pins are used for streaming digital input
- //The other point is the code which overrides these pins as input (oe = 0)
- //rx_dig_tx_a_a <= #1 io_tx_a_in[14];
- //rx_dig_tx_b_a <= #1 io_tx_a_in[15];
- rx_dig_rx_a_a <= #1 io_rx_a_in[14];
- rx_dig_rx_b_a <= #1 io_rx_a_in[15];
- //rx_dig_tx_a_b <= #1 io_tx_b_in[14];
- //rx_dig_tx_b_b <= #1 io_tx_b_in[15];
- rx_dig_rx_a_b <= #1 io_rx_b_in[14];
- rx_dig_rx_b_b <= #1 io_rx_b_in[15];
- end
-
- // Now mux to the appropriate outputs
- wire [3:0] ddc3mux,ddc2mux,ddc1mux,ddc0mux;
- wire rx_realsignals;
- wire [3:0] rx_numchan;//not used here
- //TODO This setting reg readout is a duplicate of the one in adc_interface.v.
- // Change code so this is done in only one place, or give this code its own register.
- setting_reg #(`FR_RX_MUX) sr_rxmux(.clock(clock),.reset(reset),.strobe(serial_strobe),.addr(serial_addr),
- .in(serial_data),.out({ddc3mux,ddc2mux,ddc1mux,ddc0mux,rx_realsignals,rx_numchan[3:1]}));
- //assign rx_numchan[0] = 1'b0;
-
- always @(posedge clock)
- if (out_strobe) //out_strobe determines the time at which the digital inputs are sampled (with a delay of one sample)
- begin
- rx_dig0_i <= #1 ddc0mux[1] ? (ddc0mux[0] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc0mux[0] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- rx_dig0_q <= #1 rx_realsignals ? 1'b0 : ddc0mux[3] ? (ddc0mux[2] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc0mux[2] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- rx_dig1_i <= #1 ddc1mux[1] ? (ddc1mux[0] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc1mux[0] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- rx_dig1_q <= #1 rx_realsignals ? 1'b0 : ddc1mux[3] ? (ddc1mux[2] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc1mux[2] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- //rx_dig2_i <= #1 ddc2mux[1] ? (ddc2mux[0] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc2mux[0] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- //rx_dig2_q <= #1 rx_realsignals ? 1'b0 : ddc2mux[3] ? (ddc2mux[2] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc2mux[2] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- //rx_dig3_i <= #1 ddc3mux[1] ? (ddc3mux[0] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc3mux[0] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- //rx_dig3_q <= #1 rx_realsignals ? 1'b0 : ddc3mux[3] ? (ddc3mux[2] ? rx_dig_rx_b_b : rx_dig_rx_a_b) : (ddc3mux[2] ? rx_dig_rx_b_a : rx_dig_rx_a_a);
- end
-
-endmodule // gpio_input
-
-
diff --git a/gr-gpio/src/fpga/lib/integ_shifter.v b/gr-gpio/src/fpga/lib/integ_shifter.v
deleted file mode 100644
index 1ad0504cb..000000000
--- a/gr-gpio/src/fpga/lib/integ_shifter.v
+++ /dev/null
@@ -1,68 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2003 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-
-// NOTE: This only works for a max decim rate of 256
-// NOTE: Signal "rate" is ONE LESS THAN the actual rate
-
-module integ_shifter(rate,signal_in,signal_out);
- parameter bw = 16;
- parameter maxbitgain = 8;
-
- input [7:0] rate;
- input wire [bw+maxbitgain-1:0] signal_in;
- output reg [bw-1:0] signal_out;
-
- reg [3:0] bitgain;
-
- // Nearest without overflow -- ceil(log2(rate+1))
- always @*
- if (rate >= 8'd128)
- bitgain = 8;
- else if (rate >= 8'd64)
- bitgain = 7;
- else if (rate >= 8'd32)
- bitgain = 6;
- else if (rate >= 8'd16)
- bitgain = 5;
- else if (rate >= 8'd8)
- bitgain = 4;
- else if (rate >= 8'd4)
- bitgain = 3;
- else if (rate >= 8'd2)
- bitgain = 2;
- else
- bitgain = 1;
-
- always @*
- case(bitgain)
- 5'd1 : signal_out = signal_in[1+bw-1:1];
- 5'd2 : signal_out = signal_in[2+bw-1:2];
- 5'd3 : signal_out = signal_in[3+bw-1:3];
- 5'd4 : signal_out = signal_in[4+bw-1:4];
- 5'd5 : signal_out = signal_in[5+bw-1:5];
- 5'd6 : signal_out = signal_in[6+bw-1:6];
- 5'd7 : signal_out = signal_in[7+bw-1:7];
- default : signal_out = signal_in[8+bw-1:8];
- endcase // case(shift)
-
-endmodule // integ_shifter
diff --git a/gr-gpio/src/fpga/lib/integrator.v b/gr-gpio/src/fpga/lib/integrator.v
deleted file mode 100644
index 22357a565..000000000
--- a/gr-gpio/src/fpga/lib/integrator.v
+++ /dev/null
@@ -1,75 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2003 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// Integrate and dump decimation filter
-//
-// Functionally equivalent to single-stage CIC decimator, simpler code
-// Results in single sample impulse response at decimated rate
-
-module integrator
- ( clock,reset,enable,rate,strobe_in,strobe_out,signal_in,signal_out);
- parameter bw = 16;
- parameter maxbitgain = 8;
-
- input clock;
- input reset;
- input enable;
- input [7:0] rate;
- input strobe_in;
- input strobe_out;
-
- input [bw-1:0] signal_in;
- wire [bw-1:0] signal_out_unreg;
- output [bw-1:0] signal_out;
- reg [bw-1:0] signal_out;
-
- wire [bw+maxbitgain-1:0] signal_in_ext;
- reg [bw+maxbitgain-1:0] accum;
- reg [bw+maxbitgain-1:0] dump;
-
- sign_extend #(bw,bw+maxbitgain)
- ext_input (.in(signal_in),.out(signal_in_ext));
-
- // Integrate samples, dump on strobe out
- always @(posedge clock)
- if (reset | ~enable)
- begin
- accum <= 0;
- dump <= 0;
- end
- else if (enable && strobe_in)
- if (~strobe_out)
- accum <= accum + signal_in_ext;
- else
- begin
- dump <= accum;
- accum <= signal_in_ext;
- end
-
- // Normalize for integration bit gain
- integ_shifter #(bw)
- shifter(rate,dump,signal_out_unreg);
-
- always @(posedge clock)
- signal_out <= #1 signal_out_unreg;
-
-endmodule // integrator
diff --git a/gr-gpio/src/fpga/lib/io_pins.v b/gr-gpio/src/fpga/lib/io_pins.v
deleted file mode 100644
index 9d857902f..000000000
--- a/gr-gpio/src/fpga/lib/io_pins.v
+++ /dev/null
@@ -1,55 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2005,2006 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module io_pins
- ( inout wire [15:0] io_0, inout wire [15:0] io_1, inout wire [15:0] io_2, inout wire [15:0] io_3,
- input wire [15:0] reg_0, input wire [15:0] reg_1, input wire [15:0] reg_2, input wire [15:0] reg_3,
- input wire [15:0] io_0_force_output, input wire [15:0] io_2_force_output,
- input wire [15:0] io_1_force_input, input wire [15:0] io_3_force_input,
- input clock, input rx_reset, input tx_reset,
- input [6:0] serial_addr, input [31:0] serial_data, input serial_strobe);
-
- reg [15:0] io_0_oe,io_1_oe,io_2_oe,io_3_oe;
-
- bidir_reg bidir_reg_0 (.tristate(io_0),.oe(io_0_oe | io_0_force_output),.reg_val(reg_0));
- bidir_reg bidir_reg_1 (.tristate(io_1),.oe(io_1_oe & (~io_1_force_input)),.reg_val(reg_1));
- bidir_reg bidir_reg_2 (.tristate(io_2),.oe(io_2_oe | io_2_force_output),.reg_val(reg_2));
- bidir_reg bidir_reg_3 (.tristate(io_3),.oe(io_3_oe & (~io_3_force_input)),.reg_val(reg_3));
-
- // Upper 16 bits are mask for lower 16
- always @(posedge clock)
- if(serial_strobe)
- case(serial_addr)
- `FR_OE_0 : io_0_oe
- <= #1 (io_0_oe & ~serial_data[31:16]) | (serial_data[15:0] & serial_data[31:16] );
- `FR_OE_1 : io_1_oe
- <= #1 (io_1_oe & ~serial_data[31:16]) | (serial_data[15:0] & serial_data[31:16] );
- `FR_OE_2 : io_2_oe
- <= #1 (io_2_oe & ~serial_data[31:16]) | (serial_data[15:0] & serial_data[31:16] );
- `FR_OE_3 : io_3_oe
- <= #1 (io_3_oe & ~serial_data[31:16]) | (serial_data[15:0] & serial_data[31:16] );
- endcase // case(serial_addr)
-
-endmodule // io_pins
diff --git a/gr-gpio/src/fpga/lib/rx_chain.v b/gr-gpio/src/fpga/lib/rx_chain.v
deleted file mode 100644
index 172e978de..000000000
--- a/gr-gpio/src/fpga/lib/rx_chain.v
+++ /dev/null
@@ -1,121 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2003 Matt Ettus
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// Following defines conditionally include RX path circuitry
-
-`include "config.vh" // resolved relative to project root
-
-module rx_chain
- (input clock,
- input reset,
- input enable,
- input wire [7:0] decim_rate,
- input sample_strobe,
- input decimator_strobe,
- output wire hb_strobe,
- input [6:0] serial_addr, input [31:0] serial_data, input serial_strobe,
- input wire [15:0] i_in,
- input wire [15:0] q_in,
- output wire [15:0] i_out,
- output wire [15:0] q_out,
- output wire [15:0] debugdata,output wire [15:0] debugctrl
- );
-
- parameter FREQADDR = 0;
- parameter PHASEADDR = 0;
-
- wire [31:0] phase;
- wire [15:0] bb_i, bb_q;
- wire [15:0] hb_in_i, hb_in_q;
-
- assign debugdata = hb_in_i;
-
-`ifdef RX_NCO_ON
- phase_acc #(FREQADDR,PHASEADDR,32) rx_phase_acc
- (.clk(clock),.reset(reset),.enable(enable),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .strobe(sample_strobe),.phase(phase) );
-
- cordic rx_cordic
- ( .clock(clock),.reset(reset),.enable(enable),
- .xi(i_in),.yi(q_in),.zi(phase[31:16]),
- .xo(bb_i),.yo(bb_q),.zo() );
-`else
- assign bb_i = i_in;
- assign bb_q = q_in;
- assign sample_strobe = 1;
-`endif // !`ifdef RX_NCO_ON
-
-`ifdef RX_INTEG_ON
- integrator integ_decim_i_0
- ( .clock(clock),.reset(reset),.enable(enable),
- .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
- .signal_in(bb_i),.signal_out(i_out) );
-
- assign hb_strobe = decimator_strobe;
-`else
-`ifdef RX_CIC_ON
- cic_decim cic_decim_i_0
- ( .clock(clock),.reset(reset),.enable(enable),
- .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
- .signal_in(bb_i),.signal_out(hb_in_i) );
-`else
- assign hb_in_i = bb_i;
- assign decimator_strobe = sample_strobe;
-`endif
-
-`ifdef RX_HB_ON
- halfband_decim hbd_i_0
- ( .clock(clock),.reset(reset),.enable(enable),
- .strobe_in(decimator_strobe),.strobe_out(hb_strobe),
- .data_in(hb_in_i),.data_out(i_out),.debugctrl(debugctrl) );
-`else
- assign i_out = hb_in_i;
- assign hb_strobe = decimator_strobe;
-`endif
-`endif // RX_INTEG_ON
-
-`ifdef RX_INTEG_ON
- integrator integ_decim_q_0
- ( .clock(clock),.reset(reset),.enable(enable),
- .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
- .signal_in(bb_q),.signal_out(q_out) );
-`else
-`ifdef RX_CIC_ON
- cic_decim cic_decim_q_0
- ( .clock(clock),.reset(reset),.enable(enable),
- .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
- .signal_in(bb_q),.signal_out(hb_in_q) );
-`else
- assign hb_in_q = bb_q;
-`endif
-
-`ifdef RX_HB_ON
- halfband_decim hbd_q_0
- ( .clock(clock),.reset(reset),.enable(enable),
- .strobe_in(decimator_strobe),.strobe_out(),
- .data_in(hb_in_q),.data_out(q_out) );
-`else
- assign q_out = hb_in_q;
-`endif
-`endif // RX_INTEG_ON
-
-endmodule // rx_chain
diff --git a/gr-gpio/src/fpga/lib/rx_chain_dig.v b/gr-gpio/src/fpga/lib/rx_chain_dig.v
deleted file mode 100644
index 4f760dded..000000000
--- a/gr-gpio/src/fpga/lib/rx_chain_dig.v
+++ /dev/null
@@ -1,43 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// Following defines conditionally include RX path circuitry
-
-`include "../top/config.vh" // resolved relative to project root
-
-module rx_chain_dig
- (input clock,
- input reset,
- input enable,
- input wire [15:0] i_in_ana,
- input wire [15:0] q_in_ana,
- input wire i_in_dig,
- input wire q_in_dig,
- output wire [15:0] i_out,
- output wire [15:0] q_out
- );
-
- //assign upper 15 bits of output to analog input,
- // discards lsb of analog input and replace with digital input bit (which comes from gpio)
- assign i_out = (enable)?{i_in_ana[15:1],i_in_dig}:i_in_ana;
- assign q_out = (enable)?{q_in_ana[15:1],q_in_dig}:q_in_ana;
-
-endmodule // rx_chain_dig
diff --git a/gr-gpio/src/fpga/lib/tx_chain_dig.v b/gr-gpio/src/fpga/lib/tx_chain_dig.v
deleted file mode 100644
index 7001947f7..000000000
--- a/gr-gpio/src/fpga/lib/tx_chain_dig.v
+++ /dev/null
@@ -1,42 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module tx_chain_dig
- (input clock,
- input reset,
- input enable,
- input wire [15:0] i_in,
- input wire [15:0] q_in,
- output wire [15:0] i_out_ana,
- output wire [15:0] q_out_ana,
- output wire i_out_dig,
- output wire q_out_dig
- );
-
- //assign upper 15 bits to analog processing, discard lowest bit
- //output lower two bits of I and Q as digital signal (to be output on gpio pins)
- assign i_out_ana = (enable)?{i_in[15:1],1'b0}:i_in;
- assign q_out_ana = (enable)?{q_in[15:1],1'b0}:q_in;
- //wire out_dig = (enable)?{i_in[0],q_in[0]}:2'b00;
- assign i_out_dig = (enable)?i_in[0]:1'b0;
- assign q_out_dig = (enable)?q_in[0]:1'b0;
-
-endmodule // tx_chain_dig
diff --git a/gr-gpio/src/fpga/rbf/std_2rxhb_2tx_dig.rbf b/gr-gpio/src/fpga/rbf/std_2rxhb_2tx_dig.rbf
deleted file mode 100644
index 5d1c9c7d2..000000000
--- a/gr-gpio/src/fpga/rbf/std_2rxhb_2tx_dig.rbf
+++ /dev/null
Binary files differ
diff --git a/gr-gpio/src/fpga/rbf/std_2rxint_2tx_dig.rbf b/gr-gpio/src/fpga/rbf/std_2rxint_2tx_dig.rbf
deleted file mode 100644
index 60e194eee..000000000
--- a/gr-gpio/src/fpga/rbf/std_2rxint_2tx_dig.rbf
+++ /dev/null
Binary files differ
diff --git a/gr-gpio/src/fpga/top/.gitignore b/gr-gpio/src/fpga/top/.gitignore
deleted file mode 100644
index 28be78cfc..000000000
--- a/gr-gpio/src/fpga/top/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/Makefile.in
-/db
-/prev*.*
-/*.summary
-/*.qws
-/*.rpt
-/*.done
-/*.pin
-/*.sof
-/*.rbf
diff --git a/gr-gpio/src/fpga/top/Makefile.am b/gr-gpio/src/fpga/top/Makefile.am
deleted file mode 100644
index 34b00076c..000000000
--- a/gr-gpio/src/fpga/top/Makefile.am
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright 2008,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- config.vh \
- usrp_gpio.csf \
- usrp_gpio.esf \
- usrp_gpio.psf \
- usrp_gpio.qpf \
- usrp_gpio.qsf \
- usrp_gpio.v
-
-MOSTLYCLEANFILES += \
- db/* \
- *.rpt \
- *.summary \
- *.qws \
- *.smsg \
- *.done \
- *.pin \
- *.sof
diff --git a/gr-gpio/src/fpga/top/config.vh b/gr-gpio/src/fpga/top/config.vh
deleted file mode 100644
index d40e75d2f..000000000
--- a/gr-gpio/src/fpga/top/config.vh
+++ /dev/null
@@ -1,60 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2006,2007 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// ====================================================================
-// User control over what parts get included
-//
-// >>>> EDIT ONLY THIS SECTION <<<<
-// Uncomment only ONE configuration
-// ====================================================================
-
-// ====================================================================
-// FIXME drive configuration selection from the command line and/or gui
-// ====================================================================
-
-// Uncomment this for 1 rx channel (w/ halfband) & 1 transmit channel
-//`include "../include/common_config_1rxhb_1tx.vh"
-
-// Uncomment this for 2 rx channels (w/ halfband) & 2 transmit channels
-//`include "../include/common_config_2rxhb_2tx.vh"
-
-// Uncomment this for 2 rx channels (w/ halfband) & 2 transmit channels with digital output (lsb of I and Q) on gpio pins
-//`include "../include/common_config_2rxhb_2tx_dig.vh"
-
-// Uncomment this for 2 rx channels (w/o halfband, but w/integrator) & 2 tx channels, with streaming GPIO
- `include "../include/common_config_2rxint_2tx_dig.vh"
-
-// Uncomment this for 4 rx channels (w/o halfband) & 0 transmit channels
-//`include "../include/common_config_4rx_0tx.vh"
-
-// Uncomment this for multi with 2 rx channels (w/ halfband) & 0 transmit channels
-//`include "../include/common_config_2rxhb_0tx.vh"
-
-// Uncomment this for multi with 2 rx channels (w/o halfband) & 0 transmit channels
-//`include "../include/common_config_2rx_0tx.vh"
-
-// Add other "known to fit" configurations here...
-
-// ====================================================================
-// Now include the common footer
-// ====================================================================
- `include "../include/common_config_bottom.vh"
diff --git a/gr-gpio/src/fpga/top/usrp_gpio.csf b/gr-gpio/src/fpga/top/usrp_gpio.csf
deleted file mode 100644
index 8a6a0b466..000000000
--- a/gr-gpio/src/fpga/top/usrp_gpio.csf
+++ /dev/null
@@ -1,444 +0,0 @@
-COMPILER_SETTINGS
-{
- IO_PLACEMENT_OPTIMIZATION = OFF;
- ENABLE_DRC_SETTINGS = OFF;
- PHYSICAL_SYNTHESIS_REGISTER_RETIMING = OFF;
- PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION = OFF;
- PHYSICAL_SYNTHESIS_COMBO_LOGIC = OFF;
- DRC_FANOUT_EXCEEDING = 30;
- DRC_REPORT_FANOUT_EXCEEDING = OFF;
- DRC_TOP_FANOUT = 50;
- DRC_REPORT_TOP_FANOUT = OFF;
- RUN_DRC_DURING_COMPILATION = OFF;
- ADV_NETLIST_OPT_RETIME_CORE_AND_IO = ON;
- ADV_NETLIST_OPT_SYNTH_USE_FITTER_INFO = OFF;
- ADV_NETLIST_OPT_SYNTH_GATE_RETIME = OFF;
- ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP = OFF;
- SMART_COMPILE_IGNORES_TDC_FOR_STRATIX_PLL_CHANGES = OFF;
- MERGE_HEX_FILE = OFF;
- TRUE_WYSIWYG_FLOW = OFF;
- SEED = 1;
- FINAL_PLACEMENT_OPTIMIZATION = AUTOMATICALLY;
- FAMILY = Cyclone;
- DPRAM_DUAL_PORT_MODE_OTHER_SIGNALS_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_OUTPUT_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_OUTPUT_EPXA1 = "LOWER TO 1ESB UPPER TO 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_OUTPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_INPUT_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_INPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_INPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_OTHER_SIGNALS_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_WIDE_MODE_OTHER_SIGNALS_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DEEP_MODE_OTHER_SIGNALS_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DUAL_PORT_MODE_OUTPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4ESB";
- DPRAM_SINGLE_PORT_MODE_OUTPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4ESB";
- DPRAM_WIDE_MODE_OUTPUT_EPXA4_10 = "LOWER TO 3 UPPER TO 4ESB";
- DPRAM_DEEP_MODE_OUTPUT_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DUAL_PORT_MODE_INPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_SINGLE_PORT_MODE_INPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_WIDE_MODE_INPUT_EPXA4_10 = "LOWER TO 3 UPPER TO 4";
- DPRAM_DEEP_MODE_INPUT_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_OTHER_SIGNALS_EPXA4_10 = "DEFAULT OTHER ROUTING OPTIONS";
- DPRAM_OUTPUT_EPXA4_10 = "DEFAULT OUTPUT ROUTING OPTIONS";
- DPRAM_INPUT_EPXA4_10 = "DEFAULT INPUT ROUTING OPTIONS";
- STRIPE_TO_PLD_INTERRUPTS_EPXA4_10 = "MEGALAB COLUMN 2";
- PLD_TO_STRIPE_INTERRUPTS_EPXA4_10 = "MEGALAB COLUMN 2";
- PROCESSOR_DEBUG_EXTENSIONS_EPXA4_10 = "MEGALAB COLUMN 2";
- STRIPE_TO_PLD_BRIDGE_EPXA4_10 = "MEGALAB COLUMN 1";
- FAST_FIT_COMPILATION = OFF;
- SIGNALPROBE_DURING_NORMAL_COMPILATION = OFF;
- OPTIMIZE_IOC_REGISTER_PLACEMENT_FOR_TIMING = ON;
- OPTIMIZE_TIMING = "NORMAL COMPILATION";
- OPTIMIZE_HOLD_TIMING = OFF;
- COMPILATION_LEVEL = FULL;
- SAVE_DISK_SPACE = OFF;
- SPEED_DISK_USAGE_TRADEOFF = NORMAL;
- LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT = OFF;
- SIGNALPROBE_ALLOW_OVERUSE = OFF;
- FOCUS_ENTITY_NAME = |usrp_gpio;
- ROUTING_BACK_ANNOTATION_MODE = OFF;
- INC_PLC_MODE = OFF;
- FIT_ONLY_ONE_ATTEMPT = OFF;
-}
-DEFAULT_DEVICE_OPTIONS
-{
- GENERATE_CONFIG_HEXOUT_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_JBC_FILE = OFF;
- GENERATE_CONFIG_JAM_FILE = OFF;
- GENERATE_CONFIG_ISC_FILE = OFF;
- GENERATE_CONFIG_SVF_FILE = OFF;
- GENERATE_JBC_FILE_COMPRESSED = ON;
- GENERATE_JBC_FILE = OFF;
- GENERATE_JAM_FILE = OFF;
- GENERATE_ISC_FILE = OFF;
- GENERATE_SVF_FILE = OFF;
- RESERVE_PIN = "AS INPUT TRI-STATED";
- RESERVE_ALL_UNUSED_PINS = "AS OUTPUT DRIVING GROUND";
- HEXOUT_FILE_COUNT_DIRECTION = UP;
- HEXOUT_FILE_START_ADDRESS = 0;
- GENERATE_HEX_FILE = OFF;
- GENERATE_RBF_FILE = OFF;
- GENERATE_TTF_FILE = OFF;
- RESERVE_ASDO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA0_AFTER_CONFIGURATION = "AS INPUT TRI-STATED";
- RESERVE_DATA7_THROUGH_DATA1_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_RDYNBUSY_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_NWS_NRS_NCS_CS_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- DISABLE_NCS_AND_OE_PULLUPS_ON_CONFIG_DEVICE = OFF;
- AUTO_INCREMENT_CONFIG_DEVICE_JTAG_USER_CODE = ON;
- EPROM_USE_CHECKSUM_AS_USERCODE = OFF;
- FLEX10K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIGURATION_DEVICE = AUTO;
- CYCLONE_CONFIGURATION_DEVICE = AUTO;
- FLEX10K_CONFIGURATION_DEVICE = AUTO;
- FLEX6K_CONFIGURATION_DEVICE = AUTO;
- MERCURY_CONFIGURATION_DEVICE = AUTO;
- EXCALIBUR_CONFIGURATION_DEVICE = AUTO;
- APEX20K_CONFIGURATION_DEVICE = AUTO;
- USE_CONFIGURATION_DEVICE = ON;
- ENABLE_INIT_DONE_OUTPUT = OFF;
- FLEX10K_ENABLE_LOCK_OUTPUT = OFF;
- ENABLE_DEVICE_WIDE_OE = OFF;
- ENABLE_DEVICE_WIDE_RESET = OFF;
- RELEASE_CLEARS_BEFORE_TRI_STATES = OFF;
- AUTO_RESTART_CONFIGURATION = OFF;
- ENABLE_VREFB_PIN = OFF;
- ENABLE_VREFA_PIN = OFF;
- SECURITY_BIT = OFF;
- USER_START_UP_CLOCK = OFF;
- APEXII_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX10K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX6K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- MERCURY_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- EXCALIBUR_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- CYCLONE_CONFIGURATION_SCHEME = "ACTIVE SERIAL";
- STRATIX_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- APEX20K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- STRATIX_UPDATE_MODE = STANDARD;
- USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_JTAG_USER_CODE = 7F;
- MERCURY_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_JTAG_USER_CODE = FFFFFFFF;
- MAX7000S_JTAG_USER_CODE = FFFF;
- RESERVE_NCEO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- FLEX10K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- FLEX6K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = OFF;
- ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- MAX7000_ENABLE_JTAG_BST_SUPPORT = ON;
- ENABLE_JTAG_BST_SUPPORT = OFF;
- CONFIGURATION_CLOCK_DIVISOR = 1;
- CONFIGURATION_CLOCK_FREQUENCY = "10 MHZ";
- CLOCK_SOURCE = INTERNAL;
- COMPRESSION_MODE = OFF;
- ON_CHIP_BITSTREAM_DECOMPRESSION = OFF;
-}
-AUTO_SLD_HUB_ENTITY
-{
- AUTO_INSERT_SLD_HUB_ENTITY = ENABLE;
- HUB_INSTANCE_NAME = SLD_HUB_INST;
- HUB_ENTITY_NAME = SLD_HUB;
-}
-SIGNALTAP_LOGIC_ANALYZER_SETTINGS
-{
- ENABLE_SIGNALTAP = Off;
- AUTO_ENABLE_SMART_COMPILE = On;
-}
-CHIP(usrp_gpio)
-{
- DEVICE = EP1C12Q240C8;
- DEVICE_FILTER_PACKAGE = "ANY QFP";
- DEVICE_FILTER_PIN_COUNT = 240;
- DEVICE_FILTER_SPEED_GRADE = ANY;
- AUTO_RESTART_CONFIGURATION = OFF;
- RELEASE_CLEARS_BEFORE_TRI_STATES = OFF;
- USER_START_UP_CLOCK = OFF;
- ENABLE_DEVICE_WIDE_RESET = OFF;
- ENABLE_DEVICE_WIDE_OE = OFF;
- ENABLE_INIT_DONE_OUTPUT = OFF;
- FLEX10K_ENABLE_LOCK_OUTPUT = OFF;
- ENABLE_JTAG_BST_SUPPORT = OFF;
- MAX7000_ENABLE_JTAG_BST_SUPPORT = ON;
- APEX20K_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_JTAG_USER_CODE = 7F;
- MAX7000_JTAG_USER_CODE = FFFFFFFF;
- MAX7000S_JTAG_USER_CODE = FFFF;
- STRATIX_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- MERCURY_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX6K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX10K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- EXCALIBUR_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- APEXII_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- STRATIX_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- CYCLONE_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- USE_CONFIGURATION_DEVICE = OFF;
- APEX20K_CONFIGURATION_DEVICE = AUTO;
- MERCURY_CONFIGURATION_DEVICE = AUTO;
- FLEX6K_CONFIGURATION_DEVICE = AUTO;
- FLEX10K_CONFIGURATION_DEVICE = AUTO;
- EXCALIBUR_CONFIGURATION_DEVICE = AUTO;
- STRATIX_CONFIGURATION_DEVICE = AUTO;
- CYCLONE_CONFIGURATION_DEVICE = AUTO;
- STRATIX_UPDATE_MODE = STANDARD;
- APEX20K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- AUTO_INCREMENT_CONFIG_DEVICE_JTAG_USER_CODE = ON;
- DISABLE_NCS_AND_OE_PULLUPS_ON_CONFIG_DEVICE = OFF;
- COMPRESSION_MODE = OFF;
- ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- FLEX6K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = OFF;
- FLEX10K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- EPROM_USE_CHECKSUM_AS_USERCODE = OFF;
- USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_USE_CHECKSUM_AS_USERCODE = OFF;
- GENERATE_TTF_FILE = OFF;
- GENERATE_RBF_FILE = ON;
- GENERATE_HEX_FILE = OFF;
- SECURITY_BIT = OFF;
- ENABLE_VREFA_PIN = OFF;
- ENABLE_VREFB_PIN = OFF;
- GENERATE_SVF_FILE = OFF;
- GENERATE_ISC_FILE = OFF;
- GENERATE_JAM_FILE = OFF;
- GENERATE_JBC_FILE = OFF;
- GENERATE_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_SVF_FILE = OFF;
- GENERATE_CONFIG_ISC_FILE = OFF;
- GENERATE_CONFIG_JAM_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_HEXOUT_FILE = OFF;
- ON_CHIP_BITSTREAM_DECOMPRESSION = OFF;
- BASE_PIN_OUT_FILE_ON_SAMEFRAME_DEVICE = OFF;
- HEXOUT_FILE_START_ADDRESS = 0;
- HEXOUT_FILE_COUNT_DIRECTION = UP;
- RESERVE_ALL_UNUSED_PINS = "AS INPUT TRI-STATED";
- STRATIX_DEVICE_IO_STANDARD = LVTTL;
- CLOCK_SOURCE = INTERNAL;
- CONFIGURATION_CLOCK_FREQUENCY = "10 MHZ";
- CONFIGURATION_CLOCK_DIVISOR = 1;
- RESERVE_NWS_NRS_NCS_CS_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_RDYNBUSY_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA7_THROUGH_DATA1_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA0_AFTER_CONFIGURATION = "AS INPUT TRI-STATED";
- RESERVE_NCEO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_ASDO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- SCLK : LOCATION = Pin_101;
- SDI : LOCATION = Pin_100;
- SEN : LOCATION = Pin_98;
- SLD : LOCATION = Pin_95;
- adc1_data[0] : LOCATION = Pin_5;
- adc1_data[10] : LOCATION = Pin_235;
- adc1_data[11] : LOCATION = Pin_234;
- adc1_data[1] : LOCATION = Pin_4;
- adc1_data[2] : LOCATION = Pin_3;
- adc1_data[3] : LOCATION = Pin_2;
- adc1_data[4] : LOCATION = Pin_1;
- adc1_data[4] : IO_STANDARD = LVTTL;
- adc1_data[5] : LOCATION = Pin_240;
- adc1_data[6] : LOCATION = Pin_239;
- adc1_data[7] : LOCATION = Pin_238;
- adc1_data[8] : LOCATION = Pin_237;
- adc1_data[9] : LOCATION = Pin_236;
- adc2_data[0] : LOCATION = Pin_20;
- adc2_data[10] : LOCATION = Pin_8;
- adc2_data[11] : LOCATION = Pin_7;
- adc2_data[1] : LOCATION = Pin_19;
- adc2_data[2] : LOCATION = Pin_18;
- adc2_data[3] : LOCATION = Pin_17;
- adc2_data[4] : LOCATION = Pin_16;
- adc2_data[5] : LOCATION = Pin_15;
- adc2_data[6] : LOCATION = Pin_14;
- adc2_data[7] : LOCATION = Pin_13;
- adc2_data[8] : LOCATION = Pin_12;
- adc2_data[9] : LOCATION = Pin_11;
- adc3_data[0] : LOCATION = Pin_200;
- adc3_data[10] : LOCATION = Pin_184;
- adc3_data[11] : LOCATION = Pin_183;
- adc3_data[1] : LOCATION = Pin_197;
- adc3_data[2] : LOCATION = Pin_196;
- adc3_data[3] : LOCATION = Pin_195;
- adc3_data[4] : LOCATION = Pin_194;
- adc3_data[5] : LOCATION = Pin_193;
- adc3_data[6] : LOCATION = Pin_188;
- adc3_data[7] : LOCATION = Pin_187;
- adc3_data[8] : LOCATION = Pin_186;
- adc3_data[9] : LOCATION = Pin_185;
- adc4_data[0] : LOCATION = Pin_222;
- adc4_data[10] : LOCATION = Pin_203;
- adc4_data[11] : LOCATION = Pin_202;
- adc4_data[1] : LOCATION = Pin_219;
- adc4_data[2] : LOCATION = Pin_217;
- adc4_data[3] : LOCATION = Pin_216;
- adc4_data[4] : LOCATION = Pin_215;
- adc4_data[5] : LOCATION = Pin_214;
- adc4_data[6] : LOCATION = Pin_213;
- adc4_data[7] : LOCATION = Pin_208;
- adc4_data[8] : LOCATION = Pin_207;
- adc4_data[9] : LOCATION = Pin_206;
- adc_oeb[0] : LOCATION = Pin_228;
- adc_oeb[1] : LOCATION = Pin_21;
- adc_oeb[2] : LOCATION = Pin_181;
- adc_oeb[3] : LOCATION = Pin_218;
- adc_otr[0] : LOCATION = Pin_233;
- adc_otr[1] : LOCATION = Pin_6;
- adc_otr[2] : LOCATION = Pin_182;
- adc_otr[3] : LOCATION = Pin_201;
- adclk0 : LOCATION = Pin_224;
- adclk1 : LOCATION = Pin_226;
- clk0 : LOCATION = Pin_28;
- clk0 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk0 : IO_STANDARD = LVTTL;
- clk1 : LOCATION = Pin_29;
- clk1 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk1 : IO_STANDARD = LVTTL;
- clk3 : LOCATION = Pin_152;
- clk3 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk3 : IO_STANDARD = LVTTL;
- clk_120mhz : LOCATION = Pin_153;
- clk_120mhz : IO_STANDARD = LVTTL;
- clk_out : LOCATION = Pin_63;
- clk_out : IO_STANDARD = LVTTL;
- dac1_data[0] : LOCATION = Pin_165;
- dac1_data[10] : LOCATION = Pin_177;
- dac1_data[11] : LOCATION = Pin_178;
- dac1_data[12] : LOCATION = Pin_179;
- dac1_data[13] : LOCATION = Pin_180;
- dac1_data[1] : LOCATION = Pin_166;
- dac1_data[2] : LOCATION = Pin_167;
- dac1_data[3] : LOCATION = Pin_168;
- dac1_data[4] : LOCATION = Pin_169;
- dac1_data[5] : LOCATION = Pin_170;
- dac1_data[6] : LOCATION = Pin_173;
- dac1_data[7] : LOCATION = Pin_174;
- dac1_data[8] : LOCATION = Pin_175;
- dac1_data[9] : LOCATION = Pin_176;
- dac2_data[0] : LOCATION = Pin_159;
- dac2_data[10] : LOCATION = Pin_163;
- dac2_data[11] : LOCATION = Pin_139;
- dac2_data[12] : LOCATION = Pin_164;
- dac2_data[13] : LOCATION = Pin_138;
- dac2_data[1] : LOCATION = Pin_158;
- dac2_data[2] : LOCATION = Pin_160;
- dac2_data[3] : LOCATION = Pin_156;
- dac2_data[4] : LOCATION = Pin_161;
- dac2_data[5] : LOCATION = Pin_144;
- dac2_data[6] : LOCATION = Pin_162;
- dac2_data[7] : LOCATION = Pin_141;
- dac2_data[8] : LOCATION = Pin_143;
- dac2_data[9] : LOCATION = Pin_140;
- dac3_data[0] : LOCATION = Pin_122;
- dac3_data[10] : LOCATION = Pin_134;
- dac3_data[11] : LOCATION = Pin_135;
- dac3_data[12] : LOCATION = Pin_136;
- dac3_data[13] : LOCATION = Pin_137;
- dac3_data[1] : LOCATION = Pin_123;
- dac3_data[2] : LOCATION = Pin_124;
- dac3_data[3] : LOCATION = Pin_125;
- dac3_data[4] : LOCATION = Pin_126;
- dac3_data[5] : LOCATION = Pin_127;
- dac3_data[6] : LOCATION = Pin_128;
- dac3_data[7] : LOCATION = Pin_131;
- dac3_data[8] : LOCATION = Pin_132;
- dac3_data[9] : LOCATION = Pin_133;
- dac4_data[0] : LOCATION = Pin_104;
- dac4_data[10] : LOCATION = Pin_118;
- dac4_data[11] : LOCATION = Pin_119;
- dac4_data[12] : LOCATION = Pin_120;
- dac4_data[13] : LOCATION = Pin_121;
- dac4_data[1] : LOCATION = Pin_105;
- dac4_data[2] : LOCATION = Pin_106;
- dac4_data[3] : LOCATION = Pin_107;
- dac4_data[4] : LOCATION = Pin_108;
- dac4_data[5] : LOCATION = Pin_113;
- dac4_data[6] : LOCATION = Pin_114;
- dac4_data[7] : LOCATION = Pin_115;
- dac4_data[8] : LOCATION = Pin_116;
- dac4_data[9] : LOCATION = Pin_117;
- enable_rx : LOCATION = Pin_88;
- enable_tx : LOCATION = Pin_93;
- gndbus[0] : LOCATION = Pin_223;
- gndbus[0] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[0] : IO_STANDARD = LVTTL;
- gndbus[1] : LOCATION = Pin_225;
- gndbus[1] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[1] : IO_STANDARD = LVTTL;
- gndbus[2] : LOCATION = Pin_227;
- gndbus[2] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[2] : IO_STANDARD = LVTTL;
- gndbus[3] : LOCATION = Pin_62;
- gndbus[3] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[3] : IO_STANDARD = LVTTL;
- gndbus[4] : LOCATION = Pin_64;
- gndbus[4] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[4] : IO_STANDARD = LVTTL;
- misc_pins[0] : LOCATION = Pin_87;
- misc_pins[0] : IO_STANDARD = LVTTL;
- misc_pins[10] : LOCATION = Pin_76;
- misc_pins[10] : IO_STANDARD = LVTTL;
- misc_pins[11] : LOCATION = Pin_74;
- misc_pins[11] : IO_STANDARD = LVTTL;
- misc_pins[1] : LOCATION = Pin_86;
- misc_pins[1] : IO_STANDARD = LVTTL;
- misc_pins[2] : LOCATION = Pin_85;
- misc_pins[2] : IO_STANDARD = LVTTL;
- misc_pins[3] : LOCATION = Pin_84;
- misc_pins[3] : IO_STANDARD = LVTTL;
- misc_pins[4] : LOCATION = Pin_83;
- misc_pins[4] : IO_STANDARD = LVTTL;
- misc_pins[5] : LOCATION = Pin_82;
- misc_pins[5] : IO_STANDARD = LVTTL;
- misc_pins[6] : LOCATION = Pin_79;
- misc_pins[6] : IO_STANDARD = LVTTL;
- misc_pins[7] : LOCATION = Pin_78;
- misc_pins[7] : IO_STANDARD = LVTTL;
- misc_pins[8] : LOCATION = Pin_77;
- misc_pins[8] : IO_STANDARD = LVTTL;
- misc_pins[9] : LOCATION = Pin_75;
- misc_pins[9] : IO_STANDARD = LVTTL;
- reset : LOCATION = Pin_94;
- usbclk : LOCATION = Pin_55;
- usbctl[0] : LOCATION = Pin_56;
- usbctl[1] : LOCATION = Pin_54;
- usbctl[2] : LOCATION = Pin_53;
- usbctl[3] : LOCATION = Pin_58;
- usbctl[4] : LOCATION = Pin_57;
- usbctl[5] : LOCATION = Pin_44;
- usbdata[0] : LOCATION = Pin_73;
- usbdata[10] : LOCATION = Pin_41;
- usbdata[11] : LOCATION = Pin_39;
- usbdata[12] : LOCATION = Pin_38;
- usbdata[12] : IO_STANDARD = LVTTL;
- usbdata[13] : LOCATION = Pin_37;
- usbdata[14] : LOCATION = Pin_24;
- usbdata[15] : LOCATION = Pin_23;
- usbdata[1] : LOCATION = Pin_68;
- usbdata[2] : LOCATION = Pin_67;
- usbdata[3] : LOCATION = Pin_66;
- usbdata[4] : LOCATION = Pin_65;
- usbdata[5] : LOCATION = Pin_61;
- usbdata[6] : LOCATION = Pin_60;
- usbdata[7] : LOCATION = Pin_59;
- usbdata[8] : LOCATION = Pin_43;
- usbdata[9] : LOCATION = Pin_42;
- usbrdy[0] : LOCATION = Pin_45;
- usbrdy[1] : LOCATION = Pin_46;
- usbrdy[2] : LOCATION = Pin_47;
- usbrdy[3] : LOCATION = Pin_48;
- usbrdy[4] : LOCATION = Pin_49;
- usbrdy[5] : LOCATION = Pin_50;
- clear_status : LOCATION = Pin_99;
-}
diff --git a/gr-gpio/src/fpga/top/usrp_gpio.esf b/gr-gpio/src/fpga/top/usrp_gpio.esf
deleted file mode 100644
index 5ca386649..000000000
--- a/gr-gpio/src/fpga/top/usrp_gpio.esf
+++ /dev/null
@@ -1,14 +0,0 @@
-SIMULATOR_SETTINGS
-{
- ESTIMATE_POWER_CONSUMPTION = OFF;
- GLITCH_INTERVAL = 1NS;
- GLITCH_DETECTION = OFF;
- SIMULATION_COVERAGE = ON;
- CHECK_OUTPUTS = OFF;
- SETUP_HOLD_DETECTION = OFF;
- POWER_ESTIMATION_START_TIME = "0 NS";
- ADD_DEFAULT_PINS_TO_SIMULATION_OUTPUT_WAVEFORMS = ON;
- SIMULATION_MODE = TIMING;
- START_TIME = 0NS;
- USE_COMPILER_SETTINGS = usrp_gpio;
-}
diff --git a/gr-gpio/src/fpga/top/usrp_gpio.psf b/gr-gpio/src/fpga/top/usrp_gpio.psf
deleted file mode 100644
index ff8e6ab08..000000000
--- a/gr-gpio/src/fpga/top/usrp_gpio.psf
+++ /dev/null
@@ -1,312 +0,0 @@
-DEFAULT_DESIGN_ASSISTANT_SETTINGS
-{
- HCPY_ALOAD_SIGNALS = OFF;
- HCPY_VREF_PINS = OFF;
- HCPY_CAT = OFF;
- HCPY_ILLEGAL_HC_DEV_PKG = OFF;
- ACLK_RULE_IMSZER_ADOMAIN = OFF;
- ACLK_RULE_SZER_BTW_ACLK_DOMAIN = OFF;
- ACLK_RULE_NO_SZER_ACLK_DOMAIN = OFF;
- ACLK_CAT = OFF;
- SIGNALRACE_RULE_ASYNCHPIN_SYNCH_CLKPIN = OFF;
- SIGNALRACE_CAT = OFF;
- NONSYNCHSTRUCT_RULE_LATCH_UNIDENTIFIED = OFF;
- NONSYNCHSTRUCT_RULE_SRLATCH = OFF;
- NONSYNCHSTRUCT_RULE_DLATCH = OFF;
- NONSYNCHSTRUCT_RULE_MULTI_VIBRATOR = OFF;
- NONSYNCHSTRUCT_RULE_ILLEGAL_PULSE_GEN = OFF;
- NONSYNCHSTRUCT_RULE_RIPPLE_CLK = OFF;
- NONSYNCHSTRUCT_RULE_DELAY_CHAIN = OFF;
- NONSYNCHSTRUCT_RULE_REG_LOOP = OFF;
- NONSYNCHSTRUCT_RULE_COMBLOOP = OFF;
- NONSYNCHSTRUCT_CAT = OFF;
- NONSYNCHSTRUCT_RULE_COMB_DRIVES_RAM_WE = OFF;
- TIMING_RULE_COIN_CLKEDGE = OFF;
- TIMING_RULE_SHIFT_REG = OFF;
- TIMING_RULE_HIGH_FANOUTS = OFF;
- TIMING_CAT = OFF;
- RESET_RULE_ALL = OFF;
- RESET_RULE_IMSYNCH_ASYNCH_DOMAIN = OFF;
- RESET_RULE_UNSYNCH_ASYNCH_DOMAIN = OFF;
- RESET_RULE_REG_ASNYCH = OFF;
- RESET_RULE_COMB_ASYNCH_RESET = OFF;
- RESET_RULE_IMSYNCH_EXRESET = OFF;
- RESET_RULE_UNSYNCH_EXRESET = OFF;
- RESET_RULE_INPINS_RESETNET = OFF;
- RESET_CAT = OFF;
- CLK_RULE_ALL = OFF;
- CLK_RULE_MIX_EDGES = OFF;
- CLK_RULE_CLKNET_CLKSPINES = OFF;
- CLK_RULE_INPINS_CLKNET = OFF;
- CLK_RULE_GATING_SCHEME = OFF;
- CLK_RULE_INV_CLOCK = OFF;
- CLK_RULE_COMB_CLOCK = OFF;
- CLK_CAT = OFF;
- HCPY_EXCEED_USER_IO_USAGE = OFF;
- HCPY_EXCEED_RAM_USAGE = OFF;
- NONSYNCHSTRUCT_RULE_ASYN_RAM = OFF;
- SIGNALRACE_RULE_TRISTATE = OFF;
- ASSG_RULE_MISSING_TIMING = OFF;
- ASSG_RULE_MISSING_FMAX = OFF;
- ASSG_CAT = OFF;
-}
-SYNTHESIS_FITTING_SETTINGS
-{
- AUTO_SHIFT_REGISTER_RECOGNITION = ON;
- AUTO_DSP_RECOGNITION = ON;
- AUTO_RAM_RECOGNITION = ON;
- REMOVE_DUPLICATE_LOGIC = ON;
- AUTO_TURBO_BIT = ON;
- AUTO_MERGE_PLLS = ON;
- AUTO_OPEN_DRAIN_PINS = ON;
- AUTO_PARALLEL_EXPANDERS = ON;
- AUTO_FAST_OUTPUT_ENABLE_REGISTERS = OFF;
- AUTO_FAST_OUTPUT_REGISTERS = OFF;
- AUTO_FAST_INPUT_REGISTERS = OFF;
- AUTO_CASCADE_CHAINS = ON;
- AUTO_CARRY_CHAINS = ON;
- AUTO_DELAY_CHAINS = ON;
- MAX7000_PARALLEL_EXPANDER_CHAIN_LENGTH = 4;
- PARALLEL_EXPANDER_CHAIN_LENGTH = 16;
- CASCADE_CHAIN_LENGTH = 2;
- STRATIX_CARRY_CHAIN_LENGTH = 70;
- MERCURY_CARRY_CHAIN_LENGTH = 48;
- FLEX10K_CARRY_CHAIN_LENGTH = 32;
- FLEX6K_CARRY_CHAIN_LENGTH = 32;
- CARRY_CHAIN_LENGTH = 48;
- CARRY_OUT_PINS_LCELL_INSERT = ON;
- NORMAL_LCELL_INSERT = ON;
- AUTO_LCELL_INSERTION = ON;
- ALLOW_XOR_GATE_USAGE = ON;
- AUTO_PACKED_REGISTERS_STRATIX = NORMAL;
- AUTO_PACKED_REGISTERS = OFF;
- AUTO_PACKED_REG_CYCLONE = NORMAL;
- FLEX10K_OPTIMIZATION_TECHNIQUE = AREA;
- FLEX6K_OPTIMIZATION_TECHNIQUE = AREA;
- MERCURY_OPTIMIZATION_TECHNIQUE = AREA;
- APEX20K_OPTIMIZATION_TECHNIQUE = SPEED;
- MAX7000_OPTIMIZATION_TECHNIQUE = SPEED;
- STRATIX_OPTIMIZATION_TECHNIQUE = SPEED;
- CYCLONE_OPTIMIZATION_TECHNIQUE = AREA;
- FLEX10K_TECHNOLOGY_MAPPER = LUT;
- FLEX6K_TECHNOLOGY_MAPPER = LUT;
- MERCURY_TECHNOLOGY_MAPPER = LUT;
- APEX20K_TECHNOLOGY_MAPPER = LUT;
- MAX7000_TECHNOLOGY_MAPPER = "PRODUCT TERM";
- STRATIX_TECHNOLOGY_MAPPER = LUT;
- AUTO_IMPLEMENT_IN_ROM = OFF;
- AUTO_GLOBAL_MEMORY_CONTROLS = OFF;
- AUTO_GLOBAL_REGISTER_CONTROLS = ON;
- AUTO_GLOBAL_OE = ON;
- AUTO_GLOBAL_CLOCK = ON;
- USE_LPM_FOR_AHDL_OPERATORS = ON;
- LIMIT_AHDL_INTEGERS_TO_32_BITS = OFF;
- ENABLE_BUS_HOLD_CIRCUITRY = OFF;
- WEAK_PULL_UP_RESISTOR = OFF;
- TURBO_BIT = ON;
- MAX7000_IGNORE_SOFT_BUFFERS = OFF;
- IGNORE_SOFT_BUFFERS = ON;
- MAX7000_IGNORE_LCELL_BUFFERS = AUTO;
- IGNORE_LCELL_BUFFERS = OFF;
- IGNORE_ROW_GLOBAL_BUFFERS = OFF;
- IGNORE_GLOBAL_BUFFERS = OFF;
- IGNORE_CASCADE_BUFFERS = OFF;
- IGNORE_CARRY_BUFFERS = OFF;
- REMOVE_DUPLICATE_REGISTERS = ON;
- REMOVE_REDUNDANT_LOGIC_CELLS = OFF;
- ALLOW_POWER_UP_DONT_CARE = ON;
- PCI_IO = OFF;
- NOT_GATE_PUSH_BACK = ON;
- SLOW_SLEW_RATE = OFF;
- DSP_BLOCK_BALANCING = AUTO;
- STATE_MACHINE_PROCESSING = AUTO;
-}
-DEFAULT_HARDCOPY_SETTINGS
-{
- HARDCOPY_EXTERNAL_CLOCK_JITTER = "0.0 NS";
-}
-DEFAULT_TIMING_REQUIREMENTS
-{
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- RUN_ALL_TIMING_ANALYSES = ON;
- IGNORE_CLOCK_SETTINGS = OFF;
- DEFAULT_HOLD_MULTICYCLE = "SAME AS MULTICYCLE";
- CUT_OFF_IO_PIN_FEEDBACK = ON;
- CUT_OFF_CLEAR_AND_PRESET_PATHS = ON;
- CUT_OFF_READ_DURING_WRITE_PATHS = ON;
- CUT_OFF_PATHS_BETWEEN_CLOCK_DOMAINS = ON;
- DO_MIN_ANALYSIS = ON;
- DO_MIN_TIMING = OFF;
- NUMBER_OF_PATHS_TO_REPORT = 200;
- NUMBER_OF_DESTINATION_TO_REPORT = 10;
- NUMBER_OF_SOURCES_PER_DESTINATION_TO_REPORT = 10;
- MAX_SCC_SIZE = 50;
-}
-HDL_SETTINGS
-{
- VERILOG_INPUT_VERSION = VERILOG_2001;
- ENABLE_IP_DEBUG = OFF;
- VHDL_INPUT_VERSION = VHDL93;
- VHDL_SHOW_LMF_MAPPING_MESSAGES = OFF;
-}
-PROJECT_INFO(usrp_gpio)
-{
- ORIGINAL_QUARTUS_VERSION = 3.0;
- PROJECT_CREATION_TIME_DATE = "00:14:04 JULY 13, 2003";
- LAST_QUARTUS_VERSION = 3.0;
- SHOW_REGISTRATION_MESSAGE = ON;
- USER_LIBRARIES = "e:\usrp\fpga\megacells";
-}
-THIRD_PARTY_EDA_TOOLS(usrp_gpio)
-{
- EDA_DESIGN_ENTRY_SYNTHESIS_TOOL = "<NONE>";
- EDA_SIMULATION_TOOL = "<NONE>";
- EDA_TIMING_ANALYSIS_TOOL = "<NONE>";
- EDA_BOARD_DESIGN_TOOL = "<NONE>";
- EDA_FORMAL_VERIFICATION_TOOL = "<NONE>";
- EDA_RESYNTHESIS_TOOL = "<NONE>";
-}
-EDA_TOOL_SETTINGS(eda_design_synthesis)
-{
- EDA_INPUT_GND_NAME = GND;
- EDA_INPUT_VCC_NAME = VCC;
- EDA_SHOW_LMF_MAPPING_MESSAGES = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_INPUT_DATA_FORMAT = EDIF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_simulation)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_timing_analysis)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- EDA_LAUNCH_CMD_LINE_TOOL = OFF;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_board_design)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_formal_verification)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_palace)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- RESYNTHESIS_RETIMING = FULL;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
-}
-CLOCK(clk_120mhz)
-{
- FMAX_REQUIREMENT = "120.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(usbclk)
-{
- FMAX_REQUIREMENT = "48.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(SCLK)
-{
- FMAX_REQUIREMENT = "1.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(adclk0)
-{
- FMAX_REQUIREMENT = "60.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(adclk1)
-{
- FMAX_REQUIREMENT = "60.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
diff --git a/gr-gpio/src/fpga/top/usrp_gpio.qpf b/gr-gpio/src/fpga/top/usrp_gpio.qpf
deleted file mode 100644
index 7eb8da9eb..000000000
--- a/gr-gpio/src/fpga/top/usrp_gpio.qpf
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 1991-2004 Altera Corporation
-# Any megafunction design, and related netlist (encrypted or decrypted),
-# support information, device programming or simulation file, and any other
-# associated documentation or information provided by Altera or a partner
-# under Altera's Megafunction Partnership Program may be used only
-# to program PLD devices (but not masked PLD devices) from Altera. Any
-# other use of such megafunction design, netlist, support information,
-# device programming or simulation file, or any other related documentation
-# or information is prohibited for any other purpose, including, but not
-# limited to modification, reverse engineering, de-compiling, or use with
-# any other silicon devices, unless such use is explicitly licensed under
-# a separate agreement with Altera or a megafunction partner. Title to the
-# intellectual property, including patents, copyrights, trademarks, trade
-# secrets, or maskworks, embodied in any such megafunction design, netlist,
-# support information, device programming or simulation file, or any other
-# related documentation or information provided by Altera or a megafunction
-# partner, remains with Altera, the megafunction partner, or their respective
-# licensors. No other licenses, including any licenses needed under any third
-# party's intellectual property, are provided herein.
-
-
-
-QUARTUS_VERSION = "4.0"
-DATE = "17:10:11 December 20, 2004"
-
-
-# Active Revisions
-
-PROJECT_REVISION = "usrp_gpio"
diff --git a/gr-gpio/src/fpga/top/usrp_gpio.qsf b/gr-gpio/src/fpga/top/usrp_gpio.qsf
deleted file mode 100644
index cfdcd552b..000000000
--- a/gr-gpio/src/fpga/top/usrp_gpio.qsf
+++ /dev/null
@@ -1,412 +0,0 @@
-# Copyright (C) 1991-2005 Altera Corporation
-# Your use of Altera Corporation's design tools, logic functions
-# and other software and tools, and its AMPP partner logic
-# functions, and any output files any of the foregoing
-# (including device programming or simulation files), and any
-# associated documentation or information are expressly subject
-# to the terms and conditions of the Altera Program License
-# Subscription Agreement, Altera MegaCore Function License
-# Agreement, or other applicable license agreement, including,
-# without limitation, that your use is for the sole purpose of
-# programming logic devices manufactured by Altera and sold by
-# Altera or its authorized distributors. Please refer to the
-# applicable agreement for further details.
-
-
-# The default values for assignments are stored in the file
-# usrp_gpio_assignment_defaults.qdf
-# If this file doesn't exist, and for assignments not listed, see file
-# assignment_defaults.qdf
-
-# Altera recommends that you do not modify this file. This
-# file is updated automatically by the Quartus II software
-# and any changes you make may be lost or overwritten.
-
-
-# Project-Wide Assignments
-# ========================
-set_global_assignment -name ORIGINAL_QUARTUS_VERSION 3.0
-set_global_assignment -name PROJECT_CREATION_TIME_DATE "00:14:04 JULY 13, 2003"
-set_global_assignment -name LAST_QUARTUS_VERSION "7.1 SP1"
-
-# Pin & Location Assignments
-# ==========================
-set_global_assignment -name RESERVE_PIN "AS INPUT TRI-STATED"
-set_location_assignment PIN_29 -to SCLK
-set_location_assignment PIN_117 -to SDI
-set_location_assignment PIN_28 -to usbclk
-set_location_assignment PIN_107 -to usbctl[0]
-set_location_assignment PIN_106 -to usbctl[1]
-set_location_assignment PIN_105 -to usbctl[2]
-set_location_assignment PIN_100 -to usbdata[0]
-set_location_assignment PIN_84 -to usbdata[10]
-set_location_assignment PIN_83 -to usbdata[11]
-set_location_assignment PIN_82 -to usbdata[12]
-set_location_assignment PIN_79 -to usbdata[13]
-set_location_assignment PIN_78 -to usbdata[14]
-set_location_assignment PIN_77 -to usbdata[15]
-set_location_assignment PIN_99 -to usbdata[1]
-set_location_assignment PIN_98 -to usbdata[2]
-set_location_assignment PIN_95 -to usbdata[3]
-set_location_assignment PIN_94 -to usbdata[4]
-set_location_assignment PIN_93 -to usbdata[5]
-set_location_assignment PIN_88 -to usbdata[6]
-set_location_assignment PIN_87 -to usbdata[7]
-set_location_assignment PIN_86 -to usbdata[8]
-set_location_assignment PIN_85 -to usbdata[9]
-set_location_assignment PIN_104 -to usbrdy[0]
-set_location_assignment PIN_101 -to usbrdy[1]
-set_location_assignment PIN_76 -to FX2_1
-set_location_assignment PIN_75 -to FX2_2
-set_location_assignment PIN_74 -to FX2_3
-set_location_assignment PIN_116 -to io_rx_a[0]
-set_location_assignment PIN_115 -to io_rx_a[1]
-set_location_assignment PIN_114 -to io_rx_a[2]
-set_location_assignment PIN_113 -to io_rx_a[3]
-set_location_assignment PIN_108 -to io_rx_a[4]
-set_location_assignment PIN_195 -to io_rx_a[5]
-set_location_assignment PIN_196 -to io_rx_a[6]
-set_location_assignment PIN_197 -to io_rx_a[7]
-set_location_assignment PIN_200 -to io_rx_a[8]
-set_location_assignment PIN_201 -to io_rx_a[9]
-set_location_assignment PIN_202 -to io_rx_a[10]
-set_location_assignment PIN_203 -to io_rx_a[11]
-set_location_assignment PIN_206 -to io_rx_a[12]
-set_location_assignment PIN_207 -to io_rx_a[13]
-set_location_assignment PIN_208 -to io_rx_a[14]
-set_location_assignment PIN_214 -to io_rx_b[0]
-set_location_assignment PIN_215 -to io_rx_b[1]
-set_location_assignment PIN_216 -to io_rx_b[2]
-set_location_assignment PIN_217 -to io_rx_b[3]
-set_location_assignment PIN_218 -to io_rx_b[4]
-set_location_assignment PIN_219 -to io_rx_b[5]
-set_location_assignment PIN_222 -to io_rx_b[6]
-set_location_assignment PIN_223 -to io_rx_b[7]
-set_location_assignment PIN_224 -to io_rx_b[8]
-set_location_assignment PIN_225 -to io_rx_b[9]
-set_location_assignment PIN_226 -to io_rx_b[10]
-set_location_assignment PIN_227 -to io_rx_b[11]
-set_location_assignment PIN_228 -to io_rx_b[12]
-set_location_assignment PIN_233 -to io_rx_b[13]
-set_location_assignment PIN_234 -to io_rx_b[14]
-set_location_assignment PIN_175 -to io_tx_a[0]
-set_location_assignment PIN_176 -to io_tx_a[1]
-set_location_assignment PIN_177 -to io_tx_a[2]
-set_location_assignment PIN_178 -to io_tx_a[3]
-set_location_assignment PIN_179 -to io_tx_a[4]
-set_location_assignment PIN_180 -to io_tx_a[5]
-set_location_assignment PIN_181 -to io_tx_a[6]
-set_location_assignment PIN_182 -to io_tx_a[7]
-set_location_assignment PIN_183 -to io_tx_a[8]
-set_location_assignment PIN_184 -to io_tx_a[9]
-set_location_assignment PIN_185 -to io_tx_a[10]
-set_location_assignment PIN_186 -to io_tx_a[11]
-set_location_assignment PIN_187 -to io_tx_a[12]
-set_location_assignment PIN_188 -to io_tx_a[13]
-set_location_assignment PIN_193 -to io_tx_a[14]
-set_location_assignment PIN_73 -to io_tx_b[0]
-set_location_assignment PIN_68 -to io_tx_b[1]
-set_location_assignment PIN_67 -to io_tx_b[2]
-set_location_assignment PIN_66 -to io_tx_b[3]
-set_location_assignment PIN_65 -to io_tx_b[4]
-set_location_assignment PIN_64 -to io_tx_b[5]
-set_location_assignment PIN_63 -to io_tx_b[6]
-set_location_assignment PIN_62 -to io_tx_b[7]
-set_location_assignment PIN_61 -to io_tx_b[8]
-set_location_assignment PIN_60 -to io_tx_b[9]
-set_location_assignment PIN_59 -to io_tx_b[10]
-set_location_assignment PIN_58 -to io_tx_b[11]
-set_location_assignment PIN_57 -to io_tx_b[12]
-set_location_assignment PIN_56 -to io_tx_b[13]
-set_location_assignment PIN_55 -to io_tx_b[14]
-set_location_assignment PIN_152 -to master_clk
-set_location_assignment PIN_144 -to rx_a_a[0]
-set_location_assignment PIN_143 -to rx_a_a[1]
-set_location_assignment PIN_141 -to rx_a_a[2]
-set_location_assignment PIN_140 -to rx_a_a[3]
-set_location_assignment PIN_139 -to rx_a_a[4]
-set_location_assignment PIN_138 -to rx_a_a[5]
-set_location_assignment PIN_137 -to rx_a_a[6]
-set_location_assignment PIN_136 -to rx_a_a[7]
-set_location_assignment PIN_135 -to rx_a_a[8]
-set_location_assignment PIN_134 -to rx_a_a[9]
-set_location_assignment PIN_133 -to rx_a_a[10]
-set_location_assignment PIN_132 -to rx_a_a[11]
-set_location_assignment PIN_23 -to rx_a_b[0]
-set_location_assignment PIN_21 -to rx_a_b[1]
-set_location_assignment PIN_20 -to rx_a_b[2]
-set_location_assignment PIN_19 -to rx_a_b[3]
-set_location_assignment PIN_18 -to rx_a_b[4]
-set_location_assignment PIN_17 -to rx_a_b[5]
-set_location_assignment PIN_16 -to rx_a_b[6]
-set_location_assignment PIN_15 -to rx_a_b[7]
-set_location_assignment PIN_14 -to rx_a_b[8]
-set_location_assignment PIN_13 -to rx_a_b[9]
-set_location_assignment PIN_12 -to rx_a_b[10]
-set_location_assignment PIN_11 -to rx_a_b[11]
-set_location_assignment PIN_131 -to rx_b_a[0]
-set_location_assignment PIN_128 -to rx_b_a[1]
-set_location_assignment PIN_127 -to rx_b_a[2]
-set_location_assignment PIN_126 -to rx_b_a[3]
-set_location_assignment PIN_125 -to rx_b_a[4]
-set_location_assignment PIN_124 -to rx_b_a[5]
-set_location_assignment PIN_123 -to rx_b_a[6]
-set_location_assignment PIN_122 -to rx_b_a[7]
-set_location_assignment PIN_121 -to rx_b_a[8]
-set_location_assignment PIN_120 -to rx_b_a[9]
-set_location_assignment PIN_119 -to rx_b_a[10]
-set_location_assignment PIN_118 -to rx_b_a[11]
-set_location_assignment PIN_8 -to rx_b_b[0]
-set_location_assignment PIN_7 -to rx_b_b[1]
-set_location_assignment PIN_6 -to rx_b_b[2]
-set_location_assignment PIN_5 -to rx_b_b[3]
-set_location_assignment PIN_4 -to rx_b_b[4]
-set_location_assignment PIN_3 -to rx_b_b[5]
-set_location_assignment PIN_2 -to rx_b_b[6]
-set_location_assignment PIN_240 -to rx_b_b[7]
-set_location_assignment PIN_239 -to rx_b_b[8]
-set_location_assignment PIN_238 -to rx_b_b[9]
-set_location_assignment PIN_237 -to rx_b_b[10]
-set_location_assignment PIN_236 -to rx_b_b[11]
-set_location_assignment PIN_156 -to SDO
-set_location_assignment PIN_153 -to SEN_FPGA
-set_location_assignment PIN_159 -to tx_a[0]
-set_location_assignment PIN_160 -to tx_a[1]
-set_location_assignment PIN_161 -to tx_a[2]
-set_location_assignment PIN_162 -to tx_a[3]
-set_location_assignment PIN_163 -to tx_a[4]
-set_location_assignment PIN_164 -to tx_a[5]
-set_location_assignment PIN_165 -to tx_a[6]
-set_location_assignment PIN_166 -to tx_a[7]
-set_location_assignment PIN_167 -to tx_a[8]
-set_location_assignment PIN_168 -to tx_a[9]
-set_location_assignment PIN_169 -to tx_a[10]
-set_location_assignment PIN_170 -to tx_a[11]
-set_location_assignment PIN_173 -to tx_a[12]
-set_location_assignment PIN_174 -to tx_a[13]
-set_location_assignment PIN_38 -to tx_b[0]
-set_location_assignment PIN_39 -to tx_b[1]
-set_location_assignment PIN_41 -to tx_b[2]
-set_location_assignment PIN_42 -to tx_b[3]
-set_location_assignment PIN_43 -to tx_b[4]
-set_location_assignment PIN_44 -to tx_b[5]
-set_location_assignment PIN_45 -to tx_b[6]
-set_location_assignment PIN_46 -to tx_b[7]
-set_location_assignment PIN_47 -to tx_b[8]
-set_location_assignment PIN_48 -to tx_b[9]
-set_location_assignment PIN_49 -to tx_b[10]
-set_location_assignment PIN_50 -to tx_b[11]
-set_location_assignment PIN_53 -to tx_b[12]
-set_location_assignment PIN_54 -to tx_b[13]
-set_location_assignment PIN_158 -to TXSYNC_A
-set_location_assignment PIN_37 -to TXSYNC_B
-set_location_assignment PIN_235 -to io_rx_b[15]
-set_location_assignment PIN_24 -to io_tx_b[15]
-set_location_assignment PIN_213 -to io_rx_a[15]
-set_location_assignment PIN_194 -to io_tx_a[15]
-set_location_assignment PIN_1 -to MYSTERY_SIGNAL
-
-# Timing Assignments
-# ==================
-set_global_assignment -name INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS OFF
-
-# Analysis & Synthesis Assignments
-# ================================
-set_global_assignment -name SAVE_DISK_SPACE OFF
-set_global_assignment -name DEVICE_FILTER_PACKAGE "ANY QFP"
-set_global_assignment -name DEVICE_FILTER_PIN_COUNT 240
-set_global_assignment -name EDA_DESIGN_ENTRY_SYNTHESIS_TOOL "<None>"
-set_global_assignment -name FAMILY Cyclone
-set_global_assignment -name CYCLONE_OPTIMIZATION_TECHNIQUE BALANCED
-set_global_assignment -name STRATIX_OPTIMIZATION_TECHNIQUE SPEED
-set_global_assignment -name APEX20K_OPTIMIZATION_TECHNIQUE SPEED
-set_global_assignment -name TOP_LEVEL_ENTITY usrp_gpio
-set_global_assignment -name VHDL_SHOW_LMF_MAPPING_MESSAGES OFF
-set_global_assignment -name USER_LIBRARIES "e:\\usrp\\fpga\\megacells"
-set_global_assignment -name AUTO_ENABLE_SMART_COMPILE ON
-
-# Fitter Assignments
-# ==================
-set_global_assignment -name DEVICE EP1C12Q240C8
-set_global_assignment -name CYCLONE_CONFIGURATION_SCHEME "PASSIVE SERIAL"
-set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
-set_global_assignment -name OPTIMIZE_HOLD_TIMING OFF
-set_global_assignment -name OPTIMIZE_TIMING "NORMAL COMPILATION"
-set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF
-set_global_assignment -name IO_PLACEMENT_OPTIMIZATION OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT NORMAL
-set_global_assignment -name INC_PLC_MODE OFF
-set_global_assignment -name ROUTING_BACK_ANNOTATION_MODE OFF
-set_instance_assignment -name IO_STANDARD LVTTL -to usbdata[12]
-set_global_assignment -name STRATIX_DEVICE_IO_STANDARD LVTTL
-set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1
-
-# Timing Analysis Assignments
-# ===========================
-set_global_assignment -name MAX_SCC_SIZE 50
-
-# EDA Netlist Writer Assignments
-# ==============================
-set_global_assignment -name EDA_SIMULATION_TOOL "<None>"
-set_global_assignment -name EDA_TIMING_ANALYSIS_TOOL "<NONE>"
-set_global_assignment -name EDA_BOARD_DESIGN_TOOL "<NONE>"
-set_global_assignment -name EDA_FORMAL_VERIFICATION_TOOL "<NONE>"
-set_global_assignment -name EDA_RESYNTHESIS_TOOL "<NONE>"
-
-# Assembler Assignments
-# =====================
-set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
-set_global_assignment -name GENERATE_RBF_FILE ON
-set_global_assignment -name RESERVE_ALL_UNUSED_PINS_NO_OUTPUT_GND "AS INPUT TRI-STATED"
-set_global_assignment -name AUTO_RESTART_CONFIGURATION OFF
-
-# Simulator Assignments
-# =====================
-set_global_assignment -name START_TIME "0 ns"
-set_global_assignment -name GLITCH_INTERVAL "1 ns"
-
-# Design Assistant Assignments
-# ============================
-set_global_assignment -name DRC_REPORT_TOP_FANOUT OFF
-set_global_assignment -name DRC_REPORT_FANOUT_EXCEEDING OFF
-set_global_assignment -name ASSG_CAT OFF
-set_global_assignment -name ASSG_RULE_MISSING_FMAX OFF
-set_global_assignment -name ASSG_RULE_MISSING_TIMING OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_ASYN_RAM OFF
-set_global_assignment -name CLK_CAT OFF
-set_global_assignment -name CLK_RULE_COMB_CLOCK OFF
-set_global_assignment -name CLK_RULE_INV_CLOCK OFF
-set_global_assignment -name CLK_RULE_GATING_SCHEME OFF
-set_global_assignment -name CLK_RULE_INPINS_CLKNET OFF
-set_global_assignment -name CLK_RULE_CLKNET_CLKSPINES OFF
-set_global_assignment -name CLK_RULE_MIX_EDGES OFF
-set_global_assignment -name RESET_CAT OFF
-set_global_assignment -name RESET_RULE_INPINS_RESETNET OFF
-set_global_assignment -name RESET_RULE_UNSYNCH_EXRESET OFF
-set_global_assignment -name RESET_RULE_IMSYNCH_EXRESET OFF
-set_global_assignment -name RESET_RULE_COMB_ASYNCH_RESET OFF
-set_global_assignment -name RESET_RULE_UNSYNCH_ASYNCH_DOMAIN OFF
-set_global_assignment -name RESET_RULE_IMSYNCH_ASYNCH_DOMAIN OFF
-set_global_assignment -name TIMING_CAT OFF
-set_global_assignment -name TIMING_RULE_SHIFT_REG OFF
-set_global_assignment -name TIMING_RULE_COIN_CLKEDGE OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_COMB_DRIVES_RAM_WE OFF
-set_global_assignment -name NONSYNCHSTRUCT_CAT OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_COMBLOOP OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_REG_LOOP OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_DELAY_CHAIN OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_RIPPLE_CLK OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_ILLEGAL_PULSE_GEN OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_MULTI_VIBRATOR OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_SRLATCH OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_LATCH_UNIDENTIFIED OFF
-set_global_assignment -name SIGNALRACE_CAT OFF
-set_global_assignment -name ACLK_CAT OFF
-set_global_assignment -name ACLK_RULE_NO_SZER_ACLK_DOMAIN OFF
-set_global_assignment -name ACLK_RULE_SZER_BTW_ACLK_DOMAIN OFF
-set_global_assignment -name ACLK_RULE_IMSZER_ADOMAIN OFF
-set_global_assignment -name HCPY_CAT OFF
-set_global_assignment -name HCPY_VREF_PINS OFF
-
-# SignalTap II Assignments
-# ========================
-set_global_assignment -name HUB_ENTITY_NAME SLD_HUB
-set_global_assignment -name HUB_INSTANCE_NAME SLD_HUB_INST
-set_global_assignment -name ENABLE_SIGNALTAP OFF
-
-# LogicLock Region Assignments
-# ============================
-set_global_assignment -name LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT OFF
-
-# -----------------
-# start CLOCK(SCLK)
-
- # Timing Assignments
- # ==================
-set_global_assignment -name DUTY_CYCLE 50 -section_id SCLK
-set_global_assignment -name FMAX_REQUIREMENT "1 MHz" -section_id SCLK
-set_global_assignment -name INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS OFF -section_id SCLK
-
-# end CLOCK(SCLK)
-# ---------------
-
-# -----------------------
-# start CLOCK(master_clk)
-
- # Timing Assignments
- # ==================
-set_global_assignment -name DUTY_CYCLE 50 -section_id master_clk
-set_global_assignment -name FMAX_REQUIREMENT "64 MHz" -section_id master_clk
-set_global_assignment -name INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS OFF -section_id master_clk
-
-# end CLOCK(master_clk)
-# ---------------------
-
-# -------------------
-# start CLOCK(usbclk)
-
- # Timing Assignments
- # ==================
-set_global_assignment -name DUTY_CYCLE 50 -section_id usbclk
-set_global_assignment -name FMAX_REQUIREMENT "48 MHz" -section_id usbclk
-set_global_assignment -name INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS OFF -section_id usbclk
-
-# end CLOCK(usbclk)
-# -----------------
-
-# ----------------------
-# start ENTITY(usrp_gpio)
-
- # Timing Assignments
- # ==================
-set_instance_assignment -name CLOCK_SETTINGS SCLK -to SCLK
-set_instance_assignment -name CLOCK_SETTINGS usbclk -to usbclk
-set_instance_assignment -name CLOCK_SETTINGS master_clk -to master_clk
-
-# end ENTITY(usrp_gpio)
-# --------------------
-
-set_instance_assignment -name PARTITION_HIERARCHY no_file_for_top_partition -to | -section_id Top
-set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
-set_global_assignment -name VERILOG_FILE usrp_gpio.v
-set_global_assignment -name VERILOG_FILE ../lib/gpio_input.v
-set_global_assignment -name VERILOG_FILE ../lib/io_pins.v
-set_global_assignment -name VERILOG_FILE ../lib/rx_chain_dig.v
-set_global_assignment -name VERILOG_FILE ../lib/tx_chain_dig.v
-set_global_assignment -name VERILOG_FILE ../lib/integrator.v
-set_global_assignment -name VERILOG_FILE ../lib/integ_shifter.v
-set_global_assignment -name VERILOG_FILE ../lib/rx_chain.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/atr_delay.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cic_dec_shifter.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rssi.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/ram16.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/megacells/fifo_4k.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/megacells/bustri.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/megacells/fifo_4k_18.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/hb/acc.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/hb/mult.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/hb/ram16_2sum.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/hb/coeff_rom.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/hb/halfband_decim.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/hb/mac.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/tx_chain.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rx_dcoffset.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/adc_interface.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/setting_reg.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/bidir_reg.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cic_int_shifter.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/gen_sync.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/master_control.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rx_buffer.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/tx_buffer.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/phase_acc.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cic_interp.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cic_decim.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cordic_stage.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cordic.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/clk_divider.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/serial_io.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/strobe_gen.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/sign_extend.v \ No newline at end of file
diff --git a/gr-gpio/src/fpga/top/usrp_gpio.v b/gr-gpio/src/fpga/top/usrp_gpio.v
deleted file mode 100644
index 50a0dbe64..000000000
--- a/gr-gpio/src/fpga/top/usrp_gpio.v
+++ /dev/null
@@ -1,467 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2003,2004 Matt Ettus
-// Copyright (C) 2008 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// Top level module for a full setup with DUCs and DDCs
-
-// Define DEBUG_OWNS_IO_PINS if we're using the daughterboard i/o pins
-// for debugging info. NB, This can kill the m'board and/or d'board if you
-// have anything except basic d'boards installed.
-
-// Uncomment the following to include optional circuitry
-
-`include "../top/config.vh"
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module usrp_gpio
-(output MYSTERY_SIGNAL,
- input master_clk,
- input SCLK,
- input SDI,
- inout SDO,
- input SEN_FPGA,
-
- input FX2_1,
- output FX2_2,
- output FX2_3,
-
- input wire [11:0] rx_a_a,
- input wire [11:0] rx_b_a,
- input wire [11:0] rx_a_b,
- input wire [11:0] rx_b_b,
-
- output wire [13:0] tx_a,
- output wire [13:0] tx_b,
-
- output wire TXSYNC_A,
- output wire TXSYNC_B,
-
- // USB interface
- input usbclk,
- input wire [2:0] usbctl,
- output wire [1:0] usbrdy,
- inout [15:0] usbdata, // NB Careful, inout
-
- // These are the general purpose i/o's that go to the daughterboard slots
- inout wire [15:0] io_tx_a,
- inout wire [15:0] io_tx_b,
- inout wire [15:0] io_rx_a,
- inout wire [15:0] io_rx_b
- );
- wire [15:0] debugdata,debugctrl;
- assign MYSTERY_SIGNAL = 1'b0;
-
- wire clk64,clk128;
-
- wire WR = usbctl[0];
- wire RD = usbctl[1];
- wire OE = usbctl[2];
-
- wire have_space, have_pkt_rdy;
- assign usbrdy[0] = have_space;
- assign usbrdy[1] = have_pkt_rdy;
-
- wire tx_underrun, rx_overrun;
- wire clear_status = FX2_1;
- assign FX2_2 = rx_overrun;
- assign FX2_3 = tx_underrun;
-
- wire [15:0] usbdata_out;
-
- wire [3:0] dac0mux,dac1mux,dac2mux,dac3mux;
-
- wire tx_realsignals;
- wire [3:0] rx_numchan;
- wire [2:0] tx_numchan;
-
- wire [7:0] interp_rate, decim_rate;
- wire [31:0] tx_debugbus, rx_debugbus;
-
- wire enable_tx, enable_rx;
- wire tx_dsp_reset, rx_dsp_reset, tx_bus_reset, rx_bus_reset;
- wire [7:0] settings;
-
- // Tri-state bus macro
- bustri bustri( .data(usbdata_out),.enabledt(OE),.tridata(usbdata) );
-
- assign clk64 = master_clk;
-
- wire [15:0] ch0tx,ch1tx,ch2tx,ch3tx; //,ch4tx,ch5tx,ch6tx,ch7tx;
- wire [15:0] ch0rx,ch1rx,ch2rx,ch3rx,ch4rx,ch5rx,ch6rx,ch7rx;
- wire [15:0] ch0rx_ext,ch1rx_ext;
-
- // TX
- wire [15:0] i_out_0,i_out_1,q_out_0,q_out_1;//analog signals
- wire [15:0] bb_tx_i0,bb_tx_q0,bb_tx_i1,bb_tx_q1; // bb_tx_i2,bb_tx_q2,bb_tx_i3,bb_tx_q3;
-
- wire strobe_interp, tx_sample_strobe;
- wire tx_empty;
-
- wire serial_strobe;
- wire [6:0] serial_addr;
- wire [31:0] serial_data;
-
- reg [15:0] debug_counter;
- reg [15:0] loopback_i_0,loopback_q_0;
-
- //TX_DIG streaming digital IO signals
- wire i_out_dig_0,i_out_dig_1,q_out_dig_0,q_out_dig_1;
- wire rx_dig0_i, rx_dig0_q,rx_dig1_i,rx_dig1_q;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Transmit Side
-`ifdef TX_ON
-
- tx_buffer tx_buffer
- ( .usbclk(usbclk), .bus_reset(tx_bus_reset),
- .usbdata(usbdata),.WR(WR), .have_space(have_space),
- .tx_underrun(tx_underrun), .clear_status(clear_status),
- .txclk(clk64), .reset(tx_dsp_reset),
- .channels({tx_numchan,1'b0}),
- .tx_i_0(ch0tx),.tx_q_0(ch1tx),
- .tx_i_1(ch2tx),.tx_q_1(ch3tx),
- .txstrobe(strobe_interp),
- .tx_empty(tx_empty),
- .debugbus(tx_debugbus) );
-
- `ifdef TX_EN_0
- tx_chain tx_chain_0
- ( .clock(clk64),.reset(tx_dsp_reset),.enable(enable_tx),
- .interp_rate(interp_rate),.sample_strobe(tx_sample_strobe),
- .interpolator_strobe(strobe_interp),.freq(),
- .i_in(bb_tx_i0),.q_in(bb_tx_q0),.i_out(i_out_0),.q_out(q_out_0));
- `else
- assign i_out_0=16'd0;
- assign q_out_0=16'd0;
- `endif
-
- `ifdef TX_EN_1
- tx_chain tx_chain_1
- ( .clock(clk64),.reset(tx_dsp_reset),.enable(enable_tx),
- .interp_rate(interp_rate),.sample_strobe(tx_sample_strobe),
- .interpolator_strobe(strobe_interp),.freq(),
- .i_in(bb_tx_i1),.q_in(bb_tx_q1),.i_out(i_out_1),.q_out(q_out_1) );
- `else
- assign i_out_1=16'd0;
- assign q_out_1=16'd0;
- `endif
-
-
-
- setting_reg #(`FR_TX_MUX)
- sr_txmux(.clock(clk64),.reset(tx_dsp_reset),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),
- .out({dac3mux,dac2mux,dac1mux,dac0mux,tx_realsignals,tx_numchan}));
-
- wire [15:0] tx_a_a = dac0mux[3] ? (dac0mux[1] ? (dac0mux[0] ? q_out_1 : i_out_1) : (dac0mux[0] ? q_out_0 : i_out_0)) : 16'b0;
- wire [15:0] tx_b_a = dac1mux[3] ? (dac1mux[1] ? (dac1mux[0] ? q_out_1 : i_out_1) : (dac1mux[0] ? q_out_0 : i_out_0)) : 16'b0;
- wire [15:0] tx_a_b = dac2mux[3] ? (dac2mux[1] ? (dac2mux[0] ? q_out_1 : i_out_1) : (dac2mux[0] ? q_out_0 : i_out_0)) : 16'b0;
- wire [15:0] tx_b_b = dac3mux[3] ? (dac3mux[1] ? (dac3mux[0] ? q_out_1 : i_out_1) : (dac3mux[0] ? q_out_0 : i_out_0)) : 16'b0;
-
- wire tx_dig_a_a = (dac0mux[1] ? (dac0mux[0] ? q_out_dig_1 : i_out_dig_1) : (dac0mux[0] ? q_out_dig_0 : i_out_dig_0));
- wire tx_dig_b_a = (dac1mux[1] ? (dac1mux[0] ? q_out_dig_1 : i_out_dig_1) : (dac1mux[0] ? q_out_dig_0 : i_out_dig_0));
- wire tx_dig_a_b = (dac2mux[1] ? (dac2mux[0] ? q_out_dig_1 : i_out_dig_1) : (dac2mux[0] ? q_out_dig_0 : i_out_dig_0));
- wire tx_dig_b_b = (dac3mux[1] ? (dac3mux[0] ? q_out_dig_1 : i_out_dig_1) : (dac3mux[0] ? q_out_dig_0 : i_out_dig_0));
-
- //wire [1:0] tx_dig_a = {tx_dig_a_a,tx_dig_b_a};
- //wire [1:0] tx_dig_b = {tx_dig_a_b,tx_dig_b_b};
-
- //wire tx_dig_a_chan = (dac0mux[1] | dac1mux[1] );
- //wire tx_dig_b_chan = (dac2mux[1] | dac3mux[1] );
-
- //TODO make enabling tx_dig configurable through register
-
- wire enable_tx_dig_a = 1'b1 & enable_tx;
- wire enable_tx_dig_b = 1'b1 & enable_tx;
-
- wire tx_dig_a_a_en = dac0mux[3] & enable_tx_dig_a;
- wire tx_dig_b_a_en = dac1mux[3] & enable_tx_dig_a;
- wire tx_dig_a_b_en = dac2mux[3] & enable_tx_dig_b;
- wire tx_dig_b_b_en = dac3mux[3] & enable_tx_dig_b;
-
- //TODO make gpio bits used for tx_dig configurable through register
- assign io_tx_a_out = {tx_dig_a_a_en?tx_dig_a_a:reg_0[15],tx_dig_b_a_en?tx_dig_b_a:reg_0[14],reg_0[13:0]};
- assign io_tx_b_out = {tx_dig_a_b_en?tx_dig_a_b:reg_2[15],tx_dig_b_b_en?tx_dig_b_b:reg_2[14],reg_2[13:0]};
- assign io_tx_a_force_output = {tx_dig_a_a_en,tx_dig_b_a_en,14'b0};
- assign io_tx_b_force_output = {tx_dig_a_b_en,tx_dig_b_b_en,14'b0};
-
-
- `ifdef TX_EN_DIG_0
- //TODO make enabling tx_dig configurable through register
- //tx_chain_dig tx_chain_dig_0
- // ( .clock(clk64),.reset(tx_dsp_reset),.enable(enable_tx),
- // .i_in(ch0tx), q_in(ch1tx),
- // .i_out_ana(bb_tx_i0),
- // .q_out_ana(bb_tx_q0),
- // .i_out_dig(i_out_dig_0),
- // .q_out_dig(q_out_dig_0)
- // );
- tx_chain_dig tx_chain_dig_0
- ( .clock(clk64),.reset(tx_dsp_reset),.enable(enable_tx),
- .i_in(ch0tx),.q_in(ch1tx),
- .i_out_ana(bb_tx_i0),.q_out_ana(bb_tx_q0),
- .i_out_dig(i_out_dig_0),.q_out_dig(q_out_dig_0));
- `else
- assign bb_tx_i0 = ch0tx;
- assign bb_tx_q0 = ch1tx;
- assign i_out_dig_0=1'b0;
- assign q_out_dig_0=1'b0;
- `endif
-
- `ifdef TX_EN_DIG_1
- //TODO make enabling tx_dig configurable through register
- tx_chain_dig tx_chain_dig_1
- ( .clock(clk64),.reset(tx_dsp_reset),.enable(enable_tx),
- .i_in(ch2tx),.q_in(ch3tx),
- .i_out_ana(bb_tx_i1),.q_out_ana(bb_tx_q1),
- .i_out_dig(i_out_dig_1),.q_out_dig(q_out_dig_1));
-// tx_chain_dig tx_chain_dig_1
-// ( .clock(clk64),.reset(tx_dsp_reset),.enable(enable_tx),
-// .i_in(ch2tx), q_in(ch3tx),
-// .i_out_ana(bb_tx_i1),
-// .q_out_ana(bb_tx_q1),
-// .i_out_dig(i_out_dig_1),
-// .q_out_dig(q_out_dig_1)
-// );
- `else
- assign bb_tx_i1 = ch2tx;
- assign bb_tx_q1 = ch3tx;
- assign i_out_dig_1=1'b0;
- assign q_out_dig_1=1'b0;
- `endif
-
- wire txsync = tx_sample_strobe;
- assign TXSYNC_A = txsync;
- assign TXSYNC_B = txsync;
-
- assign tx_a = txsync ? tx_b_a[15:2] : tx_a_a[15:2];
- assign tx_b = txsync ? tx_b_b[15:2] : tx_a_b[15:2];
-`else // `ifdef TX_ON
- assign io_tx_a_out = reg_0;
- assign io_tx_b_out = reg_2;
- assign io_tx_a_force_output=16'b0;
- assign io_tx_b_force_output=16'b0;
-`endif
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Receive Side
-`ifdef RX_ON
- wire rx_sample_strobe,strobe_decim,hb_strobe;
- wire [15:0] bb_rx_i0,bb_rx_q0,bb_rx_i1,bb_rx_q1,
- bb_rx_i2,bb_rx_q2,bb_rx_i3,bb_rx_q3;
-
- wire loopback = settings[0];
- wire counter = settings[1];
-
- always @(posedge clk64)
- if(rx_dsp_reset)
- debug_counter <= #1 16'd0;
- else if(~enable_rx)
- debug_counter <= #1 16'd0;
- else if(hb_strobe)
- debug_counter <=#1 debug_counter + 16'd2;
-
- always @(posedge clk64)
- if(strobe_interp)
- begin
- loopback_i_0 <= #1 ch0tx;
- loopback_q_0 <= #1 ch1tx;
- end
-
-
- wire [15:0] ddc0_in_i,ddc0_in_q,ddc1_in_i,ddc1_in_q,ddc2_in_i,ddc2_in_q,ddc3_in_i,ddc3_in_q;
- wire [31:0] rssi_0,rssi_1,rssi_2,rssi_3;
-
- adc_interface adc_interface(.clock(clk64),.reset(rx_dsp_reset),.enable(1'b1),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .rx_a_a(rx_a_a),.rx_b_a(rx_b_a),.rx_a_b(rx_a_b),.rx_b_b(rx_b_b),
- .rssi_0(rssi_0),.rssi_1(rssi_1),.rssi_2(rssi_2),.rssi_3(rssi_3),
- .ddc0_in_i(ddc0_in_i),.ddc0_in_q(ddc0_in_q),
- .ddc1_in_i(ddc1_in_i),.ddc1_in_q(ddc1_in_q),
- .ddc2_in_i(ddc2_in_i),.ddc2_in_q(ddc2_in_q),
- .ddc3_in_i(ddc3_in_i),.ddc3_in_q(ddc3_in_q),.rx_numchan(rx_numchan) );
-
- rx_buffer rx_buffer
- ( .usbclk(usbclk),.bus_reset(rx_bus_reset),.reset(rx_dsp_reset),
- .reset_regs(rx_dsp_reset),
- .usbdata(usbdata_out),.RD(RD),.have_pkt_rdy(have_pkt_rdy),.rx_overrun(rx_overrun),
- .channels(rx_numchan),
- .ch_0(ch0rx_ext),.ch_1(ch1rx_ext),
- .ch_2(ch2rx),.ch_3(ch3rx),
- .ch_4(ch4rx),.ch_5(ch5rx),
- .ch_6(ch6rx),.ch_7(ch7rx),
- .rxclk(clk64),.rxstrobe(hb_strobe),
- .clear_status(clear_status),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .debugbus(rx_debugbus) );
-
- `ifdef RX_EN_0
- rx_chain #(`FR_RX_FREQ_0,`FR_RX_PHASE_0) rx_chain_0
- ( .clock(clk64),.reset(1'b0),.enable(enable_rx),
- .decim_rate(decim_rate),.sample_strobe(rx_sample_strobe),.decimator_strobe(strobe_decim),.hb_strobe(hb_strobe),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .i_in(ddc0_in_i),.q_in(ddc0_in_q),.i_out(bb_rx_i0),.q_out(bb_rx_q0),.debugdata(debugdata),.debugctrl(debugctrl));
- `else
- assign bb_rx_i0=16'd0;
- assign bb_rx_q0=16'd0;
- `endif
-
- `ifdef RX_EN_1
- rx_chain #(`FR_RX_FREQ_1,`FR_RX_PHASE_1) rx_chain_1
- ( .clock(clk64),.reset(1'b0),.enable(enable_rx),
- .decim_rate(decim_rate),.sample_strobe(rx_sample_strobe),.decimator_strobe(strobe_decim),.hb_strobe(),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .i_in(ddc1_in_i),.q_in(ddc1_in_q),.i_out(bb_rx_i1),.q_out(bb_rx_q1));
- `else
- assign bb_rx_i1=16'd0;
- assign bb_rx_q1=16'd0;
- `endif
-
- `ifdef RX_EN_2
- rx_chain #(`FR_RX_FREQ_2,`FR_RX_PHASE_2) rx_chain_2
- ( .clock(clk64),.reset(1'b0),.enable(enable_rx),
- .decim_rate(decim_rate),.sample_strobe(rx_sample_strobe),.decimator_strobe(strobe_decim),.hb_strobe(),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .i_in(ddc2_in_i),.q_in(ddc2_in_q),.i_out(bb_rx_i2),.q_out(bb_rx_q2));
- `else
- assign bb_rx_i2=16'd0;
- assign bb_rx_q2=16'd0;
- `endif
-
- `ifdef RX_EN_3
- rx_chain #(`FR_RX_FREQ_3,`FR_RX_PHASE_3) rx_chain_3
- ( .clock(clk64),.reset(1'b0),.enable(enable_rx),
- .decim_rate(decim_rate),.sample_strobe(rx_sample_strobe),.decimator_strobe(strobe_decim),.hb_strobe(),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .i_in(ddc3_in_i),.q_in(ddc3_in_q),.i_out(bb_rx_i3),.q_out(bb_rx_q3));
- `else
- assign bb_rx_i3=16'd0;
- assign bb_rx_q3=16'd0;
- `endif
-
- `ifdef RX_DIG_ON
- wire enable_rx_dig = 1'b1 & enable_rx;//TODO make enabling rx_dig configurable through register
- assign io_rx_a_force_input = {enable_rx_dig,enable_rx_dig,14'b0};
- assign io_rx_b_force_input = {enable_rx_dig,enable_rx_dig,14'b0};
- gpio_input gpio_input(.clock(clk64),.reset(rx_dsp_reset),.enable(1'b1),
- .out_strobe(hb_strobe),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .io_rx_a_in(io_rx_a),.io_rx_b_in(io_rx_b),
- //.io_tx_a_in(io_tx_a),.io_tx_b_in(io_tx_b),
- .rx_dig0_i(rx_dig0_i),.rx_dig0_q(rx_dig0_q),
- .rx_dig1_i(rx_dig1_i),.rx_dig1_q(rx_dig1_q) );
-
- `ifdef RX_EN_DIG_0
- rx_chain_dig rx_chain_dig_0
- ( .clock(clk64),.reset(rx_dsp_reset),.enable(enable_rx_dig),
- .i_in_ana(bb_rx_i0),.q_in_ana(bb_rx_q0),
- .i_in_dig(rx_dig0_i),.q_in_dig(rx_dig0_q),
- .i_out(ch0rx),.q_out(ch1rx));
- `else
- assign ch0rx = bb_rx_i0;
- assign ch1rx = bb_rx_q0;
- `endif
-
- assign ch0rx_ext = counter ? debug_counter : loopback ? loopback_i_0 : ch0rx;
- assign ch1rx_ext = counter ? debug_counter + 16'd1 : loopback ? loopback_q_0 : ch1rx;
-
- `ifdef RX_EN_DIG_1
- rx_chain_dig rx_chain_dig_1
- ( .clock(clk64),.reset(rx_dsp_reset),.enable(enable_rx_dig),
- .i_in_ana(bb_rx_i1),.q_in_ana(bb_rx_q1),
- .i_in_dig(rx_dig1_i),.q_in_dig(rx_dig1_q),
- .i_out(ch2rx),.q_out(ch3rx));
- `else
- assign ch2rx = bb_rx_i1;
- assign ch3rx = bb_rx_q1;
- `endif
-
- assign ch4rx = bb_rx_i2;
- assign ch5rx = bb_rx_q2;
- assign ch6rx = bb_rx_i3;
- assign ch7rx = bb_rx_q3;
- `else // `ifdef RX_DIG_ON
- assign ch0rx = counter ? debug_counter : loopback ? loopback_i_0 : bb_rx_i0;
- assign ch1rx = counter ? debug_counter + 16'd1 : loopback ? loopback_q_0 : bb_rx_q0;
- assign ch2rx = bb_rx_i1;
- assign ch3rx = bb_rx_q1;
- assign ch4rx = bb_rx_i2;
- assign ch5rx = bb_rx_q2;
- assign ch6rx = bb_rx_i3;
- assign ch7rx = bb_rx_q3;
- `endif // `ifdef RX_DIG_ON
-
-`endif // `ifdef RX_ON
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Control Functions
-
- wire [31:0] capabilities;
- assign capabilities[7] = `TX_CAP_HB;
- assign capabilities[6:4] = `TX_CAP_NCHAN;
- assign capabilities[3] = `RX_CAP_HB;
- assign capabilities[2:0] = `RX_CAP_NCHAN;
-
-
- serial_io serial_io
- ( .master_clk(clk64),.serial_clock(SCLK),.serial_data_in(SDI),
- .enable(SEN_FPGA),.reset(1'b0),.serial_data_out(SDO),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .readback_0({io_rx_a,io_tx_a}),.readback_1({io_rx_b,io_tx_b}),.readback_2(capabilities),.readback_3(32'hf0f0931a),
- .readback_4(rssi_0),.readback_5(rssi_1),.readback_6(rssi_2),.readback_7(rssi_3)
- );
-
- wire [15:0] reg_0,reg_1,reg_2,reg_3;
- wire [15:0] io_tx_a_out;
- wire [15:0] io_tx_b_out;
- wire [15:0] io_tx_a_force_output;
- wire [15:0] io_tx_b_force_output;
- wire [15:0] io_rx_a_force_input;
- wire [15:0] io_rx_b_force_input;
-
- master_control master_control
- ( .master_clk(clk64),.usbclk(usbclk),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .tx_bus_reset(tx_bus_reset),.rx_bus_reset(rx_bus_reset),
- .tx_dsp_reset(tx_dsp_reset),.rx_dsp_reset(rx_dsp_reset),
- .enable_tx(enable_tx),.enable_rx(enable_rx),
- .interp_rate(interp_rate),.decim_rate(decim_rate),
- .tx_sample_strobe(tx_sample_strobe),.strobe_interp(strobe_interp),
- .rx_sample_strobe(rx_sample_strobe),.strobe_decim(strobe_decim),
- .tx_empty(tx_empty),
- //.debug_0(rx_a_a),.debug_1(ddc0_in_i),
- .debug_0(tx_debugbus[15:0]),.debug_1(tx_debugbus[31:16]),
- .debug_2(rx_debugbus[15:0]),.debug_3(rx_debugbus[31:16]),
- //.tx_dig_a(tx_dig_a),tx_dig_b(tx_dig_b),
- .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3) );
-
- io_pins io_pins
- (.io_0(io_tx_a),.io_1(io_rx_a),.io_2(io_tx_b),.io_3(io_rx_b),
- .reg_0(io_tx_a_out),.reg_1(reg_1),.reg_2(io_tx_b_out),.reg_3(reg_3),
- .io_0_force_output(io_tx_a_force_output), .io_2_force_output(io_tx_b_force_output),
- .io_1_force_input(io_rx_a_force_input), .io_3_force_input(io_rx_b_force_input),
- .clock(clk64),.rx_reset(rx_dsp_reset),.tx_reset(tx_dsp_reset),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe));
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Misc Settings
- setting_reg #(`FR_MODE) sr_misc(.clock(clk64),.reset(rx_dsp_reset),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(settings));
-
-endmodule // usrp_gpio
diff --git a/gr-gpio/src/python/Makefile.am b/gr-gpio/src/python/Makefile.am
deleted file mode 100644
index 427047cdf..000000000
--- a/gr-gpio/src/python/Makefile.am
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# Copyright 2007,2008,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-# Installation locations
-ourpythondir = $(grpythondir)/gpio
-ourlibdir = $(grpyexecdir)/gpio
-
-# List of Python files that will get installed into site-packages
-ourpython_PYTHON = \
- __init__.py \
- gpio.py
-
-# List of python files that will be installed onto $prefix/bin
-dist_bin_SCRIPTS = \
- gpio_rx_sfile.py \
- gpio_usrp_siggen.py \
- gpio_usrp_fft.py
diff --git a/gr-gpio/src/python/__init__.py b/gr-gpio/src/python/__init__.py
deleted file mode 100644
index b1f69b7ea..000000000
--- a/gr-gpio/src/python/__init__.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright 2007,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.
-#
-
-import glob
-import os.path
-
-# This automatically imports all top-level objects from .py files
-# in our directory into the package name space
-for _p in __path__:
- _filenames = glob.glob (os.path.join (_p, "*.py"))
- for _f in _filenames:
- _f = os.path.basename(_f).lower()
- _f = _f[:-3]
- if _f == '__init__':
- continue
- exec "from %s import *" % (_f,)
diff --git a/gr-gpio/src/python/gpio.py b/gr-gpio/src/python/gpio.py
deleted file mode 100644
index a315e166b..000000000
--- a/gr-gpio/src/python/gpio.py
+++ /dev/null
@@ -1 +0,0 @@
-fpga_filename = 'std_2rxint_2tx_dig.rbf'
diff --git a/gr-gpio/src/python/gpio_rx_sfile.py b/gr-gpio/src/python/gpio_rx_sfile.py
deleted file mode 100755
index 31f598ef7..000000000
--- a/gr-gpio/src/python/gpio_rx_sfile.py
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008,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, eng_notation
-from gnuradio import usrp
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import sys
-
-from gnuradio import gpio
-
-class my_top_block(gr.top_block):
-
- def __init__(self, options):
- gr.top_block.__init__(self)
-
- # Create a USRP source with GPIO FPGA build, then configure
- u = usrp.source_s(decim_rate=options.decim,fpga_filename=gpio.fpga_filename)
-
- if options.force_complex_RXA:
- # This is a dirty hack to force complex mode (receive both I and Q) on basicRX or LFRX
- # This forces the receive board in RXA (side A) to be used
- # FIXME: This has as a side effect that the gain for Q is not set. So only use with gain 0 (--gain 0)
- options.rx_subdev_spec=(0,0)
- u.set_mux(0x10)
- if not (0==options.gain):
- print "WARNING, you should set the gain to 0 with --gain 0 when using --force-complex-RXA"
- print "The gain for Q will now still be zero while the gain for I is not"
- #options.gain=0
- else:
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = usrp.pick_rx_subdevice(u)
- u.set_mux(usrp.determine_rx_mux_value(u, options.rx_subdev_spec))
-
- subdev = usrp.selected_subdev(u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (subdev.side_and_name(),)
- input_rate = u.adc_freq()/u.decim_rate()
- print "USB sample rate %s" % (eng_notation.num_to_str(input_rate))
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
-
-
- #TODO setting gain on basicRX only sets the I channel, use a second subdev to set gain of Q channel
- #see gnuradio-examples/multi-antenna for possible solutions
- subdev.set_gain(options.gain)
-
- #TODO check if freq has same problem as gain when trying to use complex mode on basicRX
- r = u.tune(0, subdev, options.freq)
- if not r:
- sys.stderr.write('Failed to set frequency\n')
- raise SystemExit, 1
-
- # Connect pipeline
- src = u
- if options.nsamples is not None:
- head = gr.head(gr.sizeof_short, int(options.nsamples)*2)
- self.connect(u, head)
- src = head
-
- ana_strip = gr.and_const_ss(0xFFFE)
- dig_strip = gr.and_const_ss(0x0001)
- ana_sink = gr.file_sink(gr.sizeof_short, options.ana_filename)
- dig_sink = gr.file_sink(gr.sizeof_short, options.dig_filename)
-
- self.connect(src, ana_strip, ana_sink)
- self.connect(src, dig_strip, dig_sink)
-
-if __name__ == '__main__':
- usage="%prog: [options] analog_filename digital_filename"
- parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=(0, 0),
- help="select USRP Rx side A or B (default=A)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-N", "--nsamples", type="eng_float", default=None,
- help="number of samples to collect [default=+inf]")
- parser.add_option("-F", "--force-complex-RXA", action="store_true", default=False,
- help="enable basicRX hack to force complex mode on basicRX and LFRX. Only works on side A. Only use with --gain 0")
- (options, args) = parser.parse_args ()
- if len(args) != 2:
- parser.print_help()
- raise SystemExit, 1
- options.ana_filename = args[0]
- options.dig_filename = args[1]
-
- if options.freq is None:
- parser.print_help()
- sys.stderr.write('You must specify the frequency with -f FREQ\n');
- raise SystemExit, 1
-
- try:
- tb = my_top_block(options)
- tb.run()
- except KeyboardInterrupt:
- pass
diff --git a/gr-gpio/src/python/gpio_usrp_fft.py b/gr-gpio/src/python/gpio_usrp_fft.py
deleted file mode 100755
index c9ecb032d..000000000
--- a/gr-gpio/src/python/gpio_usrp_fft.py
+++ /dev/null
@@ -1,333 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005,2007,2008,2009,2010 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, gru
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
-from optparse import OptionParser
-import wx
-import sys
-import numpy
-
-from gnuradio import gpio
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db[0][0].dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- #if u.db[1][0].dbid() >= 0: #disable the use of RXB
- # return (1, 0)
- return (0, 0)
-
-
-class app_top_block(stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which USRP (0, 1, ...) default is %default",
- metavar="NUM")
-# parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
-# help="select USRP Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-A", "--antenna", default=None,
- help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-d", "--decim", type="int", default=32,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=0.0,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-W", "--waterfall", action="store_true", default=False,
- help="Enable waterfall display")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
-# parser.add_option( "--no-hb", action="store_true", default=False,
-# help="don't use halfband filter in usrp")
- parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
- help="Enable oscilloscope display (default)")
- parser.add_option("-F", "--fft", action="store_true", default=False,
- help="Enable FFT display")
- parser.add_option("-n", "--frame-decim", type="int", default=1,
- help="set oscope frame decimation factor to n [default=1]")
- parser.add_option("-v", "--v-scale", type="eng_float", default=1,
- help="set oscope initial V/div to SCALE [default=%default]")
- parser.add_option("-t", "--t-scale", type="eng_float", default=10e-6,
- help="set oscope initial s/div to SCALE [default=10us]")
- parser.add_option ("--digital", action="store_true", default=False,
- help="show (only) the digital wave on lsb (will be input from gpio pins with special usrp firmware)")
- parser.add_option ("--analog", action="store_true", default=False,
- help="show (only) the analog wave on msbs (will be input from analog inputs)")
- parser.add_option ("--file", default=None,
- help="input from file FILE in stead of USRP (will be input from raw file in interleaved short format)")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
- self.show_debug_info = True
-
- self.u = usrp.source_s(which=options.which, decim_rate=options.decim, fpga_filename=gpio.fpga_filename)
-
- print "Warning: This script only supports boards on RXA, change the script if you want otherwise"
- #options.rx_subdev_spec=(0, 0)#force the use of RXA
- options.rx_subdev_spec=None #force the use of RXA
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- #This hardcoded mux setting is why this script only supports RXA
- #We want both I and Q active, even when using basicRX
- #set to 0x10 for RXA
- #set to 0x32 for RXB
- self.u.set_mux(0x10) #usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
-
- if options.width_8:
- width = 8
- shift = 8
- format = self.u.make_format(width, shift)
- print "format =", hex(format)
- r = self.u.set_format(format)
- print "set_format =", r
-
- # determine the daughterboard subdevice we're using
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- #if options.rx_subdev_spec==(0,0):
- # rx_subdev_spec2=(0,1)
- # self.subdev2 = usrp.selected_subdev(self.u, rx_subdev_spec2)
- input_rate = self.u.adc_freq() / self.u.decim_rate()
-
- if options.waterfall:
- self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=1024, sample_rate=input_rate)
- elif options.fft:
- self.scope = fftsink2.fft_sink_c (panel, fft_size=1024, sample_rate=input_rate)
- else: # options.oscilloscope:
- #self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate,
- frame_decim=options.frame_decim,
- v_scale=options.v_scale,
- t_scale=options.t_scale)
-
- self.is2c = gr.interleaved_short_to_complex()
- if not (options.file is None):
- self.filesrc=gr.file_source(gr.sizeof_short, options.file, True)
- thr = gr.throttle(gr.sizeof_short, input_rate)
- self.connect(self.filesrc,thr,self.is2c,self.scope)
- elif options.digital:
- self.select_dig=gr.and_const_ss(0x0001)
- self.connect(self.u, self.select_dig,self.is2c,self.scope)
- elif options.analog:
- self.select_ana=gr.and_const_ss(0xFFFE)
- self.connect(self.u, self.select_ana,self.is2c,self.scope)
- else:
- self.connect(self.u,self.is2c,self.scope)
-
- self._build_gui(vbox)
- self._setup_events()
-
- # set initial values
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
-
- if options.freq is None:
- # if no freq was specified, use the mid-point
- r = self.subdev.freq_range()
- options.freq = float(r[0]+r[1])/2
-
- self.set_gain(options.gain)
-
- if options.antenna is not None:
- print "Selecting antenna %s" % (options.antenna,)
- self.subdev.select_rx_antenna(options.antenna)
-
- if self.show_debug_info:
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- self.myform['dbname'].set_value(self.subdev.name())
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- vbox.Add(self.scope.win, 10, wx.EXPAND)
-
- # add control area at the bottom
- self.myform = myform = form.form()
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0, 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0, 0)
- g = self.subdev.gain_range()
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3,
- min=int(g[0]), max=int(g[1]),
- callback=self.set_gain)
-
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- self._build_subpanel(vbox)
-
- def _build_subpanel(self, vbox_arg):
- # build a secondary information panel (sometimes hidden)
-
- # FIXME figure out how to have this be a subpanel that is always
- # created, but has its visibility controlled by foo.Show(True/False)
-
- def _form_set_decim(kv):
- return self.set_decim(kv['decim'])
-
- if not(self.show_debug_info):
- return
-
- panel = self.panel
- vbox = vbox_arg
- myform = self.myform
-
- #panel = wx.Panel(self.panel, -1)
- #vbox = wx.BoxSizer(wx.VERTICAL)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['decim'] = form.int_field(
- parent=panel, sizer=hbox, label="Decim",
- callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
-
- hbox.Add((5,0), 1)
- myform['fs@usb'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@USB")
-
- hbox.Add((5,0), 1)
- myform['dbname'] = form.static_text_field(
- parent=panel, sizer=hbox)
-
- hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
-
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.tune(0, self.subdev, target_freq)
-
- if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
- if self.show_debug_info:
- self.myform['baseband'].set_value(r.baseband_freq)
- self.myform['ddc'].set_value(r.dxc_freq)
- if not self.options.waterfall and not self.options.oscilloscope:
- self.scope.set_baseband_freq(target_freq)
- return True
-
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
-
- def set_decim(self, decim):
- ok = self.u.set_decim_rate(decim)
- if not ok:
- print "set_decim failed"
- input_rate = self.u.adc_freq() / self.u.decim_rate()
- self.scope.set_sample_rate(input_rate)
- if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- return ok
-
- def _setup_events(self):
- if not self.options.waterfall and not self.options.oscilloscope:
- self.scope.win.Bind(wx.EVT_LEFT_DCLICK, self.evt_left_dclick)
-
- def evt_left_dclick(self, event):
- (ux, uy) = self.scope.win.GetXY(event)
- if event.CmdDown():
- # Re-center on maximum power
- points = self.scope.win._points
- if self.scope.win.peak_hold:
- if self.scope.win.peak_vals is not None:
- ind = numpy.argmax(self.scope.win.peak_vals)
- else:
- ind = int(points.shape()[0]/2)
- else:
- ind = numpy.argmax(points[:,1])
- (freq, pwr) = points[ind]
- target_freq = freq/self.scope.win._scale_factor
- print ind, freq, pwr
- self.set_freq(target_freq)
- else:
- # Re-center on clicked frequency
- target_freq = ux/self.scope.win._scale_factor
- self.set_freq(target_freq)
-
-
-def main ():
- app = stdgui2.stdapp(app_top_block, "USRP FFT", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-gpio/src/python/gpio_usrp_siggen.py b/gr-gpio/src/python/gpio_usrp_siggen.py
deleted file mode 100755
index 0e483c35d..000000000
--- a/gr-gpio/src/python/gpio_usrp_siggen.py
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-from gnuradio import gr, gru
-from gnuradio import usrp
-from gnuradio.eng_option import eng_option
-from gnuradio import eng_notation
-from optparse import OptionParser
-import sys
-
-from gnuradio import gpio
-
-class my_top_block(gr.top_block):
- def __init__ (self):
- gr.top_block.__init__(self)
-
- # controllable values
- self.interp = 64
- self.waveform_type = gr.GR_CONST_WAVE
- self.waveform_ampl = 16000
- self.waveform_freq = 100.12345e3
- self.waveform_offset = 0
- self._instantiate_blocks ()
- self.set_waveform_type (self.waveform_type)
-
- def usb_freq (self):
- return self.u.dac_freq() / self.interp
-
- def usb_throughput (self):
- return self.usb_freq () * 4
-
- def set_waveform_type (self, type):
- '''
- valid waveform types are: gr.GR_SIN_WAVE, gr.GR_CONST_WAVE,
- gr.GR_UNIFORM and gr.GR_GAUSSIAN
- '''
- self._configure_graph (type)
- self.waveform_type = type
-
- def set_waveform_ampl (self, ampl):
- self.waveform_ampl = ampl
- self.siggen.set_amplitude (ampl)
- self.noisegen.set_amplitude (ampl)
-
- def set_waveform_freq (self, freq):
- self.waveform_freq = freq
- self.siggen.set_frequency (freq)
-
- def set_waveform_offset (self, offset):
- self.waveform_offset = offset
- self.siggen.set_offset (offset)
-
- def set_interpolator (self, interp):
- self.interp = interp
- self.siggen.set_sampling_freq (self.usb_freq ())
- self.u.set_interp_rate (interp)
-
- def _instantiate_blocks (self):
- self.src = None
- self.u = usrp.sink_c (0, self.interp,fpga_filename=gpio.fpga_filename)
-
- self.siggen = gr.sig_source_c (self.usb_freq (),
- gr.GR_SIN_WAVE,
- self.waveform_freq,
- self.waveform_ampl,
- self.waveform_offset)
-
- self.noisegen = gr.noise_source_c (gr.GR_UNIFORM,
- self.waveform_ampl)
- self.vecgen = gr.vector_source_c ([complex(1.0,0.0),complex(0.0,0.0),complex(1.0,1.0),complex(0.0,1.0)],True)
-
- # self.file_sink = gr.file_sink (gr.sizeof_gr_complex, "siggen.dat")
-
- def _configure_graph (self, type):
- try:
- self.lock()
- self.disconnect_all ()
- if type == gr.GR_SIN_WAVE:
- self.connect (self.siggen, self.u)
- # self.connect (self.siggen, self.file_sink)
- self.siggen.set_waveform (type)
- self.src = self.siggen
- elif type == gr.GR_UNIFORM or type == gr.GR_GAUSSIAN:
- self.connect (self.noisegen, self.u)
- self.noisegen.set_type (type)
- self.src = self.noisegen
- elif type == gr.GR_CONST_WAVE:
- self.connect (self.vecgen, self.u)
- self.src = self.vecgen
- else:
- raise ValueError, type
- finally:
- self.unlock()
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital up converter.
- """
- r = self.u.tune(self.subdev._which, self.subdev, target_freq)
- if r:
- #print "r.baseband_freq =", eng_notation.num_to_str(r.baseband_freq)
- #print "r.dxc_freq =", eng_notation.num_to_str(r.dxc_freq)
- #print "r.residual_freq =", eng_notation.num_to_str(r.residual_freq)
- #print "r.inverted =", r.inverted
- return True
-
- return False
-
-
-
-def main ():
- parser = OptionParser (option_class=eng_option)
- parser.add_option ("-T", "--tx-subdev-spec", type="subdev", default=(0, 0),
- help="select USRP Tx side A or B")
- parser.add_option ("-f", "--rf-freq", type="eng_float", default=None,
- help="set RF center frequency to FREQ")
- parser.add_option ("-i", "--interp", type="int", default=512,
- help="set fgpa interpolation rate to INTERP [default=%default]")
- parser.add_option ("--sine", dest="type", action="store_const", const=gr.GR_SIN_WAVE,
- help="generate a complex sinusoid [default]", default=gr.GR_SIN_WAVE)
-
- parser.add_option ("--gaussian", dest="type", action="store_const", const=gr.GR_GAUSSIAN,
- help="generate Gaussian random output")
- parser.add_option ("--uniform", dest="type", action="store_const", const=gr.GR_UNIFORM,
- help="generate Uniform random output")
-
- parser.add_option ("-w", "--waveform-freq", type="eng_float", default=100e3,
- help="set waveform frequency to FREQ [default=%default]")
- parser.add_option ("-a", "--amplitude", type="eng_float", default=16e3,
- help="set waveform amplitude to AMPLITUDE [default=%default]", metavar="AMPL")
- parser.add_option ("-g", "--gain", type="eng_float", default=None,
- help="set output gain to GAIN [default=%default]")
- parser.add_option ("-o", "--offset", type="eng_float", default=0,
- help="set waveform offset to OFFSET [default=%default]")
- parser.add_option ("--digital", dest="type", action="store_const", const=gr.GR_CONST_WAVE,
- help="generate (only) a digital wave on lsb (will be output on gpio pins with special usrp firmware)")
- (options, args) = parser.parse_args ()
-
- if len(args) != 0:
- parser.print_help()
- raise SystemExit
-
- if options.rf_freq is None:
- sys.stderr.write("usrp_siggen: must specify RF center frequency with -f RF_FREQ\n")
- parser.print_help()
- raise SystemExit
-
- tb = my_top_block()
- tb.set_interpolator (options.interp)
- tb.set_waveform_type (options.type)
- tb.set_waveform_freq (options.waveform_freq)
- tb.set_waveform_ampl (options.amplitude)
- tb.set_waveform_offset (options.offset)
-
- # determine the daughterboard subdevice we're using
- if options.tx_subdev_spec is None:
- options.tx_subdev_spec = usrp.pick_tx_subdevice(tb.u)
-
- m = usrp.determine_tx_mux_value(tb.u, options.tx_subdev_spec)
- #print "mux = %#04x" % (m,)
- tb.u.set_mux(m)
- tb.subdev = usrp.selected_subdev(tb.u, options.tx_subdev_spec)
- print "Using TX d'board %s" % (tb.subdev.side_and_name(),)
-
- if options.gain is None:
- tb.subdev.set_gain(tb.subdev.gain_range()[1]) # set max Tx gain
- else:
- tb.subdev.set_gain(options.gain) # set max Tx gain
-
- if not tb.set_freq(options.rf_freq):
- sys.stderr.write('Failed to set RF frequency\n')
- raise SystemExit
-
- tb.subdev.set_enable(True) # enable transmitter
-
- try:
- tb.run()
- except KeyboardInterrupt:
- pass
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-gsm-fr-vocoder/.gitignore b/gr-gsm-fr-vocoder/.gitignore
deleted file mode 100644
index f3462d009..000000000
--- a/gr-gsm-fr-vocoder/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-/Makefile
-/Makefile.in
-/aclocal.m4
-/configure
-/config.h.in
-/stamp-h.in
-/libtool
-/config.log
-/config.h
-/config.cache
-/config.status
-/missing
-/stamp-h
-/stamp-h1
-/.deps
-/.libs
-/*.la
-/*.lo
-/autom4te.cache
-/*.cache
-/missing
-/make.log
-/*.pc
diff --git a/gr-gsm-fr-vocoder/gnuradio-gsm-fr-vocoder.pc.in b/gr-gsm-fr-vocoder/gnuradio-gsm-fr-vocoder.pc.in
deleted file mode 100644
index a799fcd82..000000000
--- a/gr-gsm-fr-vocoder/gnuradio-gsm-fr-vocoder.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: gnuradio-comedi
-Description: GNU Radio blocks implementing a GSM full rate vocoder
-Requires: gnuradio-core
-Version: @LIBVER@
-Libs: -L${libdir} -lgnuradio-gsm-fr-vocoder-$@LIBVER@
-Cflags: -I${includedir}
diff --git a/gr-gsm-fr-vocoder/src/.gitignore b/gr-gsm-fr-vocoder/src/.gitignore
deleted file mode 100644
index bb3f27777..000000000
--- a/gr-gsm-fr-vocoder/src/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/howto.cc
-/howto.py
diff --git a/gr-gsm-fr-vocoder/src/Makefile.am b/gr-gsm-fr-vocoder/src/Makefile.am
deleted file mode 100644
index be38b7c1a..000000000
--- a/gr-gsm-fr-vocoder/src/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright 2004 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.
-#
-
-SUBDIRS = lib
-if PYTHON
-SUBDIRS += python
-endif
diff --git a/gr-gsm-fr-vocoder/src/lib/.gitignore b/gr-gsm-fr-vocoder/src/lib/.gitignore
deleted file mode 100644
index 5cf6fde83..000000000
--- a/gr-gsm-fr-vocoder/src/lib/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
-/gsm_full_rate.py
-/gsm_full_rate.cc
-/*.pyc
-/gnuradio
-/guile
-/python
diff --git a/gr-gsm-fr-vocoder/src/lib/Makefile.am b/gr-gsm-fr-vocoder/src/lib/Makefile.am
deleted file mode 100644
index 4ce65bc31..000000000
--- a/gr-gsm-fr-vocoder/src/lib/Makefile.am
+++ /dev/null
@@ -1,61 +0,0 @@
-#
-# Copyright 2004,2005,2008,2009,2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-include $(top_srcdir)/Makefile.swig
-
-SUBDIRS = gsm .
-
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
-
-# C/C++ headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS = \
- gsm_fr_decode_ps.h \
- gsm_fr_encode_sp.h
-
-lib_LTLIBRARIES = libgnuradio-gsm-fr-vocoder.la
-
-libgnuradio_gsm_fr_vocoder_la_SOURCES = \
- gsm_fr_decode_ps.cc \
- gsm_fr_encode_sp.cc
-
-libgnuradio_gsm_fr_vocoder_la_LIBADD = \
- $(GNURADIO_CORE_LA) \
- gsm/libgsm.la
-
-libgnuradio_gsm_fr_vocoder_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-
-# SWIG interface and library
-TOP_SWIG_IFILES = \
- gsm_full_rate.i
-
-# Install so that they end up available as:
-# import gnuradio.vocoder.gsm_full_rate
-# This ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
-gsm_full_rate_pythondir_category = \
- gnuradio/vocoder
-
-# additional libraries for linking with the SWIG-generated library
-gsm_full_rate_la_swig_libadd = \
- libgnuradio-gsm-fr-vocoder.la
-
diff --git a/gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen b/gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen
deleted file mode 100644
index 77776abd8..000000000
--- a/gr-gsm-fr-vocoder/src/lib/Makefile.swig.gen
+++ /dev/null
@@ -1,145 +0,0 @@
-# -*- Makefile -*-
-#
-# 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.
-#
-
-# Makefile.swig.gen for gsm_full_rate.i
-
-## Default install locations for these files:
-##
-## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/gsm_full_rate
-## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gsm_full_rate
-##
-## The following can be overloaded to change the install location, but
-## this has to be done in the including Makefile.am -before-
-## Makefile.swig is included.
-
-gsm_full_rate_pythondir_category ?= gnuradio/gsm_full_rate
-gsm_full_rate_pylibdir_category ?= $(gsm_full_rate_pythondir_category)
-gsm_full_rate_pythondir = $(pythondir)/$(gsm_full_rate_pythondir_category)
-gsm_full_rate_pylibdir = $(pyexecdir)/$(gsm_full_rate_pylibdir_category)
-
-# The .so libraries for the guile modules get installed whereever guile
-# is installed, usually /usr/lib/guile/gnuradio/
-# FIXME: determince whether these should be installed with gnuradio.
-gsm_full_rate_scmlibdir = $(libdir)
-
-# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/gsm_full_rate
-# FIXME: determince whether these should be installed with gnuradio.
-gsm_full_rate_scmdir = $(guiledir)
-
-## SWIG headers are always installed into the same directory.
-
-gsm_full_rate_swigincludedir = $(swigincludedir)
-
-## This is a template file for a "generated" Makefile addition (in
-## this case, "Makefile.swig.gen"). By including the top-level
-## Makefile.swig, this file will be used to generate the SWIG
-## dependencies. Assign the variable TOP_SWIG_FILES to be the list of
-## SWIG .i files to generated wrappings for; there can be more than 1
-## so long as the names are unique (no sorting is done on the
-## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
-## file will generate .cc, .py, and possibly .h files -- meaning that
-## all of these files will have the same base name (that provided for
-## the SWIG .i file).
-##
-## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
-## right thing. For more info, see <
-## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
-
-## Other cleaned files: dependency files generated by SWIG or this Makefile
-
-MOSTLYCLEANFILES += $(DEPDIR)/*.S*
-
-## Various SWIG variables. These can be overloaded in the including
-## Makefile.am by setting the variable value there, then including
-## Makefile.swig .
-
-gsm_full_rate_swiginclude_HEADERS = \
- gsm_full_rate.i \
- $(gsm_full_rate_swiginclude_headers)
-
-if PYTHON
-gsm_full_rate_pylib_LTLIBRARIES = \
- _gsm_full_rate.la
-
-_gsm_full_rate_la_SOURCES = \
- python/gsm_full_rate.cc \
- $(gsm_full_rate_la_swig_sources)
-
-gsm_full_rate_python_PYTHON = \
- gsm_full_rate.py \
- $(gsm_full_rate_python)
-
-_gsm_full_rate_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(gsm_full_rate_la_swig_libadd)
-
-_gsm_full_rate_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(gsm_full_rate_la_swig_ldflags)
-
-_gsm_full_rate_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(gsm_full_rate_la_swig_cxxflags)
-
-python/gsm_full_rate.cc: gsm_full_rate.py
-gsm_full_rate.py: gsm_full_rate.i
-
-# Include the python dependencies for this file
--include python/gsm_full_rate.d
-
-endif # end of if python
-
-if GUILE
-
-gsm_full_rate_scmlib_LTLIBRARIES = \
- libguile-gnuradio-gsm_full_rate.la
-libguile_gnuradio_gsm_full_rate_la_SOURCES = \
- guile/gsm_full_rate.cc \
- $(gsm_full_rate_la_swig_sources)
-nobase_gsm_full_rate_scm_DATA = \
- gnuradio/gsm_full_rate.scm \
- gnuradio/gsm_full_rate-primitive.scm
-libguile_gnuradio_gsm_full_rate_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(gsm_full_rate_la_swig_libadd)
-libguile_gnuradio_gsm_full_rate_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(gsm_full_rate_la_swig_ldflags)
-libguile_gnuradio_gsm_full_rate_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(gsm_full_rate_la_swig_cxxflags)
-
-guile/gsm_full_rate.cc: gnuradio/gsm_full_rate.scm
-gnuradio/gsm_full_rate.scm: gsm_full_rate.i
-gnuradio/gsm_full_rate-primitive.scm: gnuradio/gsm_full_rate.scm
-
-# Include the guile dependencies for this file
--include guile/gsm_full_rate.d
-
-endif # end of GUILE
-
-
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/.gitignore b/gr-gsm-fr-vocoder/src/lib/gsm/.gitignore
deleted file mode 100644
index a02b6ff73..000000000
--- a/gr-gsm-fr-vocoder/src/lib/gsm/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/Makefile
-/Makefile.in
-/.la
-/.lo
-/.deps
-/.libs
-/*.la
-/*.lo
diff --git a/gr-gsm-fr-vocoder/src/python/run_tests.in b/gr-gsm-fr-vocoder/src/python/run_tests.in
deleted file mode 100644
index 96eefc559..000000000
--- a/gr-gsm-fr-vocoder/src/python/run_tests.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# 1st parameter is absolute path to component source directory
-# 2nd parameter is absolute path to component build directory
-# 3rd parameter is path to Python QA directory
-
-@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-gsm-fr-vocoder \
- @abs_top_builddir@/gr-gsm-fr-vocoder \
- @srcdir@
diff --git a/gr-howto-write-a-block/version.sh b/gr-howto-write-a-block/version.sh
index 05ffe83b4..83f05bf2b 100644
--- a/gr-howto-write-a-block/version.sh
+++ b/gr-howto-write-a-block/version.sh
@@ -1,4 +1,4 @@
MAJOR_VERSION=3
-API_COMPAT=4
-MINOR_VERSION=2
-MAINT_VERSION=git
+API_COMPAT=5
+MINOR_VERSION=0
+MAINT_VERSION=0
diff --git a/gr-msdd6000/Makefile.am b/gr-msdd6000/Makefile.am
deleted file mode 100644
index 89405d08c..000000000
--- a/gr-msdd6000/Makefile.am
+++ /dev/null
@@ -1,27 +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 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = src
-
-pkgconfigdir = $(libdir)/pkgconfig
-dist_pkgconfig_DATA = gnuradio-msdd6000.pc
diff --git a/gr-msdd6000/doc/Softronics_Ltd_msdd6000_BlockDiagram.pdf b/gr-msdd6000/doc/Softronics_Ltd_msdd6000_BlockDiagram.pdf
deleted file mode 100644
index 34356da75..000000000
--- a/gr-msdd6000/doc/Softronics_Ltd_msdd6000_BlockDiagram.pdf
+++ /dev/null
Binary files differ
diff --git a/gr-msdd6000/src/.gitignore b/gr-msdd6000/src/.gitignore
deleted file mode 100644
index 3b0356f86..000000000
--- a/gr-msdd6000/src/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/Makefile.in
-/.libs
-/.deps
-/msdd.cc
-/msdd.py
-/msdd_rs.cc
-/msdd_rs.py
-/gnuradio
-/guile
-/python
diff --git a/gr-msdd6000/src/Makefile.am b/gr-msdd6000/src/Makefile.am
deleted file mode 100644
index 91173702f..000000000
--- a/gr-msdd6000/src/Makefile.am
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# Copyright 2007,2008,2009,2010 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.
-#
-
-include $(top_srcdir)/Makefile.common
-include $(top_srcdir)/Makefile.swig
-
-
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
- $(WITH_INCLUDES)
-
-# C/C++ headers get installed in ${prefix}/include/gnuradio
-grinclude_HEADERS = \
- msdd_source_simple.h \
- msdd_buffer_copy_behaviors.h \
- msdd6000.h \
- msdd_rs_source_simple.h \
- msdd6000_rs.h
-
-lib_LTLIBRARIES = libgnuradio-msdd6000.la \
- libgnuradio-msdd6000_rs.la
-
-libgnuradio_msdd6000_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-libgnuradio_msdd6000_rs_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
-
-libgnuradio_msdd6000_la_SOURCES = \
- msdd_source_simple.cc \
- msdd6000.cc
-
-libgnuradio_msdd6000_rs_la_SOURCES = \
- msdd_rs_source_simple.cc \
- msdd6000_rs.cc
-
-libgnuradio_msdd6000_la_LIBADD = \
- $(GNURADIO_CORE_LA)
-
-libgnuradio_msdd6000_rs_la_LIBADD = \
- $(GNURADIO_CORE_LA)
-
-
-#################################
-# SWIG interfaces and libraries
-
-TOP_SWIG_IFILES = \
- msdd.i msdd_rs.i
-
-# Install so that they end up available as:
-# import gnuradio.msdd
-# This ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio
-msdd_pythondir_category = \
- gnuradio
-
-msdd_rs_pythondir_category = \
- gnuradio
-
-# additional libraries for linking with the SWIG-generated library
-msdd_la_swig_libadd = \
- libgnuradio-msdd6000.la
-
-msdd_rs_la_swig_libadd = \
- libgnuradio-msdd6000_rs.la
diff --git a/gr-msdd6000/src/Makefile.swig.gen b/gr-msdd6000/src/Makefile.swig.gen
deleted file mode 100644
index dbf137334..000000000
--- a/gr-msdd6000/src/Makefile.swig.gen
+++ /dev/null
@@ -1,290 +0,0 @@
-# -*- Makefile -*-
-#
-# 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.
-#
-
-# Makefile.swig.gen for msdd.i
-
-## Default install locations for these files:
-##
-## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/msdd
-## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/msdd
-##
-## The following can be overloaded to change the install location, but
-## this has to be done in the including Makefile.am -before-
-## Makefile.swig is included.
-
-msdd_pythondir_category ?= gnuradio/msdd
-msdd_pylibdir_category ?= $(msdd_pythondir_category)
-msdd_pythondir = $(pythondir)/$(msdd_pythondir_category)
-msdd_pylibdir = $(pyexecdir)/$(msdd_pylibdir_category)
-
-# The .so libraries for the guile modules get installed whereever guile
-# is installed, usually /usr/lib/guile/gnuradio/
-# FIXME: determince whether these should be installed with gnuradio.
-msdd_scmlibdir = $(libdir)
-
-# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/msdd
-# FIXME: determince whether these should be installed with gnuradio.
-msdd_scmdir = $(guiledir)
-
-## SWIG headers are always installed into the same directory.
-
-msdd_swigincludedir = $(swigincludedir)
-
-## This is a template file for a "generated" Makefile addition (in
-## this case, "Makefile.swig.gen"). By including the top-level
-## Makefile.swig, this file will be used to generate the SWIG
-## dependencies. Assign the variable TOP_SWIG_FILES to be the list of
-## SWIG .i files to generated wrappings for; there can be more than 1
-## so long as the names are unique (no sorting is done on the
-## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
-## file will generate .cc, .py, and possibly .h files -- meaning that
-## all of these files will have the same base name (that provided for
-## the SWIG .i file).
-##
-## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
-## right thing. For more info, see <
-## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
-
-## Other cleaned files: dependency files generated by SWIG or this Makefile
-
-MOSTLYCLEANFILES += $(DEPDIR)/*.S*
-
-## Various SWIG variables. These can be overloaded in the including
-## Makefile.am by setting the variable value there, then including
-## Makefile.swig .
-
-msdd_swiginclude_HEADERS = \
- msdd.i \
- $(msdd_swiginclude_headers)
-
-if PYTHON
-msdd_pylib_LTLIBRARIES = \
- _msdd.la
-
-_msdd_la_SOURCES = \
- python/msdd.cc \
- $(msdd_la_swig_sources)
-
-msdd_python_PYTHON = \
- msdd.py \
- $(msdd_python)
-
-_msdd_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(msdd_la_swig_libadd)
-
-_msdd_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(msdd_la_swig_ldflags)
-
-_msdd_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(msdd_la_swig_cxxflags)
-
-python/msdd.cc: msdd.py
-msdd.py: msdd.i
-
-# Include the python dependencies for this file
--include python/msdd.d
-
-endif # end of if python
-
-if GUILE
-
-msdd_scmlib_LTLIBRARIES = \
- libguile-gnuradio-msdd.la
-libguile_gnuradio_msdd_la_SOURCES = \
- guile/msdd.cc \
- $(msdd_la_swig_sources)
-nobase_msdd_scm_DATA = \
- gnuradio/msdd.scm \
- gnuradio/msdd-primitive.scm
-libguile_gnuradio_msdd_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(msdd_la_swig_libadd)
-libguile_gnuradio_msdd_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(msdd_la_swig_ldflags)
-libguile_gnuradio_msdd_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(msdd_la_swig_cxxflags)
-
-guile/msdd.cc: gnuradio/msdd.scm
-gnuradio/msdd.scm: msdd.i
-gnuradio/msdd-primitive.scm: gnuradio/msdd.scm
-
-# Include the guile dependencies for this file
--include guile/msdd.d
-
-endif # end of GUILE
-
-
-# -*- Makefile -*-
-#
-# 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.
-#
-
-# Makefile.swig.gen for msdd_rs.i
-
-## Default install locations for these files:
-##
-## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/msdd_rs
-## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/msdd_rs
-##
-## The following can be overloaded to change the install location, but
-## this has to be done in the including Makefile.am -before-
-## Makefile.swig is included.
-
-msdd_rs_pythondir_category ?= gnuradio/msdd_rs
-msdd_rs_pylibdir_category ?= $(msdd_rs_pythondir_category)
-msdd_rs_pythondir = $(pythondir)/$(msdd_rs_pythondir_category)
-msdd_rs_pylibdir = $(pyexecdir)/$(msdd_rs_pylibdir_category)
-
-# The .so libraries for the guile modules get installed whereever guile
-# is installed, usually /usr/lib/guile/gnuradio/
-# FIXME: determince whether these should be installed with gnuradio.
-msdd_rs_scmlibdir = $(libdir)
-
-# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/msdd_rs
-# FIXME: determince whether these should be installed with gnuradio.
-msdd_rs_scmdir = $(guiledir)
-
-## SWIG headers are always installed into the same directory.
-
-msdd_rs_swigincludedir = $(swigincludedir)
-
-## This is a template file for a "generated" Makefile addition (in
-## this case, "Makefile.swig.gen"). By including the top-level
-## Makefile.swig, this file will be used to generate the SWIG
-## dependencies. Assign the variable TOP_SWIG_FILES to be the list of
-## SWIG .i files to generated wrappings for; there can be more than 1
-## so long as the names are unique (no sorting is done on the
-## TOP_SWIG_FILES list). This file explicitly assumes that a SWIG .i
-## file will generate .cc, .py, and possibly .h files -- meaning that
-## all of these files will have the same base name (that provided for
-## the SWIG .i file).
-##
-## This code is setup to ensure parallel MAKE ("-j" or "-jN") does the
-## right thing. For more info, see <
-## http://sources.redhat.com/automake/automake.html#Multiple-Outputs >
-
-## Other cleaned files: dependency files generated by SWIG or this Makefile
-
-MOSTLYCLEANFILES += $(DEPDIR)/*.S*
-
-## Various SWIG variables. These can be overloaded in the including
-## Makefile.am by setting the variable value there, then including
-## Makefile.swig .
-
-msdd_rs_swiginclude_HEADERS = \
- msdd_rs.i \
- $(msdd_rs_swiginclude_headers)
-
-if PYTHON
-msdd_rs_pylib_LTLIBRARIES = \
- _msdd_rs.la
-
-_msdd_rs_la_SOURCES = \
- python/msdd_rs.cc \
- $(msdd_rs_la_swig_sources)
-
-msdd_rs_python_PYTHON = \
- msdd_rs.py \
- $(msdd_rs_python)
-
-_msdd_rs_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(msdd_rs_la_swig_libadd)
-
-_msdd_rs_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(msdd_rs_la_swig_ldflags)
-
-_msdd_rs_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(msdd_rs_la_swig_cxxflags)
-
-python/msdd_rs.cc: msdd_rs.py
-msdd_rs.py: msdd_rs.i
-
-# Include the python dependencies for this file
--include python/msdd_rs.d
-
-endif # end of if python
-
-if GUILE
-
-msdd_rs_scmlib_LTLIBRARIES = \
- libguile-gnuradio-msdd_rs.la
-libguile_gnuradio_msdd_rs_la_SOURCES = \
- guile/msdd_rs.cc \
- $(msdd_rs_la_swig_sources)
-nobase_msdd_rs_scm_DATA = \
- gnuradio/msdd_rs.scm \
- gnuradio/msdd_rs-primitive.scm
-libguile_gnuradio_msdd_rs_la_LIBADD = \
- $(STD_SWIG_LA_LIB_ADD) \
- $(msdd_rs_la_swig_libadd)
-libguile_gnuradio_msdd_rs_la_LDFLAGS = \
- $(STD_SWIG_LA_LD_FLAGS) \
- $(msdd_rs_la_swig_ldflags)
-libguile_gnuradio_msdd_rs_la_CXXFLAGS = \
- $(STD_SWIG_CXX_FLAGS) \
- -I$(top_builddir) \
- $(msdd_rs_la_swig_cxxflags)
-
-guile/msdd_rs.cc: gnuradio/msdd_rs.scm
-gnuradio/msdd_rs.scm: msdd_rs.i
-gnuradio/msdd_rs-primitive.scm: gnuradio/msdd_rs.scm
-
-# Include the guile dependencies for this file
--include guile/msdd_rs.d
-
-endif # end of GUILE
-
-
diff --git a/gr-msdd6000/src/README b/gr-msdd6000/src/README
deleted file mode 100644
index 230b7b6cf..000000000
--- a/gr-msdd6000/src/README
+++ /dev/null
@@ -1,34 +0,0 @@
-This block implements an interface between the Softronics MSDD6000 and GR
-
-Jul 13, 2008
-
-Tools / Waveforms
-
-
- - python-examples/new_msdd/fft.py
- A clone of the original usrp_fft.py
- adapted to work with the new msdd.source_simple
- source block.
- run ./new_msdd_fft.py -W
- for waterfall mode.
-
-
-GNU Radio Blocks,
-
- - msdd.source_simple
- this block produces a stream of
- interleaved complex shorts and
- currently works with FAPP.LDR
-
- if you want complex floats,
- put a gr.interleaved_short_to_complex()
- block immidiately following.
-
-
- - msdd.source_s / source_c / source_base
- These were written with the
- old TCP based app.ldr protocol
- and will no longer work.
- data was never streamed
- without discontinuities
- through this method.
diff --git a/gr-msdd6000/src/msdd6000.cc b/gr-msdd6000/src/msdd6000.cc
deleted file mode 100644
index f0a13936c..000000000
--- a/gr-msdd6000/src/msdd6000.cc
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <msdd6000.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#define DEBUG(A) printf("=debug=> %s\n", A)
-
-static void
-optimize_socket(int socket);
-
-/*
- * Holds types that need autoconf help. They're here and not in the .h file because
- * here we've got access to config.h
- */
-class MSDD6000::detail {
-public:
- struct sockaddr_in d_sockaddr;
-};
-
-
-MSDD6000::MSDD6000(char* addr)
- : d_detail(new MSDD6000::detail())
-{
- d_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
-
- optimize_socket(d_sock);
-
-
- // set up remote sockaddr
-// int s = inet_aton(addr, &d_adx);
- d_detail->d_sockaddr.sin_family = AF_INET;
- d_detail->d_sockaddr.sin_port = htons(10000);
- int s = inet_aton(addr, &d_detail->d_sockaddr.sin_addr);
-
- // set up local sockaddr
- struct in_addr d_myadx;
- struct sockaddr_in d_mysockaddr;
- short int port = 10010;
- d_myadx.s_addr = INADDR_ANY;
- d_mysockaddr.sin_family = AF_INET;
- d_mysockaddr.sin_port = htons(port);
- memcpy(&d_mysockaddr.sin_addr.s_addr, &d_myadx.s_addr, sizeof(in_addr));
- //d_sockaddr.sin_addr = INADDR_ANY;
- s = bind(d_sock, (const sockaddr*) &d_mysockaddr, sizeof(d_mysockaddr));
-
- // set default values
- d_decim = 2;
- d_ddc_gain = 2;
- d_rf_attn = 0;
- d_state = STATE_STOPPED;
-}
-
-MSDD6000::~MSDD6000()
-{
- // printf("MSDD6000::Destructing\n");
- close(d_sock);
-}
-
-
-static void
-optimize_socket(int socket){
-#define BANDWIDTH 1000000000/8
-#define DELAY 0.5
- int ret;
-
- int sock_buf_size = static_cast<int>(2*BANDWIDTH*DELAY);
- char textbuf[512];
- snprintf(textbuf, sizeof(textbuf), "%d", sock_buf_size);
- printf("sock_buf_size = %d\n", sock_buf_size);
-
- ret = setsockopt(socket, SOL_SOCKET, SO_SNDBUF,
- &sock_buf_size, sizeof(sock_buf_size));
-
- ret = setsockopt(socket, SOL_SOCKET, SO_RCVBUF,
- &sock_buf_size, sizeof(sock_buf_size));
-
- int uid = getuid();
- if(uid!=0){
- printf(" ****** COULD NOT OPTIMIZE SYSTEM NETWORK PARAMETERS BECAUSE YOU ARE NOT RUNNING AS ROOT *******\n ****** YOUR MSDD6000 RECIEVER PERFORMANCE IS GOING TO BE TERRIBLE *******\n");
- return;
- }
-
-
- // SET UP SOME SYSTEM WIDE TCP SOCKET PARAMETERS
- // FIXME seems like kind of a big hammer. Are you sure you need this?
- FILE* fd = fopen("/proc/sys/net/core/netdev_max_backlog", "w");
- if (fd){
- fwrite("10000", 1, strlen("10000"), fd);
- fclose(fd);
- }
-
- fd = fopen("/proc/sys/net/core/rmem_max", "w");
- if (fd){
- fwrite(textbuf, 1, strlen(textbuf), fd);
- fclose(fd);
- }
-
- fd = fopen("/proc/sys/net/core/wmem_max", "w");
- if (fd){
- fwrite(textbuf, 1, strlen(textbuf), fd);
- fclose(fd);
- }
-
- // just incase these were rejected before because of max sizes...
-
- ret = setsockopt( socket, SOL_SOCKET, SO_SNDBUF,
- (char *)&sock_buf_size, sizeof(sock_buf_size) );
-
- ret = setsockopt( socket, SOL_SOCKET, SO_RCVBUF,
- (char *)&sock_buf_size, sizeof(sock_buf_size) );
-
-}
-
-
-void MSDD6000::set_decim(int decim_pow2){
- DEBUG("SETTING NEW DECIM");
- d_decim = decim_pow2;
-
- if(d_state==STATE_STARTED)
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
-}
-
-void MSDD6000::set_rf_attn(int attn){
- DEBUG("SETTING NEW RF ATTN");
- d_rf_attn = attn;
- if(d_state==STATE_STARTED)
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
-}
-
-void MSDD6000::set_ddc_gain(int gain){
- DEBUG("SETTING NEW DDC GAIN");
- d_ddc_gain = gain;
- if(d_state==STATE_STARTED)
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
-}
-
-void MSDD6000::set_fc(int center_mhz, int offset_hz){
- DEBUG("SETTING NEW FC");
- d_fc_mhz = center_mhz;
- d_offset_hz = offset_hz;
-
- if(d_state==STATE_STARTED)
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
-}
-
-
-void MSDD6000::start(){
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
- d_state = STATE_STARTED;
- }
-
-
-void MSDD6000::stop(){
- // new request with 0 decim tells it to halt
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, 0, d_offset_hz);
- d_state = STATE_STOPPED;
- }
-
-
-void MSDD6000::send_request(float freq_mhz, float rf_attn, float ddc_gain, float ddc_dec, float ddc_offset_hz){
- static char buff[512];
- sprintf(buff, "%f %f %f %f %f\n",freq_mhz, rf_attn, ddc_gain, ddc_dec, ddc_offset_hz);
- printf("sending: %s\n", buff);
- int flags = 0;
- sendto( d_sock, buff, strlen(buff)+1, flags,
- (const sockaddr*)&(d_detail->d_sockaddr), sizeof(d_detail->d_sockaddr));
- }
-
-
-int MSDD6000::read(char* buf, int size){
- int flags = 0;
- return recv(d_sock, buf, size, flags);
- }
-
-
diff --git a/gr-msdd6000/src/msdd6000.h b/gr-msdd6000/src/msdd6000.h
deleted file mode 100644
index 808a8386f..000000000
--- a/gr-msdd6000/src/msdd6000.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef MSDD6000_H
-#define MSDD6000_H
-
-#include <boost/scoped_ptr.hpp>
-
-class MSDD6000 {
- class detail;
-
- //! holds objects with system dependent types
- boost::scoped_ptr<detail> d_detail;
-
-public:
-
- enum state {
- STATE_STOPPED, STATE_STARTED,
- };
-
- MSDD6000(char* ip_addr);
- ~MSDD6000();
-
- void set_decim(int decim_pow2);
- void set_fc(int center_mhz, int offset_hz);
- void set_ddc_gain(int gain);
- void set_rf_attn(int attn);
-
- void set_output(int mode, void* arg);
-
- void start();
- void stop();
-
- void send_request(float,float,float,float,float);
- int read(char*, int);
-
- int d_decim;
- int d_fc_mhz;
- int d_offset_hz;
- int d_rf_attn;
- int d_ddc_gain;
- int d_sock;
- state d_state;
-
-};
-
-
-#endif
diff --git a/gr-msdd6000/src/msdd6000_rs.cc b/gr-msdd6000/src/msdd6000_rs.cc
deleted file mode 100644
index d78f2b4da..000000000
--- a/gr-msdd6000/src/msdd6000_rs.cc
+++ /dev/null
@@ -1,286 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <msdd6000_rs.h>
-
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#define DEBUG(A) printf("=debug=> %s\n", A)
-
-static void
-optimize_socket(int socket);
-
-/*
- * Holds types that need autoconf help. They're here and not in the .h file because
- * here we've got access to config.h
- */
-class MSDD6000_RS::detail {
-public:
- struct sockaddr_in d_sockaddr;
-};
-
-
-MSDD6000_RS::MSDD6000_RS(char* addr)
- : d_detail(new MSDD6000_RS::detail())
-{
- d_sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
-
- optimize_socket(d_sock);
-
-
- // set up remote sockaddr
-// int s = inet_aton(addr, &d_adx);
- d_detail->d_sockaddr.sin_family = AF_INET;
- d_detail->d_sockaddr.sin_port = htons(10000);
- int s = inet_aton(addr, &d_detail->d_sockaddr.sin_addr);
-
- // set up local sockaddr
- struct in_addr d_myadx;
- struct sockaddr_in d_mysockaddr;
- short int port = 10010;
- d_myadx.s_addr = INADDR_ANY;
- d_mysockaddr.sin_family = AF_INET;
- d_mysockaddr.sin_port = htons(port);
- memcpy(&d_mysockaddr.sin_addr.s_addr, &d_myadx.s_addr, sizeof(in_addr));
- //d_sockaddr.sin_addr = INADDR_ANY;
- s = bind(d_sock, (const sockaddr*) &d_mysockaddr, sizeof(d_mysockaddr));
-
- // set default values
- //d_decim = 2;
- d_ddc_gain = 2;
- d_rf_attn = 0;
- d_fc_mhz = 3500;
- d_offset_hz = 0;
- d_ddc_gain = 0;
- d_ddc_sample_rate_khz = 25600;
- d_ddc_bw_khz = 25600;
- d_start = 0;
- d_state = STATE_STOPPED;
-}
-
-MSDD6000_RS::~MSDD6000_RS()
-{
- //printf("MSDD6000_RS::Destructing\n");
- close(d_sock);
-}
-
-
-static void
-optimize_socket(int socket){
-#define BANDWIDTH 1000000000/8
-#define DELAY 0.5
- int ret;
-
- int sock_buf_size = static_cast<int>(2*BANDWIDTH*DELAY);
- char textbuf[512];
- snprintf(textbuf, sizeof(textbuf), "%d", sock_buf_size);
- printf("sock_buf_size = %d\n", sock_buf_size);
-
- ret = setsockopt(socket, SOL_SOCKET, SO_SNDBUF,
- &sock_buf_size, sizeof(sock_buf_size));
-
- ret = setsockopt(socket, SOL_SOCKET, SO_RCVBUF,
- &sock_buf_size, sizeof(sock_buf_size));
-
- int uid = getuid();
- if(uid!=0){
- printf(" ****** COULD NOT OPTIMIZE SYSTEM NETWORK PARAMETERS BECAUSE YOU ARE NOT RUNNING AS ROOT *******\n ****** YOUR MSDD6000_RS RECIEVER PERFORMANCE IS GOING TO BE TERRIBLE *******\n");
- return;
- }
-
-
- // SET UP SOME SYSTEM WIDE TCP SOCKET PARAMETERS
- // FIXME seems like kind of a big hammer. Are you sure you need this?
- FILE* fd = fopen("/proc/sys/net/core/netdev_max_backlog", "w");
- if (fd){
- fwrite("10000", 1, strlen("10000"), fd);
- fclose(fd);
- }
-
- fd = fopen("/proc/sys/net/core/rmem_max", "w");
- if (fd){
- fwrite(textbuf, 1, strlen(textbuf), fd);
- fclose(fd);
- }
-
- fd = fopen("/proc/sys/net/core/wmem_max", "w");
- if (fd){
- fwrite(textbuf, 1, strlen(textbuf), fd);
- fclose(fd);
- }
-
- // just incase these were rejected before because of max sizes...
-
- ret = setsockopt( socket, SOL_SOCKET, SO_SNDBUF,
- (char *)&sock_buf_size, sizeof(sock_buf_size) );
-
- ret = setsockopt( socket, SOL_SOCKET, SO_RCVBUF,
- (char *)&sock_buf_size, sizeof(sock_buf_size) );
-
-}
-
-
-//void MSDD6000_RS::set_decim(int decim_pow2){
-// DEBUG("SETTING NEW DECIM");
-// d_decim = decim_pow2;
-//
-// if(d_state==STATE_STARTED)
-// send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
-//}
-
-void MSDD6000_RS::set_rf_attn(int attn){
- DEBUG("SETTING NEW RF ATTN");
- d_rf_attn = attn;
- if(d_state==STATE_STARTED)
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
-}
-
-void MSDD6000_RS::set_ddc_gain(int gain){
- DEBUG("SETTING NEW DDC GAIN");
- d_ddc_gain = gain;
- if(d_state==STATE_STARTED)
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
-}
-
-void MSDD6000_RS::set_fc(int center_mhz, int offset_hz){
- DEBUG("SETTING NEW FC");
- d_fc_mhz = center_mhz;
- d_offset_hz = offset_hz;
-
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
-// if(d_state==STATE_STARTED)
-// send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_decim, d_offset_hz);
-// send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
-//
-}
-
-void MSDD6000_RS::set_ddc_samp_rate(float sample_rate_khz){
- DEBUG("SETTING NEW SAMPLE RATE");
- d_ddc_sample_rate_khz = sample_rate_khz;
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
-}
-
-void MSDD6000_RS::set_ddc_bw(float bw_khz){
- DEBUG("SETTING NEW DDC BW");
- d_ddc_bw_khz = bw_khz;
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
-}
-
-void MSDD6000_RS::start(){
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
- return;
-}
-
-void MSDD6000_RS::stop(){
- // new request with 0 decim tells it to halt
- stop_data();
-}
-
-
-int MSDD6000_RS::start_data(){
- d_start = 1;
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
- d_state = STATE_STARTED;
- return 0;
- }
-
-
-int MSDD6000_RS::stop_data(){
- // new request with 0 decim tells it to halt
- d_start = 0;
- send_request(d_fc_mhz, d_rf_attn, d_ddc_gain, d_offset_hz, d_ddc_sample_rate_khz, d_ddc_bw_khz, d_start);
- d_state = STATE_STOPPED;
- return 0;
- }
-
-/* Query functions */
-float MSDD6000_RS::pull_ddc_samp_rate(){
- return d_ddc_sample_rate_khz;
-}
-float MSDD6000_RS::pull_ddc_bw(){
- return d_ddc_bw_khz;
-}
-
-float MSDD6000_RS::pull_rx_freq(){
- return d_fc_mhz;
-}
-int MSDD6000_RS::pull_ddc_gain(){
- return d_ddc_gain;
-}
-
-int MSDD6000_RS::pull_rf_atten(){
- return d_rf_attn;
-}
-
-
-void MSDD6000_RS::send_request(float freq_mhz, float rf_attn, float ddc_gain, float ddc_offset_hz, float ddc_samp_rate_khz, float ddc_input_bw_khz, float ddc_start){
- static char buff[512];
- // Send MSDD6000_RS control frame.
- sprintf(buff, "%f %f %f %f %f %f %f\n",freq_mhz, rf_attn, ddc_gain, ddc_offset_hz, ddc_samp_rate_khz, ddc_input_bw_khz, ddc_start); //ddc_dec, ddc_offset_hz);
- printf("sending: %s\n", buff);
- int flags = 0;
- sendto( d_sock, buff, strlen(buff)+1, flags,
- (const sockaddr*)&(d_detail->d_sockaddr), sizeof(d_detail->d_sockaddr));
- }
-
-
-int MSDD6000_RS::read(char* buf, int size){
- int flags = 0;
- return recv(d_sock, buf, size, flags);
- }
-
-int MSDD6000_RS::parse_control(char* buf, int size){
- //packet_len = sprintf(&txbuff[6], "%f %f %f %f %f %f %f",downsamp,ddc_dec_rate,ddc_step_int,ddc_step_frac,ddc_samp_rate_khz,ddc_input_bw_khz,ddc_start);
-
- float downsamp;
- float ddc_dec_rate;
- float ddc_step_int;
- float ddc_step_frac;
- float ddc_samp_rate_khz;
- float ddc_input_bw_khz;
- float ddc_start;
-
- sscanf(&buf[6],"%f %f %f %f %f %f %f",&downsamp,&ddc_dec_rate,&ddc_step_int,&ddc_step_frac,&ddc_samp_rate_khz,&ddc_input_bw_khz,&ddc_start);
-
- // pull off sample rate
- d_ddc_sample_rate_khz = ddc_samp_rate_khz;
- printf("Sample Rate %f\n",d_ddc_sample_rate_khz);
- // pull off bw
- d_ddc_bw_khz = ddc_input_bw_khz;
- printf("BW %f\n", d_ddc_bw_khz);
- return 0;
-}
-
-
diff --git a/gr-msdd6000/src/msdd6000_rs.h b/gr-msdd6000/src/msdd6000_rs.h
deleted file mode 100644
index 4be4624be..000000000
--- a/gr-msdd6000/src/msdd6000_rs.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef MSDD_RS__RS_6000_H
-#define MSDD_RS__RS_6000_H
-
-#include <boost/scoped_ptr.hpp>
-
-class MSDD6000_RS {
- class detail;
-
- //! holds objects with system dependent types
- boost::scoped_ptr<detail> d_detail;
-
-public:
-
- enum state {
- STATE_STOPPED, STATE_STARTED
- };
-
- MSDD6000_RS(char* ip_addr);
- ~MSDD6000_RS();
-
- /* set functions -- sets digitizer parameters */
-
- // void set_output(int mode, void* arg);
-
- void set_rf_attn(int attn);
- void set_ddc_gain(int gain);
- void set_fc(int center_mhz, int offset_hz);
- void set_ddc_samp_rate(float sample_rate_khz);
- void set_ddc_bw(float bw_khz);
-
- void start();
- void stop();
-
- /* function starts the flow of data from the digitizer */
- int start_data();
- /* function stops the flow of data from the digitizer */
- int stop_data();
-
- /* query functions -- queries digitizer 'actual' parameters */
- float pull_ddc_samp_rate();
- float pull_ddc_bw();
- float pull_rx_freq();
- int pull_ddc_gain();
- int pull_rf_atten();
-
- void send_request(float,float,float,float,float,float,float);
- int read(char*, int);
-
- int parse_control(char*, int);
-
-private:
- // parameters for a receiver object.
- int d_fc_mhz;
- int d_offset_hz;
- int d_rf_attn;
- int d_ddc_gain;
- float d_ddc_sample_rate_khz;
- float d_ddc_bw_khz;
- int d_start;
- int d_sock;
- state d_state;
-
-};
-
-
-#endif
diff --git a/gr-msdd6000/src/msdd_buffer_copy_behaviors.h b/gr-msdd6000/src/msdd_buffer_copy_behaviors.h
deleted file mode 100644
index 398f8ae66..000000000
--- a/gr-msdd6000/src/msdd_buffer_copy_behaviors.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef MSDD_BUFFER_COPY_BEHAVIORS_H_
-#define MSDD_BUFFER_COPY_BEHAVIORS_H_
-
-namespace msdd {
-
- class BufferCopyBehavior
- {
- public:
- virtual void operator() (gr_vector_void_star &a, const void * b, unsigned int output_index, unsigned int nitems) = 0;
- virtual ~BufferCopyBehavior() {};
- };
-
- template <class Tin, class Tout>
- class BufferCopyBehaviorGeneric : public BufferCopyBehavior {
- void operator() (gr_vector_void_star &a, const void * b, unsigned int output_index, unsigned int nitems) {
- Tout *out(&(reinterpret_cast<Tout *>(a[0]))[output_index]); // sloppy
- const Tin *in(reinterpret_cast<const Tin *>(b)); // equisloppy
-
- for (unsigned int i = 0; i < nitems; ++i) {
- out[i] = in[i];
- }
- }
- };
-
- template <class Tin>
- class BufferCopyBehaviorComplex : public BufferCopyBehavior {
- void operator() (gr_vector_void_star &a, const void * b, unsigned int output_index, unsigned int nitems) {
- gr_complex *out(&(reinterpret_cast<gr_complex *>(a[0]))[output_index]); // sloppy
- const Tin *in(reinterpret_cast<const Tin *>(b)); // equisloppy
-
- for (unsigned int i = 0; i < nitems; ++i) {
- out[i] = gr_complex (in[4*i+1],in[4*i+3]);
- }
- }
- };
-}
-
-#endif /*MSDD_BUFFER_COPY_BEHAVIORS_H_*/
diff --git a/gr-msdd6000/src/msdd_rs.i b/gr-msdd6000/src/msdd_rs.i
deleted file mode 100644
index 8afb1fb7e..000000000
--- a/gr-msdd6000/src/msdd_rs.i
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2004,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.
- */
-
-%include "gnuradio.i" // the common stuff
-
-%{
-#include "msdd_rs_source_simple.h"
-%}
-
-
-GR_SWIG_BLOCK_MAGIC(msdd_rs,source_simple)
-
-msdd_rs_source_simple_sptr
-msdd_rs_make_source_simple (
- const char *src,
- unsigned short port_src
- );
-
-class msdd_rs_source_simple : public gr_sync_block {
- protected:
- msdd_rs_source_simple(
- const char *src,
- unsigned short port_src
- );
-
- public:
- ~msdd_rs_source_c();
- int work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
-
- bool start();
- bool stop();
-
- /* function starts the flow of data */
- int start_data();
-
- /* function stops the flow of data */
- int stop_data();
-
- long pull_adc_freq();
- /* Request the current ddc sample rate */
- float pull_ddc_samp_rate();
- /* Request the current ddc bandwidth */
- float pull_ddc_bw();
- /* Request the current rx freq */
- float pull_rx_freq();
- /* Request current ddc gain */
- int pull_ddc_gain();
- /* Request current RF attenuation */
- int pull_rf_atten();
-
-
- /* int decim_rate(); */
- gr_vector_int gain_range();
- gr_vector_float freq_range();
-
- /* Set Functions */
- /* bool set_decim_rate(unsigned int); */
- bool set_rx_freq(double); /* set_rx_freq(int,double); */
- /* bool set_pga(int,double); */
-
- bool set_ddc_gain(double);
- /* Set desired sample rate of MSDD6000 -- Note bounds checking is
- done by the module and it will return the value actually used in the hardware. */
- bool set_ddc_samp_rate(double);
- /* Set desired input BW of MSDD6000 -- Note bounds checking is
- // done by the module and it will return the value actually used in the hardware. */
- bool set_ddc_bw(double);
-
- bool set_rf_atten(double);
-
-
- };
-
-#if SWIGGUILE
-%scheme %{
-(load-extension-global "libguile-gnuradio-msdd_rs" "scm_init_gnuradio_msdd_rs_module")
-%}
-
-%goops %{
-(use-modules (gnuradio gnuradio_core_runtime))
-%}
-#endif
diff --git a/gr-msdd6000/src/msdd_rs_source_simple.cc b/gr-msdd6000/src/msdd_rs_source_simple.cc
deleted file mode 100644
index 70e692d83..000000000
--- a/gr-msdd6000/src/msdd_rs_source_simple.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2010 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <msdd_rs_source_simple.h>
-#include <gr_io_signature.h>
-#include <string.h>
-#include <cstdio>
-
-
-msdd_rs_source_simple_sptr
-msdd_rs_make_source_simple ( const char *src, unsigned short port_src)
-{
- return gnuradio::get_initial_sptr(new msdd_rs_source_simple ( src, port_src));
-}
-
-
-msdd_rs_source_simple::msdd_rs_source_simple (
- const char *src,
- unsigned short port_src)
- : gr_sync_block("MSDD_RS_SOURCE_SIMPLE",
- gr_make_io_signature (0,0,0),
- gr_make_io_signature (1, 1, sizeof (short))),
- rcv(new MSDD6000_RS((char*) src)), d_lastseq(0)
-{
-}
-
-msdd_rs_source_simple::~msdd_rs_source_simple ()
-{
-}
-
-
-int
-msdd_rs_source_simple::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
-
-#define BUF_LEN (366*sizeof(short)*2 + 6)
-
- float* out1 =(float*) output_items[0];
-
- char buffer[BUF_LEN];
- /* Read a buffer out -- looking at UDP payload at this point.*/
- rcv->read( &buffer[0], BUF_LEN );
-
- //int seq = *((int*) &buffer[2]);
- int seq;
- memcpy(&seq, &buffer[2], 4*sizeof(char));
-
- char type = buffer[0];
- //printf("Sequence %d\n",seq);
-
- // FIXME get rid of these magic 366's!
- if(d_lastseq == -366)
- {
- if (type != 0){
- /* Received control packet -- parse and update locally stored parameters */
- printf("Parsing control Packet\n");
- rcv->parse_control(&buffer[0], seq);
- }
- else{
- // not started case
- if(seq == 0){
- d_lastseq = 0;
- }
- else
- {
- // THROW AWAY SAMPLES WE ARE NOT STARTED YET!
- return 0;
- }
- }
- }
- // Started case
- else
- {
- if (type != 0){
- /* Received control packet -- parse and update locally stored parameters */
- printf("Parsing control Packet\n");
- rcv->parse_control(&buffer[0], seq);
- }
-
- else {
- int samples_missed = seq - d_lastseq - 366;
- if(samples_missed > 0)
- {
- printf("dropped %d samples.\n", samples_missed);
- }
- d_lastseq = seq;
- }
- }
-
- if(noutput_items< 366*2){
- printf("NOT ENOUGH SPACE IN OUTPUT BUFFER!!! >:-(\n");
- }
-
- memcpy(&out1[0], &buffer[6], BUF_LEN - 6);
-
-// for(int i = 0; i < 366*2; i++){
-// out1[i] = (float) (*((short*) &buffer[6+2*i]) );
-// }
-
- return 366*2;
-}
-
-//bool msdd_rs_source_simple::set_decim_rate(unsigned int rate)
-//{
-// // FIXME seems buggy. How about a floor or ceil?
-// rcv->set_decim((int) log2(rate));
-// return true;
-//}
-
-bool msdd_rs_source_simple::set_rx_freq(double freq)
-{
- long new_fc = (long)freq;
- rcv->set_fc( new_fc/1000000, new_fc%1000000);
- return true;
-}
-
-
-bool msdd_rs_source_simple::set_ddc_gain(double gain)
-{
- if(gain < 0 || gain > 7){ // only 3 bits available.
- printf("GAIN IS OUTSIDE ACCEPTABLE RANGE!\n");
- return false;
- }
- //decimation gain
- rcv->set_ddc_gain((int)gain);
- return true;
-}
-
-// Set desired sample rate of MSDD6000 -- Note bounds checking is
-// done by the module and it will return the value actually used in the hardware.
-bool msdd_rs_source_simple::set_ddc_samp_rate(double rate)
-{
- rcv->set_ddc_samp_rate((float) rate);
- return true;
-}
-
-// Set desired input BW of MSDD6000 -- Note bounds checking is
-// done by the module and it will return the value actually used in the hardware.
-bool msdd_rs_source_simple::set_ddc_bw(double bw)
-{
- rcv->set_ddc_bw((float) bw);
- return true;
-}
-
-bool msdd_rs_source_simple::set_rf_atten(double rf_atten)
-{
- rcv->set_rf_attn((int) rf_atten);
- return true;
-}
-
-bool msdd_rs_source_simple::start()
-{
- rcv->start();
- rcv->stop_data();
- return true;
-}
-
-bool msdd_rs_source_simple::stop()
-{
- rcv->stop();
- return true;
-}
-
-int msdd_rs_source_simple::start_data()
-{
- return rcv->start_data();
-}
-
-int msdd_rs_source_simple::stop_data()
-{
- return rcv->stop_data();
-}
-
-/* Query functions */
-long msdd_rs_source_simple::pull_adc_freq(){
- return 102400000;
-}
-
-/* Request the current ddc sample rate */
-float msdd_rs_source_simple::pull_ddc_samp_rate(){
- return(rcv->pull_ddc_samp_rate());
-}
-
-/* Request the current ddc bandwidth */
-float msdd_rs_source_simple::pull_ddc_bw(){
- return(rcv->pull_ddc_bw());
-
-}
-
-/* Request the current rx freq */
-float msdd_rs_source_simple::pull_rx_freq(){
- return(rcv->pull_rx_freq());
-}
-
-/* Request current ddc gain */
-int msdd_rs_source_simple::pull_ddc_gain(){
- return(rcv->pull_ddc_gain());
-}
-
-/* Request current RF attenuation */
-int msdd_rs_source_simple::pull_rf_atten(){
- return(rcv->pull_rf_atten());
-}
-
-std::vector<int> msdd_rs_source_simple::gain_range(){
- static std::vector<int> r;
- r.push_back(0);
- r.push_back(12);
- return r;
-}
-
-std::vector<float> msdd_rs_source_simple::freq_range(){
- std::vector<float> r;
- r.push_back(30.0*1000*1000);
- r.push_back(6.0*1000*1000*1000);
- return r;
-}
diff --git a/gr-msdd6000/src/msdd_rs_source_simple.h b/gr-msdd6000/src/msdd_rs_source_simple.h
deleted file mode 100644
index f320cbb4d..000000000
--- a/gr-msdd6000/src/msdd_rs_source_simple.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
-#define INCLUDED_MSDD_RS_SOURCE_SIMPLE_H
-
-#include <gr_sync_block.h>
-#include <msdd6000_rs.h>
-#include <boost/scoped_ptr.hpp>
-
-class msdd_rs_source_simple;
-typedef boost::shared_ptr<msdd_rs_source_simple> msdd_rs_source_simple_sptr;
-
-
-// public shared_ptr constructor
-
-msdd_rs_source_simple_sptr msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
-
-
-class msdd_rs_source_simple : public gr_sync_block {
- private:
- friend msdd_rs_source_simple_sptr
- msdd_rs_make_source_simple ( const char *src, unsigned short port_src);
-
- boost::scoped_ptr<MSDD6000_RS> rcv;
- int d_lastseq;
-
- protected:
- msdd_rs_source_simple (const char *src, unsigned short port_src);
-
- public:
- ~msdd_rs_source_simple ();
- bool stop();
- bool start();
-
- /* function starts the flow of data from the digitizer */
- int start_data();
- /* function stops the flow of data from the digitizer */
- int stop_data();
-
- // Do not need this //
-// bool set_decim_rate(unsigned int);
- /* Adding functions for setting the sample rate and
- * receiver bandwidth
- */
-
- /* hardware commands -- change current state of digitizer */
- bool set_ddc_samp_rate(double);
- bool set_ddc_bw(double);
-
- bool set_rx_freq(double);
- bool set_ddc_gain(double);
- bool set_rf_atten(double);
-
- int work(int, gr_vector_const_void_star&, gr_vector_void_star&);
-
- /* Query methods -- query current state of digitizer */
- long pull_adc_freq();
- float pull_ddc_samp_rate();
- float pull_ddc_bw();
- float pull_rx_freq();
- int pull_ddc_gain();
- int pull_rf_atten();
-
- /* Pulling back gain and frequency ranges */
- std::vector<int> gain_range();
- std::vector<float> freq_range();
-};
-
-#endif /* INCLUDED_MSDD_RS__RS__SOURCE_C_H */
diff --git a/gr-msdd6000/src/msdd_source_simple.cc b/gr-msdd6000/src/msdd_source_simple.cc
deleted file mode 100644
index 20b15c43d..000000000
--- a/gr-msdd6000/src/msdd_source_simple.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/* -*- c++ -*- */
-/*
- * Copyright 2008,2009,2010 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <msdd_source_simple.h>
-#include <gr_io_signature.h>
-#include <string.h>
-#include <cstdio>
-
-
-msdd_source_simple_sptr
-msdd_make_source_simple (const char *src, unsigned short port_src)
-{
- return gnuradio::get_initial_sptr(new msdd_source_simple ( src, port_src));
-}
-
-
-msdd_source_simple::msdd_source_simple (const char *src,
- unsigned short port_src)
- : gr_sync_block("MSDD_SOURCE_SIMPLE",
- gr_make_io_signature (0,0,0),
- gr_make_io_signature (1, 1, sizeof (short))),
- rcv(new MSDD6000((char*) src)), d_lastseq(0), d_firstrun(true)
-{
- set_output_multiple(MSDD_COMPLEX_SAMPLES_PER_PACKET*2);
-}
-
-msdd_source_simple::~msdd_source_simple ()
-{
-}
-
-
-int
-msdd_source_simple::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
-{
-
-#define BUF_LEN (MSDD_COMPLEX_SAMPLES_PER_PACKET*sizeof(short)*2 + 6)
-
- signed short* out1 =(signed short*) output_items[0];
-
- for(int i=0; i<floor(noutput_items*1.0/(2*MSDD_COMPLEX_SAMPLES_PER_PACKET));i++){
- char buffer[BUF_LEN];
- rcv->read( &buffer[0], BUF_LEN );
-
- //int seq = *((int*) &buffer[2]);
- int seq;
- memcpy(&seq, &buffer[2], 4*sizeof(char));
-
- if(d_lastseq == -MSDD_COMPLEX_SAMPLES_PER_PACKET){
- // not started case
- if(seq == 0){
- d_lastseq = 0;
- } else {
- // THROW AWAY SAMPLES WE ARE NOT STARTED YET!
- return 0;
- }
-
- } else {
- // started case
- int samples_missed = seq - d_lastseq - MSDD_COMPLEX_SAMPLES_PER_PACKET;
- if(samples_missed > 0){
- if(d_firstrun == true){
- // we may have missed some initial samples off the beginning of
- // a stream but there are no drop outs in the middle of what we have
- } else {
- printf("dropped %d samples.\n", samples_missed);
- }
- }
- d_lastseq = seq;
- }
-
- int out_idx = i*MSDD_COMPLEX_SAMPLES_PER_PACKET*2;
- memcpy(&out1[out_idx], &buffer[6], BUF_LEN - 6);
- d_firstrun = false;
- }
-
- return noutput_items;
-
-}
-
-bool msdd_source_simple::set_decim_rate(unsigned int rate)
-{
- rcv->set_decim((int) floor(log2(rate)));
- return true;
-}
-
-
-bool msdd_source_simple::set_rx_freq(int channel, double freq)
-{
- long new_fc = (long)freq;
- rcv->set_fc( new_fc/1000000, new_fc%1000000);
- return true;
-}
-
-
-bool msdd_source_simple::set_pga(int which, double gain)
-{
- if(gain < 0 || gain > 10){
- printf("GAIN IS OUTSIDE ACCEPTABLE RANGE!\n");
- return false;
- }
- // ok i lied this is not really a pga, its decimation gain
- rcv->set_ddc_gain((int)gain);
- return true;
-}
-
-
-bool msdd_source_simple::start()
-{
- rcv->start();
- return true;
-}
-
-
-bool msdd_source_simple::stop()
-{
- rcv->stop();
- return true;
-}
-
-long msdd_source_simple::adc_freq()
-{
- return 102400000;
-}
-
-int msdd_source_simple::decim_rate()
-{
- return 1 << rcv->d_decim;
-}
-
-
-std::vector<int> msdd_source_simple::gain_range()
-{
- static std::vector<int> r;
- r.push_back(0);
- r.push_back(12);
- return r;
-}
-
-std::vector<float> msdd_source_simple::freq_range()
-{
- std::vector<float> r;
- r.push_back(30.0*1000*1000);
- r.push_back(6.0*1000*1000*1000);
- return r;
-}
diff --git a/gr-msdd6000/src/msdd_source_simple.h b/gr-msdd6000/src/msdd_source_simple.h
deleted file mode 100644
index 142c544a4..000000000
--- a/gr-msdd6000/src/msdd_source_simple.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- c++ -*- */
-/*
- * 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 this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifndef INCLUDED_MSDD_SOURCE_SIMPLE_H
-#define INCLUDED_MSDD_SOURCE_SIMPLE_H
-
-#include <gr_sync_block.h>
-#include <msdd6000.h>
-#include <boost/scoped_ptr.hpp>
-
-#define MSDD_COMPLEX_SAMPLES_PER_PACKET 366
-
-class msdd_source_simple;
-typedef boost::shared_ptr<msdd_source_simple> msdd_source_simple_sptr;
-
-
-// public shared_ptr constructor
-
-msdd_source_simple_sptr msdd_make_source_simple(const char *src, unsigned short port_src);
-
-
-class msdd_source_simple : public gr_sync_block {
- private:
- friend msdd_source_simple_sptr
- msdd_make_source_simple(const char *src, unsigned short port_src);
-
- boost::scoped_ptr<MSDD6000> rcv;
- int d_lastseq;
- bool d_firstrun;
-
- protected:
- msdd_source_simple(const char *src, unsigned short port_src);
-
- public:
- ~msdd_source_simple();
- bool stop();
- bool start();
-
- bool set_decim_rate(unsigned int);
- bool set_rx_freq(int,double);
- bool set_pga(int,double);
-
- int work(int, gr_vector_const_void_star&, gr_vector_void_star&);
-
- long adc_freq();
- int decim_rate();
- std::vector<int> gain_range();
- std::vector<float> freq_range();
-};
-
-#endif /* INCLUDED_MSDD_SOURCE_C_H */
diff --git a/gr-msdd6000/src/python-examples/msdd_dynamics.py b/gr-msdd6000/src/python-examples/msdd_dynamics.py
deleted file mode 100755
index 8cd1e52bc..000000000
--- a/gr-msdd6000/src/python-examples/msdd_dynamics.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-
-from gnuradio import gr
-from gnuradio import msdd
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import time
-
-class benchmark_msdd6000(gr.top_block):
- def __init__(self, address, options):
- gr.top_block.__init__(self)
-
- # Extract the initial options
- self.frequency = options.frequency
- self.filename = options.filename
- self.decim = options.decim
- self.gain = options.gain
- self.address = address
-
- # Set up and initialize the MSDD receiver
- self.port = 10001 # required port
- self.src = msdd.source_c(0, 1, self.address, self.port)
- self.src.set_decim_rate(self.decim)
- self.src.set_desired_packet_size(0, 1460)
- self.src.set_pga(0, self.gain)
- self.src.set_rx_freq(0, self.frequency)
-
- # Display some info
- print "Min PGA: ", self.src.pga_min()
- print "Max PGA: ", self.src.pga_max()
- print "PGA: ", self.src.pga(0)
- print "Decim: ", self.src.decim_rate()
- print "Freq: ", self.src.rx_freq(0)
-
- # Build a file sink to save the info for post analysis
- self.snk = gr.file_sink(gr.sizeof_gr_complex, self.filename)
-
- # Connect the reciever source to file sink
- self.connect(self.src, self.snk)
-
-def main():
- ''' This is a simple little script to play with retunning of the MSDD board.
- You can cycle through frequencies or the attenuation of the board here.
- '''
-
- usage="%prog: [options] host_address"
- parser = OptionParser(usage=usage, option_class=eng_option, conflict_handler="resolve")
- parser.add_option("-f", "--frequency", type="eng_float", default=100e6,
- help="set frequency (Hz) [default=%default]")
- parser.add_option("-d", "--decim", type="int", default=256,
- help="set decimation rate [default=%default]")
- parser.add_option("-g", "--gain", type="int", default=32,
- help="set receiver gain (dB) [default=%default]")
- parser.add_option("-F", "--filename", type="string", default="output.dat",
- help="set output filename [default=%default]")
- (options, args) = parser.parse_args ()
- host_address = args[0]
-
- # Set up benchmark system that simply connects the MSDD source to a file sink
- tb = benchmark_msdd6000(host_address, options)
- tb.start() # start it here
-
- # Adjust your parameters here. Use the time.sleep(x) function to set a wait period
- # between adjusting the parameter.
- for i in range(7):
- time.sleep(0.5)
- if 0:
- freq = (tb.src.rx_freq(0) + 1) * 1e6
- tb.src.set_rx_freq(0, freq)
- print "Setting frequency: ", freq
- if 1:
- pga = tb.src.pga(0)+10
- tb.src.set_pga(0, pga)
- print "Setting PGA: ", pga
-
- tb.stop() # stop the radio
-
-if __name__ == '__main__':
- main()
diff --git a/gr-msdd6000/src/python-examples/msdd_fft.py b/gr-msdd6000/src/python-examples/msdd_fft.py
deleted file mode 100755
index 813a77d38..000000000
--- a/gr-msdd6000/src/python-examples/msdd_fft.py
+++ /dev/null
@@ -1,277 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005,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.
-#
-
-from gnuradio import gr, gru
-from gnuradio import msdd
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
-from optparse import OptionParser
-import wx
-import sys
-
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db[0][0].dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- if u.db[1][0].dbid() >= 0:
- return (1, 0)
- return (0, 0)
-
-
-class app_top_block(stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which MSDD (0, 1, ...) default is %default",
- metavar="NUM")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select MSDD Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-A", "--antenna", default=None,
- help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-W", "--waterfall", action="store_true", default=False,
- help="Enable waterfall display")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
- parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
- help="Enable oscilloscope display")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- self.show_debug_info = True
-
- # build the graph
-
- #self.u = MSDD.source_simo(which=options.which, decim_rate=options.decim)
- self.u = msdd.source_simple("192.168.1.200", 0)
- self.u.set_decim_rate(options.decim) #(16)
-
-# msdd_src = gr.file_source(gr.sizeof_gr_complex, 'msdd.dat')
-# thr = gr.throttle(gr.sizeof_gr_complex, 200000)
-# self.connect(msdd_src, thr)
-
-# if options.rx_subdev_spec is None:
-# options.rx_subdev_spec = pick_subdevice(self.u)
-# self.u.set_mux(MSDD.determine_rx_mux_value(self.u, options.rx_subdev_spec))
-
-# if options.width_8:
-# width = 8
-# shift = 8
-# format = self.u.make_format(width, shift)
-# print "format =", hex(format)
-# r = self.u.set_format(format)
-# print "set_format =", r
-
- # determine the daughterboard subdevice we're using
-# self.subdev = MSDD.selected_subdev(self.u, options.rx_subdev_spec)
-
-# print "Initial Freq", self.u.rx_freq(0), "deci: ", self.u.decim_rate()
-# input_rate = 50e6 / self.u.decim_rate()
- input_rate = 50e6 / options.decim;
-
- if options.waterfall:
- self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=1024, sample_rate=input_rate)
- elif options.oscilloscope:
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
- else:
- self.scope = fftsink2.fft_sink_c (panel, fft_size=1024, sample_rate=input_rate)
-
-# self.connect(self.u, self.scope)
-
- msdd_sink = gr.file_sink(gr.sizeof_gr_complex, 'schmen1.dat')
-
- self.conv = gr.interleaved_short_to_complex();
- self.connect(self.u, self.conv, msdd_sink)
- self._build_gui(vbox)
-
- # set initial values
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- #g = self.subdev.gain_range()
- self.gain_range = (20,70,.5);
- options.gain = float(self.gain_range[0]+self.gain_range[1])/2
-
- if options.freq is None:
- # if no freq was specified, use the mid-point
- #r = self.subdev.freq_range()
- r = (30e6,6e9,1e6)
- options.freq = float(r[0]+r[1])/2
-
- self.set_gain(options.gain)
-#
-# if options.antenna is not None:
-# print "Selecting antenna %s" % (options.antenna,)
-# self.subdev.select_rx_antenna(options.antenna)
-
- if self.show_debug_info:
- #self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['decim'].set_value(options.decim)
- # self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- # self.myform['dbname'].set_value(self.subdev.name())
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- vbox.Add(self.scope.win, 10, wx.EXPAND)
-
- # add control area at the bottom
- self.myform = myform = form.form()
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0, 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0, 0)
- g = self.gain_range = (20,50,.5);
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3,
- min=int(g[0]), max=int(g[1]),
- callback=self.set_gain)
-
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- self._build_subpanel(vbox)
-
- def _build_subpanel(self, vbox_arg):
- # build a secondary information panel (sometimes hidden)
-
- # FIXME figure out how to have this be a subpanel that is always
- # created, but has its visibility controlled by foo.Show(True/False)
-
- def _form_set_decim(kv):
- return self.set_decim(kv['decim'])
-
- if not(self.show_debug_info):
- return
-
- panel = self.panel
- vbox = vbox_arg
- myform = self.myform
-
- #panel = wx.Panel(self.panel, -1)
- #vbox = wx.BoxSizer(wx.VERTICAL)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['decim'] = form.int_field(
- parent=panel, sizer=hbox, label="Decim",
- callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
-
-# hbox.Add((5,0), 1)
-# myform['fs@usb'] = form.static_float_field(
-# parent=panel, sizer=hbox, label="Fs@USB")
-
- hbox.Add((5,0), 1)
- myform['dbname'] = form.static_text_field(
- parent=panel, sizer=hbox)
-
- hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
-
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.set_rx_freq (0, target_freq)
- #r = self.u.tune(0, self.subdev, target_freq)
- if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
-# if self.show_debug_info:
-# self.myform['baseband'].set_value(r.baseband_freq)
-# self.myform['ddc'].set_value(r.dxc_freq)
- return True
-
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- #self.subdev.set_gain(gain)
- self.u.set_pga(0, gain)
-
- def set_decim(self, decim):
- ok = self.u.set_decim_rate(decim)
- if not ok:
- print "set_decim failed"
- #input_rate = 20e6 / self.u.decim_rate()
- #self.scope.set_sample_rate(input_rate)
- if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(decim)
- #self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- return ok
-
-def main ():
- app = stdgui2.stdapp(app_top_block, "MSDD FFT", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-msdd6000/src/python-examples/msdd_rcv.py b/gr-msdd6000/src/python-examples/msdd_rcv.py
deleted file mode 100755
index cc2f3e4a3..000000000
--- a/gr-msdd6000/src/python-examples/msdd_rcv.py
+++ /dev/null
@@ -1,287 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006,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.
-#
-
-from gnuradio import gr, gru, eng_notation
-from gnuradio import msdd
-from gnuradio import blks2
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import slider, powermate
-from gnuradio.wxgui import stdgui2, form
-from gnuradio.wxgui import fftsink2
-from optparse import OptionParser
-#from usrpm import usrp_dbid
-import sys
-import math
-import wx
-
-class wfm_rx_block (stdgui2.std_top_block):
- def __init__(self,frame,panel,vbox,argv):
- stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
-
- parser=OptionParser(option_class=eng_option)
-# parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
-# help="select MSDD Rx side A or B (default=A)")
- parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=40,
- help="set gain in dB (default is midpoint)")
-# parser.add_option("-V", "--volume", type="eng_float", default=None,
-# help="set volume (default is midpoint)")
-# parser.add_option("-O", "--audio-output", type="string", default="",
-# help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- self.frame = frame
- self.panel = panel
-
- self.vol = 0
- self.gain_range = (10, 70, .5)
- self.state = "FREQ"
- self.freq = 0
- msdd_decim = 2
-
- # build graph
- self.fft_size = 8192
- self.sample_rate = 200
- self.u = msdd.source_c(0, 1, "10.45.4.44", 10000)
- self.u.set_decim_rate(4)
- self.u.set_desired_packet_size(0, 1460*100)
-
-
- #self.u.set_decim_rate(msdd_decim)
-# usrp_rate = adc_rate / msdd_decim # 320 kS/s
-# chanfilt_decim = 1
-# demod_rate = usrp_rate / chanfilt_decim
-# audio_decimation = 10
-# audio_rate = demod_rate / audio_decimation # 32 kHz
-#
-# if options.rx_subdev_spec is None:
-# options.rx_subdev_spec = pick_subdevice(self.u)
-#
-# self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
-# self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
-# print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-#
-#
-# chan_filt_coeffs = optfir.low_pass (1, # gain
-# usrp_rate, # sampling rate
-# 80e3, # passband cutoff
-# 115e3, # stopband cutoff
-# 0.1, # passband ripple
-# 60) # stopband attenuation
-# #print len(chan_filt_coeffs)
-# chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
-#
-# self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
-#
-# self.volume_control = gr.multiply_const_ff(self.vol)
-#
-# # sound card as final sink
-# audio_sink = audio.sink (int (audio_rate),
-# options.audio_output,
-# False) # ok_to_block
-
- # now wire it all together
- #self.connect (self.u, chan_filt, self.guts, self.volume_control, audio_sink)
-
- self._build_gui(vbox)
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- #g = self.subdev.gain_range()
- g = self.gain_range
- options.gain = float(g[0]+g[1])/2
-#
-# if options.volume is None:
-# g = self.volume_range()
-# options.volume = float(g[0]+g[1])/2
-#
-# if abs(options.freq) < 1e6:
-# options.freq *= 1e6
-
- # set initial values
-#
- self.set_gain(options.gain)
-# self.set_vol(options.volume)
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
- print "Frequency: ", self.u.rx_freq(0)
-
-
- def _set_status_msg(self, msg, which=0):
- self.frame.GetStatusBar().SetStatusText(msg, which)
-
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- self.src_fft = None
- if 1:
- self.src_fft = fftsink2.fft_sink_c(self.panel, title="Data from MSDD",
- fft_size=512, sample_rate=512)
-# self.s2f1 = gr.short_to_float()
-# self.scope = scopesink2.scope_sink_f(self.panel, sample_rate=self.sample_rate*self.fft_size)
-
- self.connect (self.u, self.src_fft)
- #self.connect (self.s2f1, self.scope)
- vbox.Add (self.src_fft.win, 4, wx.EXPAND)
-#
-# if 1:
-# post_filt_fft = fftsink2.fft_sink_f(self.panel, title="Post Demod",
-# fft_size=1024, sample_rate=usrp_rate,
-# y_per_div=10, ref_level=0)
-# self.connect (self.guts.fm_demod, post_filt_fft)
-# vbox.Add (post_filt_fft.win, 4, wx.EXPAND)
-#
-# if 0:
-# post_deemph_fft = fftsink2.fft_sink_f(self.panel, title="Post Deemph",
-# fft_size=512, sample_rate=audio_rate,
-# y_per_div=10, ref_level=-20)
-# self.connect (self.guts.deemph, post_deemph_fft)
-# vbox.Add (post_deemph_fft.win, 4, wx.EXPAND)
-
-
- # control area form at bottom
- self.myform = myform = form.form()
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0)
- myform['freq_slider'] = \
- form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(30e6, 6e9, 1e6),
- callback=self.set_freq)
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-#
-# myform['volume'] = \
-# form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Volume",
-# weight=3, range=self.volume_range(),
-# callback=self.set_vol)
-# hbox.Add((5,0), 1)
-
- myform['gain'] = \
- form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.gain_range,
- callback=self.set_gain)
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-#
-# try:
-# self.knob = powermate.powermate(self.frame)
-# self.rot = 0
-# powermate.EVT_POWERMATE_ROTATE (self.frame, self.on_rotate)
-# powermate.EVT_POWERMATE_BUTTON (self.frame, self.on_button)
-# except:
-# print "FYI: No Powermate or Contour Knob found"
-
-
- def on_rotate (self, event):
- self.rot += event.delta
- if (self.state == "FREQ"):
- if self.rot >= 3:
- self.set_freq(self.freq + .1e6)
- self.rot -= 3
- elif self.rot <=-3:
- self.set_freq(self.freq - .1e6)
- self.rot += 3
- else:
- step = self.volume_range()[2]
- if self.rot >= 3:
- self.set_vol(self.vol + step)
- self.rot -= 3
- elif self.rot <=-3:
- self.set_vol(self.vol - step)
- self.rot += 3
-
- def on_button (self, event):
- if event.value == 0: # button up
- return
- self.rot = 0
- if self.state == "FREQ":
- self.state = "VOL"
- else:
- self.state = "FREQ"
- self.update_status_bar ()
-#
-#
-# def set_vol (self, vol):
-# g = self.volume_range()
-# self.vol = max(g[0], min(g[1], vol))
-# self.volume_control.set_k(10**(self.vol/10))
-# self.myform['volume'].set_value(self.vol)
-# self.update_status_bar ()
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.set_rx_freq(0, target_freq);
-
- if r:
- self.freq = target_freq
- self.myform['freq'].set_value(target_freq) # update displayed value
- self.myform['freq_slider'].set_value(target_freq) # update displayed value
- self.update_status_bar()
- self._set_status_msg("OK", 0)
- return True
-
- self._set_status_msg("Failed", 0)
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- self.u.set_pga(0,gain)
-
- def update_status_bar (self):
- msg = "Volume:%r Setting:%s" % (self.vol, self.state)
- self._set_status_msg(msg, 1)
- #self.src_fft.set_baseband_freq(self.freq)
-#
-# def volume_range(self):
-# return (-20.0, 0.0, 0.5)
-
-
-if __name__ == '__main__':
- app = stdgui2.stdapp (wfm_rx_block, "MSDD FFT RX")
- app.MainLoop ()
diff --git a/gr-msdd6000/src/python-examples/msdd_rs_spec_an.py b/gr-msdd6000/src/python-examples/msdd_rs_spec_an.py
deleted file mode 100755
index 4855375b8..000000000
--- a/gr-msdd6000/src/python-examples/msdd_rs_spec_an.py
+++ /dev/null
@@ -1,350 +0,0 @@
-#!/usr/bin/env python
-#
-# 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
-from gnuradio import msdd_rs
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.qtgui import qtgui
-from optparse import OptionParser
-import sys,time
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Please install gr-qtgui."
- sys.exit(1)
-
-try:
- from msdd_display_qtgui import Ui_MainWindow
-except ImportError:
- print "Error: could not find msdd_display_qtgui.py:"
- print "\t\"pyuic4 msdd_display_qtgui.ui -o msdd_display_qtgui.py\""
- sys.exit(1)
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-class main_window(QtGui.QMainWindow):
- def __init__(self, snk, fg, parent=None):
-
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_MainWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- # Add the qtsnk widgets to the layout box
- self.gui.sinkLayout.addWidget(snk)
-
- self.gui.dcGainEdit.setText(QtCore.QString("%1").arg(0.001))
-
- # Connect up some signals
- self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
- self.pauseFg)
- self.connect(self.gui.frequencyEdit, QtCore.SIGNAL("editingFinished()"),
- self.frequencyEditText)
- self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainEditText)
- self.connect(self.gui.bandwidthEdit, QtCore.SIGNAL("editingFinished()"),
- self.bandwidthEditText)
- self.connect(self.gui.amplifierEdit, QtCore.SIGNAL("editingFinished()"),
- self.amplifierEditText)
-
- self.connect(self.gui.actionSaveData, QtCore.SIGNAL("activated()"),
- self.saveData)
- self.gui.actionSaveData.setShortcut(QtGui.QKeySequence.Save)
-
- self.connect(self.gui.dcGainEdit, QtCore.SIGNAL("editingFinished()"),
- self.dcGainEditText)
- self.connect(self.gui.dcCancelCheckBox, QtCore.SIGNAL("clicked(bool)"),
- self.dcCancelClicked)
-
- def pauseFg(self):
- if(self.gui.pauseButton.text() == "Pause"):
- self.fg.stop()
- self.fg.wait()
- self.fg.stop_data()
- self.gui.pauseButton.setText("Unpause")
- else:
- self.fg.start()
- self.fg.start_data()
- self.gui.pauseButton.setText("Pause")
-
-
- # Functions to set the values in the GUI
- def set_frequency(self, freq):
- self.freq = freq
- sfreq = eng_notation.num_to_str(self.freq)
- self.gui.frequencyEdit.setText(QtCore.QString("%1").arg(sfreq))
-
- def set_gain(self, gain):
- self.gain = gain
- self.gui.gainEdit.setText(QtCore.QString("%1").arg(self.gain))
-
- def set_bandwidth(self, bw):
- self.bw = bw
- sbw = eng_notation.num_to_str(self.bw)
- self.gui.bandwidthEdit.setText(QtCore.QString("%1").arg(sbw))
-
- def set_amplifier(self, amp):
- self.amp = amp
- self.gui.amplifierEdit.setText(QtCore.QString("%1").arg(self.amp))
-
-
- # Functions called when signals are triggered in the GUI
- def frequencyEditText(self):
- try:
- freq = eng_notation.str_to_num(self.gui.frequencyEdit.text().toAscii())
- self.fg.set_frequency(freq)
- self.freq = freq
- except RuntimeError:
- pass
-
- def gainEditText(self):
- try:
- gain = float(self.gui.gainEdit.text())
- self.fg.set_gain(gain)
- self.gain = gain
- except ValueError:
- pass
-
- def bandwidthEditText(self):
- try:
- bw = eng_notation.str_to_num(self.gui.bandwidthEdit.text().toAscii())
- self.fg.set_bandwidth(bw)
- self.bw = bw
- except ValueError:
- pass
-
- def amplifierEditText(self):
- try:
- amp = float(self.gui.amplifierEdit.text())
- self.fg.set_amplifier_gain(amp)
- self.amp = amp
- except ValueError:
- pass
-
- def saveData(self):
- fileName = QtGui.QFileDialog.getSaveFileName(self, "Save data to file", ".");
- if(len(fileName)):
- self.fg.save_to_file(str(fileName))
-
- def dcGainEditText(self):
- gain = float(self.gui.dcGainEdit.text())
- self.fg.set_dc_gain(gain)
-
- def dcCancelClicked(self, state):
- self.dcGainEditText()
- self.fg.cancel_dc(state)
-
-
-
-class my_top_block(gr.top_block):
- def __init__(self):
- gr.top_block.__init__(self)
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-e", "--interface", type="string", default="eth0",
- help="select Ethernet interface, default is eth0")
- parser.add_option("-m", "--mac-addr", type="string", default="",
- help="select USRP by MAC address, default is auto-select")
- parser.add_option("-W", "--bw", type="float", default=1e6,
- help="set bandwidth of receiver [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default="2.4G",
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("--fft-size", type="int", default=2048,
- help="Set number of FFT bins [default=%default]")
- (options, args) = parser.parse_args()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
- self.show_debug_info = True
-
- self.qapp = QtGui.QApplication(sys.argv)
-
-# self.u = usrp2.source_32fc(options.interface, options.mac_addr)
- self.u = msdd_rs.source_simple("192.168.1.20", 10000);
- self.conv = gr.interleaved_short_to_complex();
- self._adc_rate = self.u.pull_adc_freq()
- self.set_bandwidth(options.bw)
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
-# g = self.u.gain_range()
- g = [0, 10]
- #options.gain = float(g[0]+g[1])/2
- options.gain = float(0)
- self.set_gain(options.gain)
-
- if options.freq is None:
- options.freq = 2.4e9;
-# # if no frequency was specified, use the mid-point of the subdev
-# f = self.u.freq_range()
-# options.freq = float(f[0]+f[1])/2
-
- self.set_frequency(options.freq)
-
- self._fftsize = options.fft_size
-
-
- self._freq = options.freq;
- self._bandwidth = 400;
-
- self.set_bandwidth(self._bandwidth);
-
- self.snk = qtgui.sink_c(options.fft_size, gr.firdes.WIN_BLACKMAN_hARRIS,
- self._freq, self._bandwidth,
- "USRP2 Display",
- True, True, False, True, False)
-
- # Set up internal amplifier
- self.amp = gr.multiply_const_cc(0.0)
- self.set_amplifier_gain(0.01)
-
- # Create a single-pole IIR filter to remove DC
- # but don't connect it yet
- self.dc_gain = 0.001
- self.dc = gr.single_pole_iir_filter_cc(self.dc_gain)
- self.dc_sub = gr.sub_cc()
-
- self.agc = gr.agc2_cc(1e-3, 1e-5, 0.01, 0.01, 10);
-
- self.connect(self.u, self.conv, self.snk)
- #self.connect(self.u, self.conv, self.amp, self.snk)
-
- if self.show_debug_info:
- print "Decimation rate: ", self._decim
- print "Bandwidth: ", self._bandwidth
-# print "D'board: ", self.u.daughterboard_id()
-
- # Get the reference pointer to the SpectrumDisplayForm QWidget
- # Wrap the pointer as a PyQt SIP object
- # This can now be manipulated as a PyQt4.QtGui.QWidget
- self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
-
- self.main_win = main_window(self.pysink, self)
-
- self.main_win.set_frequency(self._freq)
- self.main_win.set_gain(self._gain)
- self.main_win.set_bandwidth(self._bandwidth)
- self.main_win.set_amplifier(self._amp_value)
-
- self.main_win.show()
-
-
- def save_to_file(self, name):
- self.lock()
-
- # Add file sink to save data
- self.file_sink = gr.file_sink(gr.sizeof_gr_complex, name)
- self.connect(self.conv, self.file_sink)
-
- self.unlock()
-
- def set_gain(self, gain):
- self._gain = gain
- self.u.set_ddc_gain(self._gain)
-
- def set_frequency(self, freq):
- self._freq = freq
- r = self.u.set_rx_freq(freq)
-
- try:
- self.snk.set_frequency_range(self._freq, self._bandwidth)
- except:
- pass
-
- def set_bandwidth(self, bw):
- self._bandwidth = bw
- self._decim = int(self._adc_rate / self._bandwidth)
-# self.u.set_decim_rate(self._decim)
- r1 = self.u.set_ddc_samp_rate( bw );
- r2 = self.u.set_ddc_bw( bw );
- self.u.start_data();
-
- print r1
- print r2;
-
- time.sleep(0.05);
- bw = self.u.pull_ddc_bw();
- sr = self.u.pull_ddc_samp_rate();
- fc = self.u.pull_rx_freq();
-
- #self.snk.d_bandwidth = sr;
-
- print bw;
- print sr;
- print fc;
-
-# sys.exit(-1);
-
- try:
- self.snk.set_frequency_range(self._freq, self._bandwidth)
- except:
- pass
-
- def set_amplifier_gain(self, amp):
- self._amp_value = amp
- self.amp.set_k(self._amp_value)
-
- def set_dc_gain(self, gain):
- self.dc.set_taps(gain)
-
- def cancel_dc(self, state):
- self.lock()
-
- if(state):
- self.disconnect(self.u, self.amp)
- self.connect(self.u, (self.dc_sub,0))
- self.connect(self.u, self.dc, (self.dc_sub,1))
- self.connect(self.dc_sub, self.amp)
- else:
- self.disconnect(self.dc_sub, self.amp)
- self.disconnect(self.dc, (self.dc_sub,1))
- self.disconnect(self.u, self.dc)
- self.disconnect(self.u, (self.dc_sub,0))
- self.connect(self.u, self.amp)
-
- self.unlock()
-
-def main ():
- tb = my_top_block()
- tb.start()
- tb.u.start_data();
- tb.snk.exec_();
-
-if __name__ == '__main__':
- try:
- main ()
- except KeyboardInterrupt:
- pass
-
diff --git a/gr-msdd6000/src/python-examples/msdd_spectrum_sense.py b/gr-msdd6000/src/python-examples/msdd_spectrum_sense.py
deleted file mode 100755
index e3d182b03..000000000
--- a/gr-msdd6000/src/python-examples/msdd_spectrum_sense.py
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-
-from gnuradio import gr, gru, eng_notation, optfir, window
-from gnuradio import msdd
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import sys
-import math
-import struct
-from pylab import *
-from numpy import array
-import time
-
-matplotlib.interactive(True)
-matplotlib.use('TkAgg')
-
-class tune(gr.feval_dd):
- """
- This class allows C++ code to callback into python.
- """
- def __init__(self, tb):
- gr.feval_dd.__init__(self)
- self.tb = tb
-
- def eval(self, ignore):
- """
- This method is called from gr.bin_statistics_f when it wants to change
- the center frequency. This method tunes the front end to the new center
- frequency, and returns the new frequency as its result.
- """
- try:
- # We use this try block so that if something goes wrong from here
- # down, at least we'll have a prayer of knowing what went wrong.
- # Without this, you get a very mysterious:
- #
- # terminate called after throwing an instance of 'Swig::DirectorMethodException'
- # Aborted
- #
- # message on stderr. Not exactly helpful ;)
-
- new_freq = self.tb.set_next_freq()
- return new_freq
-
- except Exception, e:
- print "tune: Exception: ", e
-
-
-class parse_msg(object):
- def __init__(self, sample_rate, percent, alpha=0.01):
- self.axis_font_size = 16
- self.label_font_size = 18
- self.title_font_size = 20
- self.text_size = 22
-
- self.fig = figure(1, facecolor="w", figsize=(12,9))
- self.sp = self.fig.add_subplot(1,1,1)
- self.pl = self.sp.plot(range(100), 100*[1,])
-
- params = {'backend': 'ps',
- 'xtick.labelsize': self.axis_font_size,
- 'ytick.labelsize': self.axis_font_size,
- 'text.usetex': False}
- rcParams.update(params)
-
- self.sp.set_title(("FFT"), fontsize=self.title_font_size, fontweight="bold")
- self.sp.set_xlabel("Frequency (Hz)", fontsize=self.label_font_size, fontweight="bold")
- self.sp.set_ylabel("Magnitude (dB)", fontsize=self.label_font_size, fontweight="bold")
- self.text_alpha = figtext(0.10, 0.94, ('Moving average alpha: %s' % alpha), weight="heavy", size=self.text_size)
-
- self.cfreqs = list()
- self.freqrange = list()
- self.data = list() #array('f')
-
- self.alpha = alpha
-
- self.index = 0
- self.full = False
- self.last_cfreq = 0
-
- self.sample_rate = sample_rate
- self.percent = (1.0-percent)/2.0
-
- def parse(self, msg):
- self.center_freq = msg.arg1()
- self.vlen = int(msg.arg2())
- assert(msg.length() == self.vlen * gr.sizeof_float)
-
-
- if(self.center_freq < self.last_cfreq):
- print "Plotting spectrum\n"
- self.full = True
-
- self.pl[0].set_data([self.freqrange, self.data])
- self.sp.set_ylim([min(self.data), max(self.data)])
- self.sp.set_xlim([min(self.freqrange), max(self.freqrange)])
- draw()
-
- self.index = 0
- del self.freqrange
- self.freqrange = list()
- #raw_input()
-
- self.last_cfreq = self.center_freq
-
- startind = int(self.percent * self.vlen)
- endind = int((1.0 - self.percent) * self.vlen)
-
- fstep = self.sample_rate / self.vlen
- f = [self.center_freq - self.sample_rate/2.0 + i*fstep for i in range(startind, endind)]
- self.freqrange += f
-
- t = msg.to_string()
- d = struct.unpack('%df' % (self.vlen,), t)
-
- if self.full:
- for i in range(startind, endind):
- self.data[self.index] = (1.0-self.alpha)*self.data[self.index] + (self.alpha)*d[i]
- self.index += 1
- else:
- self.data += [di for di in d[startind:endind]]
-
-
-class my_top_block(gr.top_block):
-
- def __init__(self):
- gr.top_block.__init__(self)
-
- usage = "usage: %prog [options] host min_freq max_freq"
- parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("", "--tune-delay", type="eng_float", default=5e-5, metavar="SECS",
- help="time to delay (in seconds) after changing frequency [default=%default]")
- parser.add_option("", "--dwell-delay", type="eng_float", default=50e-5, metavar="SECS",
- help="time to dwell (in seconds) at a given frequncy [default=%default]")
- parser.add_option("-F", "--fft-size", type="int", default=256,
- help="specify number of FFT bins [default=%default]")
- parser.add_option("-d", "--decim", type="intx", default=16,
- help="set decimation to DECIM [default=%default]")
- parser.add_option("", "--real-time", action="store_true", default=False,
- help="Attempt to enable real-time scheduling")
-
- (options, args) = parser.parse_args()
- if len(args) != 3:
- parser.print_help()
- sys.exit(1)
-
- self.address = args[0]
- self.min_freq = eng_notation.str_to_num(args[1])
- self.max_freq = eng_notation.str_to_num(args[2])
-
- self.decim = options.decim
- self.gain = options.gain
-
- if self.min_freq > self.max_freq:
- self.min_freq, self.max_freq = self.max_freq, self.min_freq # swap them
-
- self.fft_size = options.fft_size
-
- if not options.real_time:
- realtime = False
- else:
- # 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"
-
- adc_rate = 102.4e6
- self.int_rate = adc_rate / self.decim
- print "Sampling rate: ", self.int_rate
-
- # build graph
- self.port = 10001
- self.src = msdd.source_simple(self.address, self.port)
- self.src.set_decim_rate(self.decim)
-
- self.set_gain(self.gain)
- self.set_freq(self.min_freq)
-
- s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self.fft_size)
-
- mywindow = window.blackmanharris(self.fft_size)
- fft = gr.fft_vcc(self.fft_size, True, mywindow, True)
- power = 0
- for tap in mywindow:
- power += tap*tap
-
- norm = gr.multiply_const_cc(1.0/self.fft_size)
- c2mag = gr.complex_to_mag_squared(self.fft_size)
-
- # FIXME the log10 primitive is dog slow
- log = gr.nlog10_ff(10, self.fft_size,
- -20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size))
-
- # Set the freq_step to % of the actual data throughput.
- # This allows us to discard the bins on both ends of the spectrum.
- self.percent = 0.4
-
- self.freq_step = self.percent * self.int_rate
- self.min_center_freq = self.min_freq + self.freq_step/2
- nsteps = math.ceil((self.max_freq - self.min_freq) / self.freq_step)
- self.max_center_freq = self.min_center_freq + (nsteps * self.freq_step)
-
- self.next_freq = self.min_center_freq
-
- tune_delay = max(0, int(round(options.tune_delay * self.int_rate / self.fft_size))) # in fft_frames
- dwell_delay = max(1, int(round(options.dwell_delay * self.int_rate / self.fft_size))) # in fft_frames
-
- self.msgq = gr.msg_queue(16)
- self._tune_callback = tune(self) # hang on to this to keep it from being GC'd
- stats = gr.bin_statistics_f(self.fft_size, self.msgq,
- self._tune_callback, tune_delay, dwell_delay)
-
- # FIXME leave out the log10 until we speed it up
- self.connect(self.src, s2v, fft, c2mag, log, stats)
-
-
- def set_next_freq(self):
- target_freq = self.next_freq
- self.next_freq = self.next_freq + self.freq_step
- if self.next_freq >= self.max_center_freq:
- self.next_freq = self.min_center_freq
-
- if not self.set_freq(target_freq):
- print "Failed to set frequency to", target_freq
-
- return target_freq
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- """
- return self.src.set_rx_freq(0, target_freq)
-
-
- def set_gain(self, gain):
- self.src.set_pga(0, gain)
-
-
-def main_loop(tb):
- msgparser = parse_msg(tb.int_rate, tb.percent)
-
- while 1:
-
- # Get the next message sent from the C++ code (blocking call).
- # It contains the center frequency and the mag squared of the fft
- msgparser.parse(tb.msgq.delete_head())
-
- # Print center freq so we know that something is happening...
- print msgparser.center_freq
-
- # FIXME do something useful with the data...
-
- # m.data are the mag_squared of the fft output (they are in the
- # standard order. I.e., bin 0 == DC.)
- # You'll probably want to do the equivalent of "fftshift" on them
- # m.raw_data is a string that contains the binary floats.
- # You could write this as binary to a file.
-
-
-if __name__ == '__main__':
- tb = my_top_block()
- try:
- tb.start() # start executing flow graph in another thread...
- main_loop(tb)
-
- except KeyboardInterrupt:
- pass
diff --git a/gr-msdd6000/src/python-examples/msdd_spectrum_waterfall.py b/gr-msdd6000/src/python-examples/msdd_spectrum_waterfall.py
deleted file mode 100755
index 05f047e11..000000000
--- a/gr-msdd6000/src/python-examples/msdd_spectrum_waterfall.py
+++ /dev/null
@@ -1,306 +0,0 @@
-#!/usr/bin/env python
-#
-# 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.
-#
-
-from gnuradio import gr, gru, eng_notation, optfir, window
-from gnuradio import msdd
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import sys
-import math
-import struct
-from pylab import *
-from numpy import array
-import time
-
-matplotlib.interactive(True)
-matplotlib.use('TkAgg')
-
-class tune(gr.feval_dd):
- """
- This class allows C++ code to callback into python.
- """
- def __init__(self, tb):
- gr.feval_dd.__init__(self)
- self.tb = tb
-
- def eval(self, ignore):
- """
- This method is called from gr.bin_statistics_f when it wants to change
- the center frequency. This method tunes the front end to the new center
- frequency, and returns the new frequency as its result.
- """
- try:
- # We use this try block so that if something goes wrong from here
- # down, at least we'll have a prayer of knowing what went wrong.
- # Without this, you get a very mysterious:
- #
- # terminate called after throwing an instance of 'Swig::DirectorMethodException'
- # Aborted
- #
- # message on stderr. Not exactly helpful ;)
-
- new_freq = self.tb.set_next_freq()
- return new_freq
-
- except Exception, e:
- print "tune: Exception: ", e
-
-
-class parse_msg(object):
- def __init__(self, sample_rate, percent):
- self.axis_font_size = 16
- self.label_font_size = 18
- self.title_font_size = 20
- self.text_size = 22
-
- # Set up figures and subplots
- self.fig = figure(1, facecolor="w", figsize=(12,9))
- self.sp = self.fig.add_subplot(1,1,1)
- self.pl = self.sp.matshow(100*[range(100),])
-
- params = {'xtick.labelsize': self.axis_font_size,
- 'ytick.labelsize': self.axis_font_size}
- rcParams.update(params)
-
- # Throw up some title info
- self.sp.set_title(("FFT"), fontsize=self.title_font_size, fontweight="bold")
- self.sp.set_xlabel("Frequency (Hz)", fontsize=self.label_font_size, fontweight="bold")
- self.sp.set_ylabel("Sample index (should be time)", fontsize=self.label_font_size, fontweight="bold")
-
- self.freqrange = list()
- self.data = list()
- self.data3 = list()
-
- self.index = 0
- self.last_cfreq = 0
-
- # So we know how to splice the data
- self.sample_rate = sample_rate
- self.percent = (1.0-percent)/2.0
-
- def parse(self, msg):
- self.center_freq = msg.arg1() # read the current center frequency
- self.vlen = int(msg.arg2()) # read the length of the data set received
-
- # wait until we wrap around before plotting the entire collected band
- if(self.center_freq < self.last_cfreq):
- #print "Plotting spectrum\n"
-
- # If we have 100 sets, start dropping the oldest
- if(len(self.data3) > 100):
- self.data3.pop(0)
- self.data3.append(self.data)
-
- # add the new data to the plot
- self.pl.set_data(self.data3)
- draw()
-
- # reset lists to collect next round
- self.index = 0
- del self.freqrange
- self.freqrange = list()
- del self.data
- self.data = list()
- #raw_input()
-
- self.last_cfreq = self.center_freq
-
- startind = int(self.percent * self.vlen)
- endind = int((1.0 - self.percent) * self.vlen)
-
- fstep = self.sample_rate / self.vlen
- f = [self.center_freq - self.sample_rate/2.0 + i*fstep for i in range(startind, endind)]
- self.freqrange += f
-
- t = msg.to_string();
-
- d = struct.unpack('%df' % (self.vlen,), t)
-
- self.data += [di for di in d[startind:endind]]
-
-
-class my_top_block(gr.top_block):
- def __init__(self):
- gr.top_block.__init__(self)
-
- # Build an options parser to bring in information from the user on usage
- usage = "usage: %prog [options] host min_freq max_freq"
- parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-g", "--gain", type="eng_float", default=32,
- help="set gain in dB (default is midpoint)")
- parser.add_option("", "--tune-delay", type="eng_float", default=5e-5, metavar="SECS",
- help="time to delay (in seconds) after changing frequency [default=%default]")
- parser.add_option("", "--dwell-delay", type="eng_float", default=50e-5, metavar="SECS",
- help="time to dwell (in seconds) at a given frequncy [default=%default]")
- parser.add_option("-F", "--fft-size", type="int", default=256,
- help="specify number of FFT bins [default=%default]")
- parser.add_option("-d", "--decim", type="intx", default=16,
- help="set decimation to DECIM [default=%default]")
- parser.add_option("", "--real-time", action="store_true", default=False,
- help="Attempt to enable real-time scheduling")
-
- (options, args) = parser.parse_args()
- if len(args) != 3:
- parser.print_help()
- sys.exit(1)
-
- # get user-provided info on address of MSDD and frequency to sweep
- self.address = args[0]
- self.min_freq = eng_notation.str_to_num(args[1])
- self.max_freq = eng_notation.str_to_num(args[2])
-
- self.decim = options.decim
- self.gain = options.gain
-
- if self.min_freq > self.max_freq:
- self.min_freq, self.max_freq = self.max_freq, self.min_freq # swap them
-
- self.fft_size = options.fft_size
-
- if not options.real_time:
- realtime = False
- else:
- # 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"
-
- # Sampling rate is hardcoded and cannot be read off device
- adc_rate = 102.4e6
- self.int_rate = adc_rate / self.decim
- print "Sampling rate: ", self.int_rate
-
- # build graph
- self.port = 10001 # required port for UDP packets
-
- # which board, op mode, adx, port
-# self.src = msdd.source_c(0, 1, self.address, self.port) # build source object
-
- self.conv = gr.interleaved_short_to_complex();
-
- self.src = msdd.source_simple(self.address,self.port);
- self.src.set_decim_rate(self.decim) # set decimation rate
-# self.src.set_desired_packet_size(0, 1460) # set packet size to collect
-
- self.set_gain(self.gain) # set receiver's attenuation
- self.set_freq(self.min_freq) # set receiver's rx frequency
-
- # restructure into vector format for FFT input
- s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self.fft_size)
-
- # set up FFT processing block
- mywindow = window.blackmanharris(self.fft_size)
- fft = gr.fft_vcc(self.fft_size, True, mywindow, True)
- power = 0
- for tap in mywindow:
- power += tap*tap
-
- # calculate magnitude squared of output of FFT
- c2mag = gr.complex_to_mag_squared(self.fft_size)
-
- # FIXME the log10 primitive is dog slow
- log = gr.nlog10_ff(10, self.fft_size,
- -20*math.log10(self.fft_size)-10*math.log10(power/self.fft_size))
-
- # Set the freq_step to % of the actual data throughput.
- # This allows us to discard the bins on both ends of the spectrum.
- self.percent = 0.4
-
- # Calculate the frequency steps to use in the collection over the whole bandwidth
- self.freq_step = self.percent * self.int_rate
- self.min_center_freq = self.min_freq + self.freq_step/2
- nsteps = math.ceil((self.max_freq - self.min_freq) / self.freq_step)
- self.max_center_freq = self.min_center_freq + (nsteps * self.freq_step)
-
- self.next_freq = self.min_center_freq
-
- # use these values to set receiver settling time between samples and sampling time
- # the default values provided seem to work well with the MSDD over 100 Mbps ethernet
- tune_delay = max(0, int(round(options.tune_delay * self.int_rate / self.fft_size))) # in fft_frames
- dwell_delay = max(1, int(round(options.dwell_delay * self.int_rate / self.fft_size))) # in fft_frames
-
- # set up message callback routine to get data from bin_statistics_f block
- self.msgq = gr.msg_queue(16)
- self._tune_callback = tune(self) # hang on to this to keep it from being GC'd
-
- # FIXME this block doesn't like to work with negatives because of the "d_max[i]=0" on line
- # 151 of gr_bin_statistics_f.cc file. Set this to -10000 or something to get it to work.
- stats = gr.bin_statistics_f(self.fft_size, self.msgq,
- self._tune_callback, tune_delay, dwell_delay)
-
- # FIXME there's a concern over the speed of the log calculation
- # We can probably calculate the log inside the stats block
- self.connect(self.src, self.conv, s2v, fft, c2mag, log, stats)
-
-
- def set_next_freq(self):
- ''' Find and set the next frequency of the reciver. After going past the maximum frequency,
- the frequency is wrapped around to the start again'''
- target_freq = self.next_freq
- self.next_freq = self.next_freq + self.freq_step
- if self.next_freq >= self.max_center_freq:
- self.next_freq = self.min_center_freq
-
- if not self.set_freq(target_freq):
- print "Failed to set frequency to", target_freq
-
- return target_freq
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- """
- return self.src.set_rx_freq(0, target_freq)
-
-
- def set_gain(self, gain):
- self.src.set_pga(0, gain)
-
-
-def main_loop(tb):
- # Set up parser to get data from stats block and display them.
- msgparser = parse_msg(tb.int_rate, tb.percent)
-
- while 1:
- # Get the next message sent from the C++ code (blocking call).
- # It contains the center frequency and the mag squared of the fft
- d = tb.msgq.delete_head();
- print d.to_string();
- msgparser.parse(d)
- #print msgparser.center_freq
-
-if __name__ == '__main__':
- tb = my_top_block()
- try:
- tb.start() # start executing flow graph in another thread...
- main_loop(tb)
-
- except KeyboardInterrupt:
- pass
diff --git a/gr-msdd6000/src/python-examples/new_msdd_fft.py b/gr-msdd6000/src/python-examples/new_msdd_fft.py
deleted file mode 100755
index 782ecb66e..000000000
--- a/gr-msdd6000/src/python-examples/new_msdd_fft.py
+++ /dev/null
@@ -1,299 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005,2007,2008,2010 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, gru
-from gnuradio import usrp
-from gnuradio import msdd
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
-from optparse import OptionParser
-import wx
-import sys
-import numpy
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- return (0, 0)
-
-
-class app_top_block(stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which USRP (0, 1, ...) default is %default",
- metavar="NUM")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-A", "--antenna", default=None,
- help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-W", "--waterfall", action="store_true", default=False,
- help="Enable waterfall display")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
- parser.add_option( "--no-hb", action="store_true", default=False,
- help="don't use halfband filter in usrp")
- parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
- help="Enable oscilloscope display")
- parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
- help="Set fftsink averaging factor, default=[%default]")
- parser.add_option("", "--ref-scale", type="eng_float", default=13490.0,
- help="Set dBFS=0dB input value, default=[%default]")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
- self.show_debug_info = True
-
- # build the graph
- if options.no_hb or (options.decim<8):
- #Min decimation of this firmware is 4.
- #contains 4 Rx paths without halfbands and 0 tx paths.
- self.fpga_filename="std_4rx_0tx.rbf"
-# self.u = usrp.source_c(which=options.which, decim_rate=options.decim, fpga_filename=self.fpga_filename)
- self.u = msdd.source_simple("192.168.1.200",0);
- else:
- #Min decimation of standard firmware is 8.
- #standard fpga firmware "std_2rxhb_2tx.rbf"
- #contains 2 Rx paths with halfband filters and 2 tx paths (the default)
- #self.u = usrp.source_c(which=options.which, decim_rate=options.decim)
- self.u = msdd.source_simple("192.168.1.200",0);
-
-
- input_rate = self.u.adc_freq() / self.u.decim_rate()
-
- if options.waterfall:
- self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=1024, sample_rate=input_rate)
- elif options.oscilloscope:
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
- else:
- self.scope = fftsink2.fft_sink_c (panel, fft_size=1024, sample_rate=input_rate,
- ref_scale=options.ref_scale, ref_level=0.0, y_divs = 10,
- avg_alpha=options.avg_alpha)
-
- self.conv = gr.interleaved_short_to_complex();
- self.connect(self.u, self.conv, self.scope)
-
- self._build_gui(vbox)
- self._setup_events()
-
- # set initial values
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- #g = self.subdev.gain_range()
- #g = self.u.gain_range()
- g = [0,10]
- options.gain = float(g[0]+g[1])/2
-
- if options.freq is None:
- # if no freq was specified, use the mid-point
- #r = self.subdev.freq_range()
- #r = self.u.freq_range()
- r = [30e6, 6e9]
- options.freq = float(r[0]+r[1])/2
-
- self.set_gain(options.gain)
-
- if options.antenna is not None:
- print "Selecting antenna %s" % (options.antenna,)
- self.subdev.select_rx_antenna(options.antenna)
-
- if self.show_debug_info:
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- self.myform['dbname'].set_value("no subdevs used")
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- vbox.Add(self.scope.win, 10, wx.EXPAND)
-
- # add control area at the bottom
- self.myform = myform = form.form()
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0, 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0, 0)
- #g = self.subdev.gain_range()
- #g = self.u.gain_range()
- g = [0,10]
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3,
- min=int(g[0]), max=int(g[1]),
- callback=self.set_gain)
-
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- self._build_subpanel(vbox)
-
- def _build_subpanel(self, vbox_arg):
- # build a secondary information panel (sometimes hidden)
-
- # FIXME figure out how to have this be a subpanel that is always
- # created, but has its visibility controlled by foo.Show(True/False)
-
- def _form_set_decim(kv):
- return self.set_decim(kv['decim'])
-
- if not(self.show_debug_info):
- return
-
- panel = self.panel
- vbox = vbox_arg
- myform = self.myform
-
- #panel = wx.Panel(self.panel, -1)
- #vbox = wx.BoxSizer(wx.VERTICAL)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['decim'] = form.int_field(
- parent=panel, sizer=hbox, label="Decim",
- callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
-
- hbox.Add((5,0), 1)
- myform['fs@usb'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@gigE")
-
- hbox.Add((5,0), 1)
- myform['dbname'] = form.static_text_field(
- parent=panel, sizer=hbox)
-
- hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
-
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- #r = self.u.tune(0, self.subdev, target_freq)
- r = self.u.set_rx_freq(0, target_freq)
-
- if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
-# if self.show_debug_info:
-# self.myform['baseband'].set_value(r.baseband_freq)
-# self.myform['ddc'].set_value(r.dxc_freq)
- if not self.options.waterfall and not self.options.oscilloscope:
- self.scope.set_baseband_freq(target_freq)
- return True
-
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- self.u.set_pga(0,gain)
-
- def set_decim(self, decim):
- ok = self.u.set_decim_rate(decim)
- if not ok:
- print "set_decim failed"
- input_rate = self.u.adc_freq() / self.u.decim_rate()
- self.scope.set_sample_rate(input_rate)
- if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- return ok
-
- def _setup_events(self):
- if not self.options.waterfall and not self.options.oscilloscope:
- self.scope.win.Bind(wx.EVT_LEFT_DCLICK, self.evt_left_dclick)
-
- def evt_left_dclick(self, event):
- (ux, uy) = self.scope.win.GetXY(event)
- if event.CmdDown():
- # Re-center on maximum power
- points = self.scope.win._points
- if self.scope.win.peak_hold:
- if self.scope.win.peak_vals is not None:
- ind = numpy.argmax(self.scope.win.peak_vals)
- else:
- ind = int(points.shape()[0]/2)
- else:
- ind = numpy.argmax(points[:,1])
- (freq, pwr) = points[ind]
- target_freq = freq/self.scope.win._scale_factor
- print ind, freq, pwr
- self.set_freq(target_freq)
- else:
- # Re-center on clicked frequency
- target_freq = ux/self.scope.win._scale_factor
- self.set_freq(target_freq)
-
-
-def main ():
- app = stdgui2.stdapp(app_top_block, "USRP FFT", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-msdd6000/src/python-examples/ofdm/benchmark_ofdm_rx.py b/gr-msdd6000/src/python-examples/ofdm/benchmark_ofdm_rx.py
deleted file mode 100755
index deb82e111..000000000
--- a/gr-msdd6000/src/python-examples/ofdm/benchmark_ofdm_rx.py
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, 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.
-#
-
-from gnuradio import gr, blks2
-from gnuradio import msdd
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-
-import struct, sys
-
-# from current dir
-from receive_path import receive_path
-
-class my_top_block(gr.top_block):
- def __init__(self, address, callback, options):
- gr.top_block.__init__(self)
-
- self._address = address
- self._rx_freq = options.rx_freq # receiver's center frequency
- self._rx_gain = options.rx_gain # receiver's gain
- self._decim = options.decim # Decimating rate for the USRP (prelim)
-
- if self._rx_freq is None:
- sys.stderr.write("-f FREQ or --freq FREQ or --rx-freq FREQ must be specified\n")
- raise SystemExit
-
- # Set up USRP source
- self._setup_source()
-
- #taps = gr.firdes.low_pass(1, 1, 0.4, 0.2)
- #self.resample = gr.rational_resampler_base_ccf(5, 8, taps)
- self.resample = blks2.rational_resampler_ccf(5, 8)
-
- # Set up receive path
- self.rxpath = receive_path(callback, options)
-
- self.connect(self.src, self.resample, self.rxpath)
- #self.connect(self.src, gr.file_sink(gr.sizeof_gr_complex, "receive.dat"))
- #self.connect(self.resample, gr.file_sink(gr.sizeof_gr_complex, "resampled.dat"))
-
- def _setup_source(self):
- # build graph
- self._port = 10001
- self.src = msdd.source_c(0, 1, self._address, self._port)
- self.src.set_decim_rate(self._decim)
- self.src.set_desired_packet_size(0, 1460)
-
- self.set_gain(self._rx_gain)
- self.set_freq(self._rx_freq)
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
- """
- r = self.src.set_rx_freq(0, target_freq)
- if r:
- return True
- return False
-
- def set_gain(self, gain):
- """
- Sets the analog gain in the USRP
- """
- return self.src.set_pga(0, gain)
-
- def decim(self):
- return self._decim
-
- def add_options(normal, expert):
- """
- Adds usrp-specific options to the Options Parser
- """
- add_freq_option(normal)
- normal.add_option("", "--rx-gain", type="eng_float", default=32, metavar="GAIN",
- help="set receiver gain in dB [default=%default].")
- normal.add_option("-v", "--verbose", action="store_true", default=False)
-
- expert.add_option("", "--rx-freq", type="eng_float", default=None,
- help="set Rx frequency to FREQ [default=%default]", metavar="FREQ")
- expert.add_option("-d", "--decim", type="intx", default=128,
- help="set fpga decimation rate to DECIM [default=%default]")
- expert.add_option("", "--snr", type="eng_float", default=30,
- help="set the SNR of the channel in dB [default=%default]")
-
- # Make a static method to call before instantiation
- add_options = staticmethod(add_options)
-
-def add_freq_option(parser):
- """
- Hackery that has the -f / --freq option set both tx_freq and rx_freq
- """
- def freq_callback(option, opt_str, value, parser):
- parser.values.rx_freq = value
- parser.values.tx_freq = value
-
- if not parser.has_option('--freq'):
- parser.add_option('-f', '--freq', type="eng_float",
- action="callback", callback=freq_callback,
- help="set Tx and/or Rx frequency to FREQ [default=%default]",
- metavar="FREQ")
-
-# /////////////////////////////////////////////////////////////////////////////
-# 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"
-
- usage = "usage: %prog [options] host"
- parser = OptionParser(usage=usage, 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")
-
- my_top_block.add_options(parser, expert_grp)
- receive_path.add_options(parser, expert_grp)
- blks2.ofdm_mod.add_options(parser, expert_grp)
- blks2.ofdm_demod.add_options(parser, expert_grp)
-
- (options, args) = parser.parse_args ()
- address = args[0]
-
- # build the graph
- tb = my_top_block(address, 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-msdd6000/src/python-examples/ofdm/gr_plot_ofdm.py b/gr-msdd6000/src/python-examples/ofdm/gr_plot_ofdm.py
deleted file mode 100755
index 0bca41037..000000000
--- a/gr-msdd6000/src/python-examples/ofdm/gr_plot_ofdm.py
+++ /dev/null
@@ -1,268 +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 scipy, pylab, math
-import struct, sys
-from pylab import *
-from matplotlib.font_manager import fontManager, FontProperties
-from optparse import OptionParser
-from scipy import fftpack
-from math import log10
-
-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 = "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-msdd6000/src/python-examples/ofdm/receive_path.py b/gr-msdd6000/src/python-examples/ofdm/receive_path.py
deleted file mode 100644
index 11c714aaf..000000000
--- a/gr-msdd6000/src/python-examples/ofdm/receive_path.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005,2006 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, gru, blks2
-from gnuradio import usrp
-from gnuradio import eng_notation
-import copy
-import sys
-
-# /////////////////////////////////////////////////////////////////////////////
-# receive path
-# /////////////////////////////////////////////////////////////////////////////
-
-class receive_path(gr.hier_block2):
- def __init__(self, rx_callback, options):
-
- gr.hier_block2.__init__(self, "receive_path",
- gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature
- gr.io_signature(0, 0, 0)) # Output signature
-
-
- options = copy.copy(options) # make a copy so we can destructively modify
-
- self._verbose = options.verbose
- self._log = options.log
- self._rx_callback = rx_callback # this callback is fired when there's a packet available
-
- # receiver
- self.ofdm_rx = \
- blks2.ofdm_demod(options, callback=self._rx_callback)
-
- # Carrier Sensing Blocks
- alpha = 0.001
- thresh = 30 # in dB, will have to adjust
- self.probe = gr.probe_avg_mag_sqrd_c(thresh,alpha)
-
- self.connect(self, self.ofdm_rx)
- self.connect(self.ofdm_rx, self.probe)
-
- # Display some information about the setup
- if self._verbose:
- self._print_verbage()
-
- def carrier_sensed(self):
- """
- Return True if we think carrier is present.
- """
- #return self.probe.level() > X
- return self.probe.unmuted()
-
- def carrier_threshold(self):
- """
- Return current setting in dB.
- """
- return self.probe.threshold()
-
- def set_carrier_threshold(self, threshold_in_db):
- """
- Set carrier threshold.
-
- @param threshold_in_db: set detection threshold
- @type threshold_in_db: float (dB)
- """
- self.probe.set_threshold(threshold_in_db)
-
-
- def add_options(normal, expert):
- """
- Adds receiver-specific options to the Options Parser
- """
- normal.add_option("-v", "--verbose", action="store_true", default=False)
- expert.add_option("", "--log", action="store_true", default=False,
- help="Log all parts of flow graph to files (CAUTION: lots of data)")
-
- # Make a static method to call before instantiation
- add_options = staticmethod(add_options)
-
-
- def _print_verbage(self):
- """
- Prints information about the receive path
- """
- pass
diff --git a/gr-msdd6000/src/python-examples/playback_samples.m b/gr-msdd6000/src/python-examples/playback_samples.m
deleted file mode 100644
index 332296e72..000000000
--- a/gr-msdd6000/src/python-examples/playback_samples.m
+++ /dev/null
@@ -1,12 +0,0 @@
-t = read_complex_binary('msdd.dat',10000000);
-
-fftsize=256;
-w = [0:pi/fftsize:pi];
-
-for i = 0:length(t)/fftsize
- fftdata = fft(i*fftsize:i*fftsize+fftsize);
- clear plot;
- plot(w,fftdata);
-endfor
-
-pause;
diff --git a/gr-msdd6000/src/python-examples/read_complex_binary.m b/gr-msdd6000/src/python-examples/read_complex_binary.m
deleted file mode 100644
index 67158b528..000000000
--- a/gr-msdd6000/src/python-examples/read_complex_binary.m
+++ /dev/null
@@ -1,48 +0,0 @@
-%
-% Copyright 2001 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.
-%
-
-function v = read_complex_binary (filename, count)
-
- %% usage: read_complex_binary (filename, [count])
- %%
- %% open filename and return the contents as a column vector,
- %% treating them as 32 bit complex numbers
- %%
-
- m = nargchk (1,2,nargin);
- if (m)
- usage (m);
- end
-
- if (nargin < 2)
- count = Inf;
- end
-
- f = fopen (filename, 'rb');
- if (f < 0)
- v = 0;
- else
- t = fread (f, [2, count], 'float');
- fclose (f);
- v = t(1,:) + t(2,:)*i;
- [r, c] = size (v);
- v = reshape (v, c, r);
- end
diff --git a/gr-msdd6000/src/python_test/capture_tcp_one_set.py b/gr-msdd6000/src/python_test/capture_tcp_one_set.py
deleted file mode 100644
index 7a106a63a..000000000
--- a/gr-msdd6000/src/python_test/capture_tcp_one_set.py
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-port = 10000
-host = "10.45.4.46"
-#host = "10.45.4.41"
-myaddr = ('',myport);
-
-buf = 100000;
-
-TCPSock = socket(AF_INET,SOCK_STREAM);
-TCPSock.bind(myaddr);
-TCPSock.connect((host,port));
-
-#f_mhz = 2647; # roof ofdm
-if(len(sys.argv)!= 3):
- print "usage: %s fc_ghz decim_pow2_exponent"%(sys.argv[0]);
- sys.exit(-1);
-
-f_mhz = float(sys.argv[1])*1000;
-decim = int(sys.argv[2]);
-
-#f_mhz = 3500;
-#f_mhz = 2600;
-f_hz = 0; # offset
-gain = 0;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-samples = 65536;
-#samples = 16777216;
-samples = samples*4; #bytes of data we are requesting
-samples=samples*2;
-#decim = 2; #0-8 (3 => 2^3 = 8)
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-sets = 1;
-
-raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-TCPSock.send(data);
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-while(TCPSock):
- if(state==0):
- data = TCPSock.recv(4);
- [opcode] = struct.unpack("<I", data);
- print "Opcode = %d"%(opcode);
- if(opcode==1):
- state = 1;
-
- elif(state==1):
- data = TCPSock.recv(7*4);
- args = struct.unpack("<IIIIIII", data);
- print ["reply_len", "freq_mhz", "offset_hz", "gain", "sample_bytes", "decim", "sets_remain"];
- print args;
- IQ_bytes = args[0] - 7*4;
- state =2;
-
- elif(state==2):
- data = TCPSock.recv(4);
- [i,q] = struct.unpack("<hh", data);
- tmp = complex(i,q);
-
- re.append(i);
- vals.append(tmp);
- mags.append(abs(tmp));
-
-
- sample_count = sample_count + 1;
-# print "sample count %d"%(sample_count)
-
- IQ_bytes = IQ_bytes - 4;
- if(IQ_bytes < 4):
- print "got all data (total %d)"%(sample_count);
- print "remaining: %d"%(IQ_bytes);
- break;
-
-
-TCPSock.close();
-
-print "done"
-nmags = []
-for i in mags:
- if i == 0:
- i=1;
- nmags.append(i);
-
-
-subplot(2,1,1);
-plot(nmags);
-#plot(10*log10(nmags));
-
-dlen = len(vals);
-fftlen = (dlen-1024)/1024;
-
-fft_data = []
-for i in range(1, dlen-1025, 1024):
-
- t_in = [];
- for ind in range(i, i+1024):
- t_in.append(vals[ind]);
-
- #tmp = 20*log10(fftshift(fft(t_in)));
- tmp = (fftshift(fft(t_in)));
-
- if(len(fft_data) == 0):
- for ind in range(0,1024):
- fft_data.append( tmp[ind] );
- else:
- for ind in range(0,1024):
- fft_data[ind] = fft_data[ind] + tmp[ind];
-
-#fft_data = 20*log10(fftshift(fft(vals)));
-
-
-subplot(2,1,2);
-plot(fft_data);
-show();
-
-f = open(filename, "w");
-for sample in vals:
- binchunk = struct.pack("<ff",float(sample.real), float(sample.imag) );
- f.write(binchunk);
-f.close();
-
-
diff --git a/gr-msdd6000/src/python_test/flood_udp.py b/gr-msdd6000/src/python_test/flood_udp.py
deleted file mode 100644
index e59208a7a..000000000
--- a/gr-msdd6000/src/python_test/flood_udp.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-
-msdd_port = 10001
-msdd_host = "10.45.4.43"
-
-my_udp_addr = ("10.45.1.229",10001);
-
-buf = 1024;
-
-#myport = random.randint(1025,65535);
-#my_tcp_addr = ("10.45.1.229",myport);
-#TCPSock = socket(AF_INET,SOCK_STREAM);
-#TCPSock.bind(my_tcp_addr);
-#TCPSock.connect((msdd_host,msdd_port));
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-SETS_STREAM = 0xffffffff;
-
-f_mhz = 2400;
-f_hz = 1;
-gain = 3;
-samples = 512;
-decim = 4;
-#sets = 16;
-sets = SETS_STREAM;
-window = 3;
-mode = 1;
-
-
-
-for first_byte in range(0,0xff):
- for second_byte in range(0,0xff):
- for third_byte in range(0,0xff):
- data = struct.pack("!III", first_byte, second_byte,third_byte);
- UDPSock.sendto(data, (msdd_host,msdd_port))
-
-
-# construct the 3 different request type packets
-#fft_data = struct.pack("<IIIIIIIIII", 0x02, 0x20, f_mhz, f_hz, gain,window, samples, decim, mode,sets);
-#raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets);
-#stat_data = struct.pack("!II", 0x0000, 0x0000)
-
-# send appropriate udp request packet
-
-
-
-
-
-
-
-
-
diff --git a/gr-msdd6000/src/python_test/halt.py b/gr-msdd6000/src/python_test/halt.py
deleted file mode 100644
index 0285f7817..000000000
--- a/gr-msdd6000/src/python_test/halt.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-msdd_host = "10.45.4.43"
-
-buf = 100000;
-
-my_udp_addr = ('',10001);
-my_udp_addr = ('10.45.1.229 ',10001);
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-halt_data = struct.pack("<II", 0x04, 0x00);
-halt_data = struct.pack("<II", 0x04, 0x00);
-
-data = halt_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-
-print "sent"
-
-UDPSock.close();
-
-
-
diff --git a/gr-msdd6000/src/python_test/newtest.py b/gr-msdd6000/src/python_test/newtest.py
deleted file mode 100644
index 9596a0675..000000000
--- a/gr-msdd6000/src/python_test/newtest.py
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-msdd_host = "10.45.4.43"
-
-buf = 100000;
-
-my_udp_addr = ('',10001);
-my_udp_addr = ('10.45.1.229 ',10001);
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-#f_mhz = 3500;
-#f_mhz = 3500;
-f_mhz = 100;
-f_hz = 0;
-gain = 0;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-samples = 12000;
-samples = samples*4; #bytes of data we are requesting
-
-decim = 2; #0-8 (3 => 2^3 = 8)
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-#sets = 0;
-sets = 0xffffffff;
-
-size_int = 4;
-request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields
-print "request len = %d"%(request_len);
-
-#raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain, samples, decim, sets);
-raw_data = struct.pack("<IIIIIIII", 0x01, request_len, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-
-while(True):
- print state;
- if(state==0):
- data = UDPSock.recv(4);
- [opcode] = struct.unpack("<I", data);
- print "Opcode = %d"%(opcode);
- if(opcode==1):
-
- # if UDP mode and sets_stream requested,
- # we do not get a header reply back, only data
- if(sets == 0):
- state = 1;
- else:
- state = 2;
-
- elif(state==1):
- data = UDPSock.recv(7*4);
- args = struct.unpack("<IIIIIII", data);
- print ["reply_len", "freq_mhz", "offset_hz", "gain", "sample_bytes", "decim", "sets_remain"];
- print args;
- IQ_bytes = args[0] - 7*4;
- state =2;
-
- elif(state==2):
- data = UDPSock.recv(4);
- [i,q] = struct.unpack("<hh", data);
- tmp = complex(i,q);
-
- re.append(i);
- vals.append(tmp);
- mags.append(abs(tmp));
-
-
- sample_count = sample_count + 1;
-# print "sample count %d"%(sample_count)
-
- IQ_bytes = IQ_bytes - 4;
- if(IQ_bytes < 4):
- print "got all data (total %d)"%(sample_count);
- print "remaining: %d"%(IQ_bytes);
- break;
-
-
-UDPSock.close();
-
-print "done"
-nmags = []
-for i in mags:
- if i == 0:
- i=1;
- nmags.append(i);
-
-
-subplot(2,1,1);
-plot(20*log10(nmags));
-
-fft_data = 20*log10(fftshift(fft(vals)));
-
-subplot(2,1,2);
-plot(fft_data);
-show();
-
-f = open(filename, "w");
-for sample in vals:
- binchunk = struct.pack("<ff",float(sample.real), float(sample.imag) );
- f.write(binchunk);
-f.close();
-
-
diff --git a/gr-msdd6000/src/python_test/spectrogram.py b/gr-msdd6000/src/python_test/spectrogram.py
deleted file mode 100644
index 015dd9105..000000000
--- a/gr-msdd6000/src/python_test/spectrogram.py
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/python
-
-fft_bins = 1024;
-stride = 256;
-
-#filename = "output.dat";
-#decim = 4;
-#Fs = (102.4/decim) * 1e6;
-
-
-from gnuradio import gr;
-from Numeric import *;
-import FFT;
-import numpy.fft;
-from numpy import *;
-from pylab import *;
-import sys;
-
-if len(sys.argv) <2:
- print "usage: %s filename <sample_rate_in_MSPS> <stride_samples>"%(sys.argv[0]);
- sys.exit(-1);
-
-filename = sys.argv[1];
-fs = 0;
-if(len(sys.argv)>2):
- fs = float(sys.argv[2])*1000000;
-print "opening %s.\n"%(filename);
-
-if(len(sys.argv)>=4):
- stride = int(sys.argv[3]);
- print "using stride = %d"%(stride);
-
-tb = gr.top_block();
-src = gr.file_source(gr.sizeof_gr_complex, filename, False)
-sink = gr.vector_sink_c();
-tb.connect(src,sink);
-tb.run();
-
-data = sink.data();
-dataa = array(data);
-datalen = len( data );
-
-time_bins = (datalen - fft_bins) / stride;
-
-print "output vector :: fft_bins = %d, time_bins = %d\n"%(fft_bins,time_bins);
-
-start_idx = 0;
-
-b = numpy.zeros((time_bins, fft_bins), complex);
-l = [];
-
-window = numpy.blackman(fft_bins);
-
-for i in range(0,time_bins):
-
- time_chunk = take( dataa, range(start_idx,start_idx + fft_bins), 0);
- time_chunk = time_chunk * window;
- fft_chunk = numpy.fft.fftshift(numpy.fft.fft(time_chunk));
- psd = 10*log10(fft_chunk * conj(fft_chunk)+0.001);
-
- b[i] = psd.real;
- l.append( psd.real.tolist() );
-
- start_idx = start_idx + stride;
-
-#c = array(b, 10);
-
-print b[0];
-c = array(b);
-#l = c.tolist();
-print size(l);
-
-x = range(0,time_bins);
-print size(x);
-y = range(0,fft_bins);
-print size(y);
-
-print size(l);
-
-contourf(l);
-#contourf([x,y], l);
-colorbar();
-show();
-
-#print c[1,1];
-
-
diff --git a/gr-msdd6000/src/python_test/test_tcp.py b/gr-msdd6000/src/python_test/test_tcp.py
deleted file mode 100755
index b02db815d..000000000
--- a/gr-msdd6000/src/python_test/test_tcp.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-
-myport = random.randint(1025,65535);
-
-port = 10000
-host = "10.45.4.43"
-myaddr = ("10.45.1.229",myport);
-
-buf = 100000;
-
-TCPSock = socket(AF_INET,SOCK_STREAM);
-#TCPSock = socket(AF_INET,SOCK_DGRAM);
-TCPSock.bind(myaddr);
-TCPSock.connect((host,port));
-
-f_mhz = 2400;
-f_hz = 0;
-gain = 2;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-#samples = 0xffffffff; #8-15 fft:(returns 2^number[8-15]) raw:(returns number)
-samples = 2; #8-15 fft:(returns 2^number[8-15]) raw:(returns number)
-decim = 2; #0-8
-#decim = decim+16; # +16 to use 16bit instead of 32 bit
-mode = 1; #0=IQ, 1=MAG, 2=MAGDB
-sets = 0xffffffff;
-#sets = 1;
-
-fft_data = struct.pack("<IIIIIIIIII", 0x02, 0x20, f_mhz, f_hz, gain,window, samples, decim, mode,sets);
-raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets);
-stat_data = struct.pack("!II", 0x0000, 0x0000)
-
-data = raw_data;
-
-#TCPSock.sendto(data, (host,port))
-TCPSock.send(data);
-
-print "sent"
-
-
-
-count = 0;
-while(1):
- data,addr = TCPSock.recvfrom(buf);
-
- print "got response"
-
- print "Data length: %d bytes."%(len(data));
- if(len(data)==12):
- a,b,c = struct.unpack("!III",data);
- print "%x,%x,%x"%(a,b,c);
-
- datavector = [];
-
- for d in data:
- a = struct.unpack("<b",d);
- datavector.append(a);
-
- print datavector;
-
- count = count + 1;
-
- if(count > 1):
- sets = 3;
- raw_data_2 = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets);
- TCPSock.send(raw_data_2);
-
-
-
-TCPSock.close();
-
-
-
diff --git a/gr-msdd6000/src/python_test/test_tcp_fft.py b/gr-msdd6000/src/python_test/test_tcp_fft.py
deleted file mode 100644
index b02db815d..000000000
--- a/gr-msdd6000/src/python_test/test_tcp_fft.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-
-myport = random.randint(1025,65535);
-
-port = 10000
-host = "10.45.4.43"
-myaddr = ("10.45.1.229",myport);
-
-buf = 100000;
-
-TCPSock = socket(AF_INET,SOCK_STREAM);
-#TCPSock = socket(AF_INET,SOCK_DGRAM);
-TCPSock.bind(myaddr);
-TCPSock.connect((host,port));
-
-f_mhz = 2400;
-f_hz = 0;
-gain = 2;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-#samples = 0xffffffff; #8-15 fft:(returns 2^number[8-15]) raw:(returns number)
-samples = 2; #8-15 fft:(returns 2^number[8-15]) raw:(returns number)
-decim = 2; #0-8
-#decim = decim+16; # +16 to use 16bit instead of 32 bit
-mode = 1; #0=IQ, 1=MAG, 2=MAGDB
-sets = 0xffffffff;
-#sets = 1;
-
-fft_data = struct.pack("<IIIIIIIIII", 0x02, 0x20, f_mhz, f_hz, gain,window, samples, decim, mode,sets);
-raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets);
-stat_data = struct.pack("!II", 0x0000, 0x0000)
-
-data = raw_data;
-
-#TCPSock.sendto(data, (host,port))
-TCPSock.send(data);
-
-print "sent"
-
-
-
-count = 0;
-while(1):
- data,addr = TCPSock.recvfrom(buf);
-
- print "got response"
-
- print "Data length: %d bytes."%(len(data));
- if(len(data)==12):
- a,b,c = struct.unpack("!III",data);
- print "%x,%x,%x"%(a,b,c);
-
- datavector = [];
-
- for d in data:
- a = struct.unpack("<b",d);
- datavector.append(a);
-
- print datavector;
-
- count = count + 1;
-
- if(count > 1):
- sets = 3;
- raw_data_2 = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets);
- TCPSock.send(raw_data_2);
-
-
-
-TCPSock.close();
-
-
-
diff --git a/gr-msdd6000/src/python_test/test_udp.py b/gr-msdd6000/src/python_test/test_udp.py
deleted file mode 100755
index fd93847e9..000000000
--- a/gr-msdd6000/src/python_test/test_udp.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-
-msdd_port = 10001
-msdd_host = "10.45.4.43"
-
-my_udp_addr = ("10.45.1.229",10001);
-
-buf = 1024;
-
-#myport = random.randint(1025,65535);
-#my_tcp_addr = ("10.45.1.229",myport);
-#TCPSock = socket(AF_INET,SOCK_STREAM);
-#TCPSock.bind(my_tcp_addr);
-#TCPSock.connect((msdd_host,msdd_port));
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-SETS_STREAM = 0xffffffff;
-
-f_mhz = 2400;
-f_hz = 1;
-gain = 3;
-samples = 512;
-
-decim = 2;
-
-#sets = 16;
-sets = SETS_STREAM;
-window = 3;
-mode = 1;
-
-
-# construct the 3 different request type packets
-fft_data = struct.pack("<IIIIIIIIII", 0x02, 0x20, f_mhz, f_hz, gain,window, samples, decim, mode,sets);
-raw_data = struct.pack("<IIIIIIII", 0x01, 0x18, f_mhz, f_hz, gain,samples, decim,sets);
-stat_data = struct.pack("!II", 0x0000, 0x0000)
-
-# send appropriate udp request packet
-UDPSock.sendto(raw_data, (msdd_host,msdd_port))
-
-#TCPSock.send(raw_data);
-
-
-print "sent request"
-
-
-print "waiting for response"
-data,addr = UDPSock.recvfrom(buf);
-
-print "got response"
-
-print data;
diff --git a/gr-msdd6000/src/python_test/udp_stream_cap.py b/gr-msdd6000/src/python_test/udp_stream_cap.py
deleted file mode 100644
index 6326f27c5..000000000
--- a/gr-msdd6000/src/python_test/udp_stream_cap.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-msdd_host = "10.45.4.43"
-
-buf = 100000;
-
-my_udp_addr = ('',10001);
-my_udp_addr = ('10.45.1.229 ',10001);
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-#f_mhz = 3500;
-#f_mhz = 3500;
-f_mhz = 1000;
-f_hz = 0;
-gain = 0;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-#samples = 65535;
-samples = 16384;
-#samples = samples*4; #bytes of data we are requesting
-
-decim = 4; #0-8 (3 => 2^3 = 8)
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-#sets = 0;
-sets = 0xffffffff;
-
-size_int = 4;
-request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields
-print "request len = %d"%(request_len);
-
-raw_data = struct.pack("<IIIIIIII", 0x01, request_len, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-
-
-numtocap = 1000;
-IQ_bytes = 4 * numtocap;
-
-numbytes = 100 * 65536;
-
-num_rx = 0;
-start = time.time();
-
-d = [];
-while(num_rx < numbytes):
- data = UDPSock.recv(65536);
- num_rx = num_rx + len(data);
- d.append(data);
-
-mags = [];
-for i in range(0, len(d)/4):
- v = struct.unpack_from("<f",d, i*4);
- mags.append(abs(v));
-plot(mags);
-show();
-
-end = time.time();
-print "recieved %d bytes in %f sec"%(numbytes, end-start);
-
-bytes_per_sec = numbytes / (end-start);
-samples_per_sec = bytes_per_sec / 4;
-MSPS = samples_per_sec / 1000000.0;
-
-print "Got %f MSPS"%(MSPS);
-print "Expected %f MSPS"%(102.4/math.pow(2,(1+decim-16)));
-
-
-halt_data = struct.pack("<II", 0x04, 0x00);
-UDPSock.sendto(halt_data, (msdd_host, msdd_port));
-
-
-UDPSock.close();
-
diff --git a/gr-msdd6000/src/python_test/udp_stream_rate_test.py b/gr-msdd6000/src/python_test/udp_stream_rate_test.py
deleted file mode 100644
index 0b75f2372..000000000
--- a/gr-msdd6000/src/python_test/udp_stream_rate_test.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-msdd_host = "10.45.4.46"
-
-buf = 100000;
-
-my_udp_addr = ('',10001);
-my_udp_addr = ('10.45.1.229 ',10001);
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-#f_mhz = 3500;
-#f_mhz = 3500;
-f_mhz = 1000;
-f_hz = 0;
-gain = 0;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-#samples = 65535;
-samples = 16384;
-#samples = samples*4; #bytes of data we are requesting
-
-decim = 2; #0-8 (3 => 2^3 = 8) # ok
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-#sets = 0;
-sets = 0xffffffff;
-
-size_int = 4;
-request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields
-print "request len = %d"%(request_len);
-
-raw_data = struct.pack("<IIIIIIII", 0x01, request_len, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-
-
-numtocap = 1000;
-IQ_bytes = numtocap * numtocap;
-
-numbytes = 1000 * 65536;
-
-num_rx = 0;
-start = -1;
-while(num_rx < numbytes):
- data = UDPSock.recv(65536);
-
- if(start==-1):
- start = time.time();
-
- num_rx = num_rx + len(data);
-# print num_rx;
-
-
-end = time.time();
-print "recieved %d bytes in %f sec"%(numbytes, end-start);
-
-bytes_per_sec = numbytes / (end-start);
-samples_per_sec = bytes_per_sec / 4;
-MSPS = samples_per_sec / 1000000.0;
-
-print "Got %f MSPS"%(MSPS);
-print "Expected %f MSPS"%(102.4/math.pow(2,(decim-16)));
-
-
-halt_data = struct.pack("<II", 0x04, 0x00);
-UDPSock.sendto(halt_data, (msdd_host, msdd_port));
-
-
-UDPSock.close();
-
diff --git a/gr-msdd6000/src/python_test/udp_stream_rate_test_plot.py b/gr-msdd6000/src/python_test/udp_stream_rate_test_plot.py
deleted file mode 100644
index eef78f51b..000000000
--- a/gr-msdd6000/src/python_test/udp_stream_rate_test_plot.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-from random import *;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-msdd_host = "10.45.4.46"
-
-buf = 100000;
-
-my_udp_addr = ('',randint(1025,65535));
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-f_mhz = 2500;
-
-print "fc = %d"%(f_mhz);
-
-f_hz = 0;
-gain = 20; # attenuation
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-samples = 65535*4*2;
-#samples = 16384;
-#samples = 16*1024*1024;
-#samples = samples*4; #bytes of data we are requesting
-
-# decim 0-8 ( 3 - 8 )
-#decim = 5; # rate ok
-decim = 8;
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-#sets = 0;
-sets = 0xffffffff;
-
-size_int = 4;
-request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields
-print "request len = %d"%(request_len);
-
-raw_data = struct.pack("<IIIIIIII", 0x01, request_len, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-
-
-numtocap = 1000;
-IQ_bytes = 4 * numtocap;
-
-numbytes = 65536*100;
-#numbytes = 65536*2;
-#numbytes = 1024;
-
-num_rx = 0;
-start = time.time();
-l = [];
-arr = [];
-
-while(num_rx < numbytes):
- data = UDPSock.recv(1024);
- l.append(data);
- num_rx = num_rx + len(data);
-
-
-end = time.time();
-
-# send stop command
-halt_data = struct.pack(">II", 0x04, 0x00);
-UDPSock.sendto(halt_data, (msdd_host, msdd_port));
-
-# perform timing analysis
-print "recieved %d bytes in %f sec"%(numbytes, end-start);
-bytes_per_sec = numbytes / (end-start);
-samples_per_sec = bytes_per_sec / 4;
-MSPS = samples_per_sec / 1000000.0;
-
-print "Got %f MSPS"%(MSPS);
-print "Expected %f MSPS"%(102.4/math.pow(2,(decim-16)));
-
-
-# plot data
-val_arr = [];
-mag_arr = [];
-mag_arr2 = [];
-
-print "Repacking data..."
-f = open("out.dat","w");
-for li in l:
- for p in range(0, len(li)/4):
- [i,q] = struct.unpack_from("<hh", li, p*4);
- val = complex(i,q);
- mag_arr.append((val*conj(val)).real);
- val_arr.append(val);
- binchunk = struct.pack("<ff",float(val.real), float(val.imag) );
- f.write(binchunk);
-f.close();
-
-
-dlen = len(val_arr)-1;
-fft_data = [];
-for i in range(1, dlen-1024, 1024*1024):
-
- t_in = [];
- for ind in range(i, i+1024):
- t_in.append(val_arr[ind]);
-
- tmp = 20*log10(fftshift(fft(t_in)));
- #tmp = (fftshift(fft(t_in)));
-
- if(len(fft_data) == 0):
- for ind in range(0,1024):
- fft_data.append( tmp[ind] );
- else:
- for ind in range(0,1024):
- fft_data[ind] = fft_data[ind] + tmp[ind];
-
-
-
-
-print "Plotting..."
-subplot(2,1,1);
-plot(mag_arr);
-title("T power");
-subplot(2,1,2);
-plot(10*log10(fft_data));
-title("PSD");
-show();
-
-
-
-UDPSock.close();
-
diff --git a/gr-msdd6000/src/python_test/udp_stream_rate_test_plot_loop.py b/gr-msdd6000/src/python_test/udp_stream_rate_test_plot_loop.py
deleted file mode 100644
index 185afc48c..000000000
--- a/gr-msdd6000/src/python_test/udp_stream_rate_test_plot_loop.py
+++ /dev/null
@@ -1,150 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-#msdd_host = "10.45.4.43"
-msdd_host = "10.45.4.45"
-
-buf = 100000;
-
-my_udp_addr = ('',10001);
-my_udp_addr = ('10.45.1.229 ',10001);
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-#f_mhz = 3500;
-f_mhz = 1500;
-#f_mhz = 1000;
-f_hz = 0;
-gain = 80;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-#samples = 65535;
-samples = 16384;
-#samples = samples*4; #bytes of data we are requesting
-
-# decim 0-8 ( 3 - 8 )
-#decim = 5; # rate ok
-decim = 4;
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-#sets = 0;
-sets = 0xffffffff;
-
-size_int = 4;
-request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields
-print "request len = %d"%(request_len);
-
-raw_data = struct.pack("<IIIIIIII", 0x01, request_len, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-start = time.time();
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-
-
-numtocap = 1000;
-IQ_bytes = 4 * numtocap;
-
-#numbytes = 65536*100;
-numbytes = 65536;
-
-
-
-while(True):
-
- data = [];
- l = [];
- num_rx = 0;
- while(num_rx < numbytes):
- data = UDPSock.recv(65536);
- num_rx = num_rx + len(data);
- l.append(data);
-
- end = time.time();
-
- # send stop command
- #halt_data = struct.pack("<II", 0x04, 0x00);
- #UDPSock.sendto(halt_data, (msdd_host, msdd_port));
-
- # perform timing analysis
- print "recieved %d bytes in %f sec"%(numbytes, end-start);
- bytes_per_sec = numbytes / (end-start);
- samples_per_sec = bytes_per_sec / 4;
- MSPS = samples_per_sec / 1000000.0;
-
- print "Got %f MSPS"%(MSPS);
- print "Expected %f MSPS"%(102.4/math.pow(2,(decim-16)));
-
-
- # plot data
- val_arr = [];
- mag_arr = [];
-
- print "Repacking data..."
- for li in l:
- for p in range(0, len(li)/4):
- [i,q] = struct.unpack_from("<hh", li, p);
- val = complex(i,q);
- mag_arr.append(abs(val));
- val_arr.append(val);
-
-
- print "Calculating Time Domain Power..."
- tpwr = [];
- for i in val_arr:
- tpwr.append( (i*conj(i)).real );
-
- print "Calculating PSD..."
- freqz = fft(val_arr);
-
- #freqz = [];
- #
- #for i in range(0, floor(len(val_arr)/2048)):
- # tmp = val_arr(range(i,i+2048));
- # if len(freqz) == 0:
- # freqz = tmp;
- #
-
- psd = (freqz * conj(freqz)).real;
-
- print "Plotting..."
- subplot(2,1,1);
- plot(tpwr);
- subplot(2,1,2);
- plot(10*log10(psd));
- show();
-
-UDPSock.close();
-
diff --git a/gr-msdd6000/src/python_test/udp_stream_test.py b/gr-msdd6000/src/python_test/udp_stream_test.py
deleted file mode 100644
index 6136d16c5..000000000
--- a/gr-msdd6000/src/python_test/udp_stream_test.py
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/python
-
-from socket import *
-import string
-import time
-import struct;
-import random;
-import array;
-import cmath;
-from numpy import *;
-from numpy.fft import *;
-from pylab import *;
-
-myport = random.randint(1025,65535);
-filename = "output.dat";
-
-msdd_port = 10001
-msdd_host = "10.45.4.46"
-
-buf = 100000;
-
-my_udp_addr = ('',10001);
-my_udp_addr = ('10.45.1.229 ',10001);
-
-UDPSock = socket(AF_INET,SOCK_DGRAM);
-UDPSock.bind(my_udp_addr);
-
-#f_mhz = 3500;
-#f_mhz = 3500;
-f_mhz = 2500;
-f_hz = 0;
-gain = 0;
-window = 3; #0=rect, 1=hanning, 2=hamming, 3=blackman
-
-samples = 65535;
-samples = samples*4; #bytes of data we are requesting
-
-decim = 2; #0-8 (3 => 2^3 = 8)
-decim = decim+16; # +16 to use 16bit floats instead of 32 bit floats
-mode = 0; #0=IQ, 1=MAG, 2=MAGDB
-#sets = 0;
-sets = 0xffffffff;
-
-size_int = 4;
-request_len = 6*size_int; # 6 int items not including the 8 bytes for opcode and length fields
-print "request len = %d"%(request_len);
-
-raw_data = struct.pack("<IIIIIIII", 0x01, request_len, f_mhz, f_hz, gain, samples, decim, sets);
-
-data = raw_data;
-
-UDPSock.sendto(data, (msdd_host, msdd_port));
-
-print "sent"
-
-
-
-count = 0;
-
-total_data = [];
-
-state = 0;
-
-vals = [];
-mags = [];
-re = [];
-
-sample_count = 0;
-IQ_bytes=0;
-
-
-numtocap = 1000;
-IQ_bytes = 4 * numtocap;
-
-while(True):
- data = UDPSock.recv(4);
- [i,q] = struct.unpack("<hh", data);
- tmp = complex(i,q);
-
- re.append(i);
- vals.append(tmp);
- mags.append(abs(tmp));
-
-
- sample_count = sample_count + 1;
-# print "sample count %d"%(sample_count)
-
- IQ_bytes = IQ_bytes - 4;
- if(IQ_bytes % 200 == 0):
- print IQ_bytes;
- if(IQ_bytes < 4):
- print "got all data (total %d)"%(sample_count);
- print "remaining: %d"%(IQ_bytes);
- break;
-
-
-halt_data = struct.pack("<II", 0x04, 0x00);
-UDPSock.sendto(halt_data, (msdd_host, msdd_port));
-
-
-
-UDPSock.close();
-
-print "done"
-nmags = []
-for i in mags:
- if i == 0:
- i=1;
- nmags.append(i);
-
-
-subplot(2,1,1);
-plot(20*log10(nmags));
-
-fft_data = 20*log10(fftshift(fft(vals)));
-
-subplot(2,1,2);
-plot(fft_data);
-show();
-
-f = open(filename, "w");
-for sample in vals:
- binchunk = struct.pack("<ff",float(sample.real), float(sample.imag) );
- f.write(binchunk);
-f.close();
-
-
diff --git a/gr-msdd6000/src/qa_msdd_source_simple.py b/gr-msdd6000/src/qa_msdd_source_simple.py
deleted file mode 100755
index 5262fcef0..000000000
--- a/gr-msdd6000/src/qa_msdd_source_simple.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/python
-
-from pylab import *;
-#from scipy.fftpack import fftshift;
-
-import math;
-
-from gnuradio import msdd,gr;
-
-
-tb = gr.top_block();
-
-
-src = msdd.source_simple("10.45.4.43",0);
-convert = gr.interleaved_short_to_complex();
-sink = gr.vector_sink_c();
-
-gain = 40;
-
-fc = 2.4e9;
-
-src.set_decim_rate(8);
-#src.set_rx_freq(0,3500000000);
-src.set_rx_freq(0,fc);
-src.set_pga(0,gain);
-
-
-tb.connect(src, convert, sink);
-
-
-tb.start();
-
-v = []
-for i in range(0,10000):
- b = math.sqrt(i);
- v.append(b);
-
-tb.stop();
-
-#print sink.data();
-
-data = sink.data();
-
-plot(10*log10(fftshift(fft(sink.data()))));
-show();
diff --git a/gr-noaa/swig/Makefile.swig.gen b/gr-noaa/swig/Makefile.swig.gen
index f5e778811..757c368f5 100644
--- a/gr-noaa/swig/Makefile.swig.gen
+++ b/gr-noaa/swig/Makefile.swig.gen
@@ -105,7 +105,7 @@ _noaa_swig_la_CXXFLAGS = \
$(noaa_swig_la_swig_cxxflags)
python/noaa_swig.cc: noaa_swig.py
-noaa_swig.py: noaa_swig.i
+noaa_swig.py: noaa_swig.i
# Include the python dependencies for this file
-include python/noaa_swig.d
diff --git a/gr-pager/gnuradio-pager.pc.in b/gr-pager/gnuradio-pager.pc.in
index 6fda2d2f2..408d94eb2 100644
--- a/gr-pager/gnuradio-pager.pc.in
+++ b/gr-pager/gnuradio-pager.pc.in
@@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: gnuradio-comedi
+Name: gnuradio-pager
Description: GNU Radio blocks implementing a FLEX pager decoder
Requires: gnuradio-core
Version: @LIBVER@
diff --git a/gr-pager/swig/Makefile.swig.gen b/gr-pager/swig/Makefile.swig.gen
index 70d215384..9f7467c1c 100644
--- a/gr-pager/swig/Makefile.swig.gen
+++ b/gr-pager/swig/Makefile.swig.gen
@@ -105,7 +105,7 @@ _pager_swig_la_CXXFLAGS = \
$(pager_swig_la_swig_cxxflags)
python/pager_swig.cc: pager_swig.py
-pager_swig.py: pager_swig.i
+pager_swig.py: pager_swig.i
# Include the python dependencies for this file
-include python/pager_swig.d
diff --git a/gr-qtgui/Makefile.am b/gr-qtgui/Makefile.am
index cc194e4c0..e850567cc 100644
--- a/gr-qtgui/Makefile.am
+++ b/gr-qtgui/Makefile.am
@@ -21,10 +21,10 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = lib
+SUBDIRS = include lib doc
if PYTHON
-SUBDIRS += swig python apps grc
+SUBDIRS += swig python apps grc examples
endif
pkgconfigdir = $(libdir)/pkgconfig
diff --git a/gr-qtgui/apps/Makefile.am b/gr-qtgui/apps/Makefile.am
index 7b35d949e..4d0c550a1 100644
--- a/gr-qtgui/apps/Makefile.am
+++ b/gr-qtgui/apps/Makefile.am
@@ -28,13 +28,9 @@ nodist_bin_SCRIPTS = \
usrp_display_qtgui.ui
noinst_PYTHON = \
- pyqt_example_f.py \
- pyqt_example_c.py \
- pyqt_time_c.py \
qt_digital.py \
qt_digital_window.py \
- usrp2_display.py \
- usrp_display.py \
+ uhd_display.py \
qt_digital_window.py \
usrp_display_qtgui.py
diff --git a/gr-qtgui/apps/usrp2_display.py b/gr-qtgui/apps/uhd_display.py
index 497bcc00e..806914797 100755
--- a/gr-qtgui/apps/usrp2_display.py
+++ b/gr-qtgui/apps/uhd_display.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,7 @@
#
from gnuradio import gr
-from gnuradio import usrp2
+from gnuradio import uhd
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from gnuradio.qtgui import qtgui
@@ -163,53 +163,40 @@ class main_window(QtGui.QMainWindow):
class my_top_block(gr.top_block):
- def __init__(self):
+ def __init__(self, options):
gr.top_block.__init__(self)
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-e", "--interface", type="string", default="eth0",
- help="select Ethernet interface, default is eth0")
- parser.add_option("-m", "--mac-addr", type="string", default="",
- help="select USRP by MAC address, default is auto-select")
- parser.add_option("-W", "--bw", type="eng_float", default=1e6,
- help="set bandwidth of receiver [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=2412e6,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("--fft-size", type="int", default=2048,
- help="Set number of FFT bins [default=%default]")
- (options, args) = parser.parse_args()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
+ self.options = options
self.show_debug_info = True
self.qapp = QtGui.QApplication(sys.argv)
- self.u = usrp2.source_32fc(options.interface, options.mac_addr)
- self._adc_rate = self.u.adc_rate()
- self.set_bandwidth(options.bw)
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+ self.set_bandwidth(options.samp_rate)
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.u.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2
self.set_gain(options.gain)
if options.freq is None:
- # if no frequency was specified, use the mid-point of the subdev
- f = self.u.freq_range()
- options.freq = float(f[0]+f[1])/2
+ # if no freq was specified, use the mid-point
+ r = self.u.get_freq_range()
+ options.freq = float(r.start()+r.stop())/2
self.set_frequency(options.freq)
+ if(options.antenna):
+ self.u.set_antenna(options.antenna, 0)
+
self._fftsize = options.fft_size
- self.snk = qtgui.sink_c(options.fft_size, gr.firdes.WIN_BLACKMAN_hARRIS,
+ self.snk = qtgui.sink_c(options.fft_size,
+ gr.firdes.WIN_BLACKMAN_hARRIS,
self._freq, self._bandwidth,
- "USRP2 Display",
+ "UHD Display",
True, True, True, False)
# Set up internal amplifier
@@ -225,9 +212,9 @@ class my_top_block(gr.top_block):
self.connect(self.u, self.amp, self.snk)
if self.show_debug_info:
- print "Decimation rate: ", self._decim
- print "Bandwidth: ", self._bandwidth
- print "D'board: ", self.u.daughterboard_id()
+ print "Bandwidth: ", self.u.get_samp_rate()
+ print "Center Freq: ", self.u.get_center_freq()
+ print "Freq Range: ", self.u.get_freq_range()
# Get the reference pointer to the SpectrumDisplayForm QWidget
# Wrap the pointer as a PyQt SIP object
@@ -268,8 +255,7 @@ class my_top_block(gr.top_block):
def set_bandwidth(self, bw):
self._bandwidth = bw
- self._decim = int(self._adc_rate / self._bandwidth)
- self.u.set_decim(self._decim)
+ self.u.set_samp_rate(self._bandwidth)
try:
self.snk.set_frequency_range(self._freq, self._bandwidth)
@@ -301,7 +287,26 @@ class my_top_block(gr.top_block):
self.unlock()
def main ():
- tb = my_top_block()
+ parser = OptionParser(option_class=eng_option)
+ parser.add_option("-a", "--address", type="string", default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate (bandwidth) [default=%default]")
+ parser.add_option("-f", "--freq", type="eng_float", default=2412e6,
+ help="set frequency to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
+ parser.add_option("--fft-size", type="int", default=2048,
+ help="Set number of FFT bins [default=%default]")
+ (options, args) = parser.parse_args()
+
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ tb = my_top_block(options)
tb.start()
tb.snk.exec_();
diff --git a/gr-qtgui/apps/usrp_display.py b/gr-qtgui/apps/usrp_display.py
deleted file mode 100755
index 888bb6338..000000000
--- a/gr-qtgui/apps/usrp_display.py
+++ /dev/null
@@ -1,299 +0,0 @@
-#!/usr/bin/env python
-#
-# 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
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.qtgui import qtgui
-from optparse import OptionParser
-import sys
-
-try:
- from gnuradio.qtgui import qtgui
- from PyQt4 import QtGui, QtCore
- import sip
-except ImportError:
- print "Error: Program requires PyQt4 and gr-qtgui."
- sys.exit(1)
-
-try:
- from usrp_display_qtgui import Ui_MainWindow
-except ImportError:
- print "Error: could not find usrp_display_qtgui.py:"
- print "\t\"pyuic4 usrp_display_qtgui.ui -o usrp_display_qtgui.py\""
- sys.exit(1)
-
-
-
-# ////////////////////////////////////////////////////////////////////
-# Define the QT Interface and Control Dialog
-# ////////////////////////////////////////////////////////////////////
-
-
-class main_window(QtGui.QMainWindow):
- def __init__(self, snk, fg, parent=None):
-
- QtGui.QWidget.__init__(self, parent)
- self.gui = Ui_MainWindow()
- self.gui.setupUi(self)
-
- self.fg = fg
-
- # Add the qtsnk widgets to the layout box
- self.gui.sinkLayout.addWidget(snk)
-
- # Connect up some signals
- self.connect(self.gui.pauseButton, QtCore.SIGNAL("clicked()"),
- self.pauseFg)
- self.connect(self.gui.frequencyEdit, QtCore.SIGNAL("editingFinished()"),
- self.frequencyEditText)
- self.connect(self.gui.gainEdit, QtCore.SIGNAL("editingFinished()"),
- self.gainEditText)
- self.connect(self.gui.bandwidthEdit, QtCore.SIGNAL("editingFinished()"),
- self.bandwidthEditText)
- self.connect(self.gui.amplifierEdit, QtCore.SIGNAL("editingFinished()"),
- self.amplifierEditText)
-
- self.connect(self.gui.actionSaveData, QtCore.SIGNAL("activated()"),
- self.saveData)
- self.gui.actionSaveData.setShortcut(QtGui.QKeySequence.Save)
-
- 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")
-
-
- # Functions to set the values in the GUI
- def set_frequency(self, freq):
- self.freq = freq
- sfreq = eng_notation.num_to_str(self.freq)
- self.gui.frequencyEdit.setText(QtCore.QString("%1").arg(sfreq))
-
- def set_gain(self, gain):
- self.gain = gain
- self.gui.gainEdit.setText(QtCore.QString("%1").arg(self.gain))
-
- def set_bandwidth(self, bw):
- self.bw = bw
- sbw = eng_notation.num_to_str(self.bw)
- self.gui.bandwidthEdit.setText(QtCore.QString("%1").arg(sbw))
-
- def set_amplifier(self, amp):
- self.amp = amp
- self.gui.amplifierEdit.setText(QtCore.QString("%1").arg(self.amp))
-
-
- # Functions called when signals are triggered in the GUI
- def frequencyEditText(self):
- try:
- freq = eng_notation.str_to_num(self.gui.frequencyEdit.text().toAscii())
- self.fg.set_frequency(freq)
- self.freq = freq
- except RuntimeError:
- pass
-
- def gainEditText(self):
- try:
- gain = float(self.gui.gainEdit.text())
- self.fg.set_gain(gain)
- self.gain = gain
- except ValueError:
- pass
-
- def bandwidthEditText(self):
- try:
- bw = eng_notation.str_to_num(self.gui.bandwidthEdit.text().toAscii())
- self.fg.set_bandwidth(bw)
- self.bw = bw
- except ValueError:
- pass
-
- def amplifierEditText(self):
- try:
- amp = float(self.gui.amplifierEdit.text())
- self.fg.set_amplifier_gain(amp)
- self.amp = amp
- except ValueError:
- pass
-
- def saveData(self):
- fileName = QtGui.QFileDialog.getSaveFileName(self, "Save data to file", ".");
- if(len(fileName)):
- self.fg.save_to_file(str(fileName))
-
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db(0, 0).dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- if u.db(0, 0).dbid() >= 0:
- return (1, 0)
- return (0, 0)
-
-class my_top_block(gr.top_block):
- def __init__(self):
- gr.top_block.__init__(self)
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which USRP (0, 1, ...) default is %default",
- metavar="NUM")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-A", "--antenna", default=None,
- help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-W", "--bw", type="float", default=1e6,
- help="set bandwidth of receiver [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB [default is midpoint]")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
- parser.add_option( "--no-hb", action="store_true", default=False,
- help="don't use halfband filter in usrp")
- parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
- help="Enable oscilloscope display")
- parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
- help="Set fftsink averaging factor, [default=%default]")
- parser.add_option("", "--ref-scale", type="eng_float", default=13490.0,
- help="Set dBFS=0dB input value, [default=%default]")
- parser.add_option("", "--fft-size", type="int", default=2048,
- help="Set FFT frame size, [default=%default]");
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
- self.show_debug_info = True
-
- # Call this before creating the Qt sink
- self.qapp = QtGui.QApplication(sys.argv)
-
- self._fftsize = options.fft_size
-
- self.u = usrp.source_c(which=options.which)
- self._adc_rate = self.u.converter_rate()
- self.set_bandwidth(options.bw)
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
- self._rx_subdev_spec = options.rx_subdev_spec
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, self._rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, self._rx_subdev_spec)
-
- self._gain_range = self.subdev.gain_range()
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self._gain_range
- options.gain = float(g[0]+g[1])/2
- self.set_gain(options.gain)
-
- if options.freq is None:
- # if no frequency was specified, use the mid-point of the subdev
- f = self.subdev.freq_range()
- options.freq = float(f[0]+f[1])/2
- self.set_frequency(options.freq)
-
- self.snk = qtgui.sink_c(self._fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
- self._freq, self._bandwidth,
- "USRP Display",
- True, True, True, False)
-
- # Set up internal amplifier
- self.amp = gr.multiply_const_cc(0.0)
- self.set_amplifier_gain(0.001)
-
- # Connect the flow graph
- self.connect(self.u, self.amp, self.snk)
-
-
- # Get the reference pointer to the SpectrumDisplayForm QWidget
- # Wrap the pointer as a PyQt SIP object
- # This can now be manipulated as a PyQt4.QtGui.QWidget
- self.pysink = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
-
- self.main_win = main_window(self.pysink, self)
-
- self.main_win.set_frequency(self._freq)
- self.main_win.set_gain(self._gain)
- self.main_win.set_bandwidth(self._bandwidth)
- self.main_win.set_amplifier(self._amp_value)
-
- self.main_win.show()
-
- def save_to_file(self, name):
- # Pause the flow graph
- self.stop()
- self.wait()
-
- # Add file sink to save data
- self.file_sink = gr.file_sink(gr.sizeof_gr_complex, name)
- self.connect(self.amp, self.file_sink)
-
- # Restart flow graph
- self.start()
-
- def set_gain(self, gain):
- self._gain = gain
- self.subdev.set_gain(self._gain)
-
- def set_frequency(self, freq):
- self._freq = freq
- self.u.tune(0, self.subdev, self._freq)
-
- try:
- self.snk.set_frequency_range(self._freq, self._bandwidth)
- except:
- pass
-
- def set_bandwidth(self, bw):
- self._bandwidth = bw
- self._decim = int(self._adc_rate / self._bandwidth)
- self.u.set_decim_rate(self._decim)
-
- try:
- self.snk.set_frequency_range(self._freq, self._bandwidth)
- except:
- pass
-
- def set_amplifier_gain(self, amp):
- self._amp_value = amp
- self.amp.set_k(self._amp_value)
-
-
-if __name__ == "__main__":
- tb = my_top_block();
- tb.start()
- tb.qapp.exec_()
diff --git a/gnuradio-examples/python/usrp2/.gitignore b/gr-qtgui/doc/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gnuradio-examples/python/usrp2/.gitignore
+++ b/gr-qtgui/doc/.gitignore
diff --git a/gr-radar-mono/doc/Makefile.am b/gr-qtgui/doc/Makefile.am
index 77d603f55..b65eb062f 100644
--- a/gr-radar-mono/doc/Makefile.am
+++ b/gr-qtgui/doc/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,4 +21,7 @@
include $(top_srcdir)/Makefile.common
-EXTRA_DIST += registers.ods
+SUBDIRS =
+
+dist_gr_doc_DATA = \
+ README.qtgui
diff --git a/gr-qtgui/doc/README.qtgui b/gr-qtgui/doc/README.qtgui
new file mode 100644
index 000000000..e54c3d907
--- /dev/null
+++ b/gr-qtgui/doc/README.qtgui
@@ -0,0 +1,12 @@
+This is the gr-qtgui package. It contains various QT-based graphical
+user interface blocks that add graphical sinks to a GNU Radio
+flowgraph. The Python namespaces is in gnuradio.qtgui, which would be normally
+imported as:
+
+ from gnuradio import qtgui
+
+See the Doxygen documentation for details about the blocks available
+in this package. A quick listing of the details can be found in Python
+after importing by using:
+
+ help(qtgui)
diff --git a/gr-qtgui/doc/qtgui.dox b/gr-qtgui/doc/qtgui.dox
new file mode 100644
index 000000000..c7f4b7146
--- /dev/null
+++ b/gr-qtgui/doc/qtgui.dox
@@ -0,0 +1,77 @@
+/*! \page page_qtgui QT Graphical User Interface
+
+\section Introduction
+
+This is the gr-qtgui package. It contains various QT-based graphical
+user interface blocks that add graphical sinks to a GNU Radio
+flowgraph. The Python namespaces is in gnuradio.qtgui, which would be normally
+imported as:
+
+\code
+ from gnuradio import qtgui
+\endcode
+
+See the Doxygen documentation for details about the blocks available
+in this package. The relevant blocks are listed in the \ref
+qtgui_blk group.
+
+A quick listing of the details can be found in Python after importing
+by using:
+
+\code
+ help(qtgui)
+\endcode
+
+
+\section Dependencies
+
+The QT GUI blocks require the following dependencies.
+
+\li QtCore (version >= 4.4)
+\li QtGui (version >= 4.4)
+\li QtOpenGL (version >= 4.4)
+\li PyQt4 for Qt4 (version >= 4.4)
+\li Qwt (version >= 5.2)
+\li PyQwt5 for Qt4 (version >= 5.2)
+
+\section Usage
+
+To use the qtgui interface, a bit of boiler-plate lines must be
+included. First, the sink is defined, then it must be exposed from C++
+into Python using the "sip.wrapinstance" command, and finally, the
+"show" method is run on the new Python object. This sets up the QT
+environment to show the widget, but the qApplication must also be
+launched.
+
+In the "main" function of the code, the qApp is retrieved. Then, after
+the GNU Radio top block is started (remember that start() is a
+non-blocking call to launch the main thread of the flowgraph), the
+qapp's "exec_()" function is called. This function is a blocking call
+while the GUI is alive.
+
+\code
+from PyQt4 import Qt
+from gnuradio.qtgui import qtgui
+import sys, sip
+
+class grclass(gr.top_block):
+ ....
+
+ self.snk = qtgui.sink_c(1024, #fftsize
+ samp_rate, #bw
+ "QT GUI Plot") #name
+
+ self.snk_win = sip.wrapinstance(self.snk.pyqwidget(), Qt.QWidget)
+ self.snk_win.show()
+
+def main():
+ qapp = Qt.QApplication(sys.argv)
+ tb = grclass()
+ tb.start()
+ qapp.exec_()
+ tb.stop()
+
+
+\endcode
+
+*/
diff --git a/gr-cvsd-vocoder/src/.gitignore b/gr-qtgui/examples/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-cvsd-vocoder/src/.gitignore
+++ b/gr-qtgui/examples/.gitignore
diff --git a/gnuradio-examples/python/digital-bert/Makefile.am b/gr-qtgui/examples/Makefile.am
index eac013f09..a204d1fcc 100644
--- a/gnuradio-examples/python/digital-bert/Makefile.am
+++ b/gr-qtgui/examples/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008-2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,13 +21,14 @@
include $(top_srcdir)/Makefile.common
-ourdatadir = $(exampledir)/digital-bert
-
-dist_ourdata_DATA = \
- README \
- receive_path.py \
- transmit_path.py
+if PYTHON
+ourdatadir = $(exampledir)/qt-gui
dist_ourdata_SCRIPTS = \
- benchmark_rx.py \
- benchmark_tx.py \ No newline at end of file
+ pyqt_example_c.py \
+ pyqt_example_f.py \
+ pyqt_time_c.py \
+ pyqt_time_f.py
+endif
+
+EXTRA_DIST +=
diff --git a/gr-qtgui/apps/pyqt_example_c.py b/gr-qtgui/examples/pyqt_example_c.py
index 553d346c9..553d346c9 100755
--- a/gr-qtgui/apps/pyqt_example_c.py
+++ b/gr-qtgui/examples/pyqt_example_c.py
diff --git a/gr-qtgui/apps/pyqt_example_f.py b/gr-qtgui/examples/pyqt_example_f.py
index 5e432fe78..5e432fe78 100755
--- a/gr-qtgui/apps/pyqt_example_f.py
+++ b/gr-qtgui/examples/pyqt_example_f.py
diff --git a/gr-qtgui/apps/pyqt_time_c.py b/gr-qtgui/examples/pyqt_time_c.py
index a47302d19..a47302d19 100755
--- a/gr-qtgui/apps/pyqt_time_c.py
+++ b/gr-qtgui/examples/pyqt_time_c.py
diff --git a/gr-qtgui/apps/pyqt_time_f.py b/gr-qtgui/examples/pyqt_time_f.py
index 835b42a75..835b42a75 100755
--- a/gr-qtgui/apps/pyqt_time_f.py
+++ b/gr-qtgui/examples/pyqt_time_f.py
diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml
index 8c470a1a5..83d6ec287 100644
--- a/gr-qtgui/grc/qtgui_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_sink_x.xml
@@ -57,6 +57,26 @@ $(gui_hint()($win))</make>
<name>Blackman-harris</name>
<key>firdes.WIN_BLACKMAN_hARRIS</key>
</option>
+ <option>
+ <name>Hamming</name>
+ <key>firdes.WIN_HAMMING</key>
+ </option>
+ <option>
+ <name>Hann</name>
+ <key>firdes.WIN_HANN</key>
+ </option>
+ <option>
+ <name>Blackman</name>
+ <key>firdes.WIN_BLACKMAN</key>
+ </option>
+ <option>
+ <name>Rectangular</name>
+ <key>firdes.WIN_RECTANGULAR</key>
+ </option>
+ <option>
+ <name>Kaiser</name>
+ <key>firdes.WIN_KAISER</key>
+ </option>
</param>
<param>
<name>Center Frequency (Hz)</name>
diff --git a/gr-gpio/.gitignore b/gr-qtgui/include/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-gpio/.gitignore
+++ b/gr-qtgui/include/.gitignore
diff --git a/gnuradio-examples/python/apps/Makefile.am b/gr-qtgui/include/Makefile.am
index 50fe75151..59a030854 100644
--- a/gnuradio-examples/python/apps/Makefile.am
+++ b/gr-qtgui/include/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,6 +21,13 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = hf_explorer hf_radio
-EXTRA_DIST += README
+# These headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS = \
+ gr_qtgui_api.h \
+ qtgui_time_sink_c.h \
+ qtgui_time_sink_f.h \
+ qtgui_sink_c.h \
+ qtgui_sink_f.h \
+ qtgui_util.h
+libgnuradio_digital_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
diff --git a/gr-qtgui/lib/gr_qtgui_api.h b/gr-qtgui/include/gr_qtgui_api.h
index 65033a093..65033a093 100644
--- a/gr-qtgui/lib/gr_qtgui_api.h
+++ b/gr-qtgui/include/gr_qtgui_api.h
diff --git a/gr-qtgui/lib/qtgui_sink_c.h b/gr-qtgui/include/qtgui_sink_c.h
index b0946885c..b04706b14 100644
--- a/gr-qtgui/lib/qtgui_sink_c.h
+++ b/gr-qtgui/include/qtgui_sink_c.h
@@ -41,6 +41,17 @@ GR_QTGUI_API qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype,
bool plottime=true, bool plotconst=true,
QWidget *parent=NULL);
+/*!
+ * \brief A graphical sink to display freq, spec, time, and const plots.
+ * \ingroup qtgui_blk
+ *
+ * This is a QT-based graphical sink the takes a complex stream and
+ * plots it. The default action is to plot the signal as a PSD (FFT),
+ * spectrogram (waterfall), time domain I&Q, and constellation (I
+ * vs. Q) plots. The plots may be turned off by setting the
+ * appropriate boolean value in the constructor to False.
+ */
+
class GR_QTGUI_API qtgui_sink_c : public gr_block
{
private:
diff --git a/gr-qtgui/lib/qtgui_sink_f.h b/gr-qtgui/include/qtgui_sink_f.h
index 6d43f18dd..2d79b5eef 100644
--- a/gr-qtgui/lib/qtgui_sink_f.h
+++ b/gr-qtgui/include/qtgui_sink_f.h
@@ -38,9 +38,20 @@ GR_QTGUI_API qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize, int wintype,
double fc=0, double bw=1.0,
const std::string &name="Spectrum Display",
bool plotfreq=true, bool plotwaterfall=true,
- bool plottime=true, bool plotconst=true,
+ bool plottime=true, bool plotconst=false,
QWidget *parent=NULL);
+/*!
+ * \brief A graphical sink to display freq, spec, and time.
+ * \ingroup qtgui_blk
+ *
+ * This is a QT-based graphical sink the takes a float stream and
+ * plots it. The default action is to plot the signal as a PSD (FFT),
+ * spectrogram (waterfall), and time domain plots. The plots may be
+ * turned off by setting the appropriate boolean value in the
+ * constructor to False.
+ */
+
class GR_QTGUI_API qtgui_sink_f : public gr_block
{
private:
diff --git a/gr-qtgui/lib/qtgui_time_sink_c.h b/gr-qtgui/include/qtgui_time_sink_c.h
index 459423c40..ec7cc490b 100644
--- a/gr-qtgui/lib/qtgui_time_sink_c.h
+++ b/gr-qtgui/include/qtgui_time_sink_c.h
@@ -25,7 +25,7 @@
#include <Python.h>
#include <gr_qtgui_api.h>
-#include <gr_block.h>
+#include <gr_sync_block.h>
#include <gr_firdes.h>
#include <gri_fft.h>
#include <qapplication.h>
@@ -35,24 +35,33 @@ class qtgui_time_sink_c;
typedef boost::shared_ptr<qtgui_time_sink_c> qtgui_time_sink_c_sptr;
GR_QTGUI_API qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw,
- const std::string &name,
- int nconnectons=1,
- QWidget *parent=NULL);
-
-class GR_QTGUI_API qtgui_time_sink_c : public gr_block
+ const std::string &name,
+ int nconnectons=1,
+ QWidget *parent=NULL);
+
+/*!
+ * \brief A graphical sink to display multiple signals in time.
+ * \ingroup qtgui_blk
+ *
+ * This is a QT-based graphical sink the takes set of a complex
+ * streams and plots them in the time domain. For each signal, both
+ * the signal's I and Q parts are plotted, and they are all plotted
+ * with a different color, and the \a set_title and \a set_color
+ * functions can be used to change the lable and color for a given
+ * input number.
+ */
+class GR_QTGUI_API qtgui_time_sink_c : public gr_sync_block
{
private:
friend GR_QTGUI_API qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw,
- const std::string &name,
- int nconnections,
- QWidget *parent);
+ const std::string &name,
+ int nconnections,
+ QWidget *parent);
qtgui_time_sink_c(int size, double bw,
const std::string &name,
int nconnections,
QWidget *parent=NULL);
- void forecast(int noutput_items, gr_vector_int &ninput_items_required);
-
void initialize();
int d_size;
@@ -84,10 +93,9 @@ public:
QApplication *d_qApplication;
- int general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
};
#endif /* INCLUDED_QTGUI_TIME_SINK_C_H */
diff --git a/gr-qtgui/lib/qtgui_time_sink_f.h b/gr-qtgui/include/qtgui_time_sink_f.h
index 632246c6e..ff17f8a1b 100644
--- a/gr-qtgui/lib/qtgui_time_sink_f.h
+++ b/gr-qtgui/include/qtgui_time_sink_f.h
@@ -25,7 +25,7 @@
#include <Python.h>
#include <gr_qtgui_api.h>
-#include <gr_block.h>
+#include <gr_sync_block.h>
#include <gr_firdes.h>
#include <gri_fft.h>
#include <qapplication.h>
@@ -39,7 +39,16 @@ GR_QTGUI_API qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw,
int nconnectons=1,
QWidget *parent=NULL);
-class GR_QTGUI_API qtgui_time_sink_f : public gr_block
+/*!
+ * \brief A graphical sink to display multiple signals in time.
+ * \ingroup qtgui_blk
+ *
+ * This is a QT-based graphical sink the takes set of a float streams
+ * and plots them in the time domain. Each signal is plotted with a
+ * different color, and the \a set_title and \a set_color functions
+ * can be used to change the lable and color for a given input number.
+ */
+class GR_QTGUI_API qtgui_time_sink_f : public gr_sync_block
{
private:
friend GR_QTGUI_API qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw,
@@ -51,8 +60,6 @@ private:
int nconnections,
QWidget *parent=NULL);
- void forecast(int noutput_items, gr_vector_int &ninput_items_required);
-
void initialize();
int d_size;
@@ -84,10 +91,9 @@ public:
QApplication *d_qApplication;
- int general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
};
#endif /* INCLUDED_QTGUI_TIME_SINK_F_H */
diff --git a/gr-qtgui/lib/qtgui_util.h b/gr-qtgui/include/qtgui_util.h
index 7b3692e75..7b3692e75 100644
--- a/gr-qtgui/lib/qtgui_util.h
+++ b/gr-qtgui/include/qtgui_util.h
diff --git a/gr-qtgui/lib/Makefile.am b/gr-qtgui/lib/Makefile.am
index 3257c3aae..aba311297 100644
--- a/gr-qtgui/lib/Makefile.am
+++ b/gr-qtgui/lib/Makefile.am
@@ -24,8 +24,8 @@ include $(top_srcdir)/Makefile.common
EXTRA_DIST += spectrumdisplayform.ui
AM_CPPFLAGS = -I. $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
- $(QT_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES) \
- -Dlibgnuradio_qtgui_EXPORTS
+ $(QT_INCLUDES) $(BOOST_CPPFLAGS) $(GR_QTGUI_INCLUDES) \
+ $(WITH_INCLUDES) -Dlibgnuradio_qtgui_EXPORTS
# Only include these files in the build if qtgui passes configure checks
# This is mostly to help make distcheck pass
@@ -73,14 +73,8 @@ grinclude_HEADERS = \
spectrumdisplayform.h \
timedisplayform.h \
SpectrumGUIClass.h \
- spectrumUpdateEvents.h \
plot_waterfall.h \
- gr_qtgui_api.h \
- qtgui_sink_c.h \
- qtgui_sink_f.h \
- qtgui_time_sink_c.h \
- qtgui_time_sink_f.h \
- qtgui_util.h
+ spectrumUpdateEvents.h
#QT_MOC_FLAGS=-DQT_SHARED -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB
QT_MOC_FLAGS=-DQT_SHARED -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB
diff --git a/gr-qtgui/lib/qtgui_time_sink_c.cc b/gr-qtgui/lib/qtgui_time_sink_c.cc
index 3d38419b2..207d4a924 100644
--- a/gr-qtgui/lib/qtgui_time_sink_c.cc
+++ b/gr-qtgui/lib/qtgui_time_sink_c.cc
@@ -44,9 +44,9 @@ qtgui_time_sink_c::qtgui_time_sink_c (int size, double bw,
const std::string &name,
int nconnections,
QWidget *parent)
- : gr_block ("time_sink_c",
- gr_make_io_signature (nconnections, nconnections, sizeof(gr_complex)),
- gr_make_io_signature (0, 0, 0)),
+ : gr_sync_block ("time_sink_c",
+ gr_make_io_signature (nconnections, nconnections, sizeof(gr_complex)),
+ gr_make_io_signature (0, 0, 0)),
d_size(size), d_bandwidth(bw), d_name(name),
d_nconnections(2*nconnections), d_parent(parent)
{
@@ -59,6 +59,7 @@ qtgui_time_sink_c::qtgui_time_sink_c (int size, double bw,
}
initialize();
+ set_output_multiple(d_size);
}
qtgui_time_sink_c::~qtgui_time_sink_c()
@@ -70,15 +71,6 @@ qtgui_time_sink_c::~qtgui_time_sink_c()
}
void
-qtgui_time_sink_c::forecast(int noutput_items, gr_vector_int &ninput_items_required)
-{
- unsigned int ninputs = ninput_items_required.size();
- for (unsigned int i = 0; i < ninputs; i++) {
- ninput_items_required[i] = std::min(d_size, 8191);
- }
-}
-
-void
qtgui_time_sink_c::initialize()
{
if(qApp != NULL) {
@@ -144,10 +136,9 @@ qtgui_time_sink_c::set_color(int which, const std::string &color)
}
int
-qtgui_time_sink_c::general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+qtgui_time_sink_c::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
int n=0, j=0, idx=0;
const gr_complex *in = (const gr_complex*)input_items[idx];
@@ -181,7 +172,9 @@ qtgui_time_sink_c::general_work (int noutput_items,
j += resid;
}
// Otherwise, copy what we received into the residbufs for next time
+ // because we set the output_multiple, this should never need to be called
else {
+ assert(0);
for(n = 0; n < d_nconnections; n+=2) {
in = (const gr_complex*)input_items[idx++];
for(unsigned int k = 0; k < resid; k++) {
@@ -193,7 +186,6 @@ qtgui_time_sink_c::general_work (int noutput_items,
j += datasize;
}
}
-
- consume_each(j);
- return j;
+
+ return noutput_items;
}
diff --git a/gr-qtgui/lib/qtgui_time_sink_f.cc b/gr-qtgui/lib/qtgui_time_sink_f.cc
index 58cc7a38a..2fe99f43c 100644
--- a/gr-qtgui/lib/qtgui_time_sink_f.cc
+++ b/gr-qtgui/lib/qtgui_time_sink_f.cc
@@ -44,9 +44,9 @@ qtgui_time_sink_f::qtgui_time_sink_f (int size, double bw,
const std::string &name,
int nconnections,
QWidget *parent)
- : gr_block ("time_sink_f",
- gr_make_io_signature (nconnections, nconnections, sizeof(float)),
- gr_make_io_signature (0, 0, 0)),
+ : gr_sync_block ("time_sink_f",
+ gr_make_io_signature (nconnections, nconnections, sizeof(float)),
+ gr_make_io_signature (0, 0, 0)),
d_size(size), d_bandwidth(bw), d_name(name),
d_nconnections(nconnections), d_parent(parent)
{
@@ -59,6 +59,7 @@ qtgui_time_sink_f::qtgui_time_sink_f (int size, double bw,
}
initialize();
+ set_output_multiple(d_size);
}
qtgui_time_sink_f::~qtgui_time_sink_f()
@@ -70,15 +71,6 @@ qtgui_time_sink_f::~qtgui_time_sink_f()
}
void
-qtgui_time_sink_f::forecast(int noutput_items, gr_vector_int &ninput_items_required)
-{
- unsigned int ninputs = ninput_items_required.size();
- for (unsigned int i = 0; i < ninputs; i++) {
- ninput_items_required[i] = std::min(d_size, 8191);
- }
-}
-
-void
qtgui_time_sink_f::initialize()
{
if(qApp != NULL) {
@@ -144,10 +136,9 @@ qtgui_time_sink_f::set_color(int which, const std::string &color)
}
int
-qtgui_time_sink_f::general_work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+qtgui_time_sink_f::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
int n=0, j=0, idx=0;
const float *in = (const float*)input_items[idx];
@@ -180,7 +171,9 @@ qtgui_time_sink_f::general_work (int noutput_items,
j += resid;
}
// Otherwise, copy what we received into the residbufs for next time
+ // because we set the output_multiple, this should never need to be called
else {
+ assert(0);
for(n = 0; n < d_nconnections; n++) {
in = (const float*)input_items[idx++];
for(unsigned int k = 0; k < resid; k++) {
@@ -192,6 +185,5 @@ qtgui_time_sink_f::general_work (int noutput_items,
}
}
- consume_each(j);
- return j;
+ return noutput_items;
}
diff --git a/gr-qtgui/python/__init__.py b/gr-qtgui/python/__init__.py
index db113bbd3..236f211b1 100644
--- a/gr-qtgui/python/__init__.py
+++ b/gr-qtgui/python/__init__.py
@@ -19,6 +19,11 @@
# Boston, MA 02110-1301, USA.
#
+'''
+This is the gr-qtgui package. This package includes QT-based graphical
+sinks.
+'''
+
# The presence of this file turns this directory into a Python package
from qtgui_swig import *
diff --git a/gr-qtgui/swig/Makefile.am b/gr-qtgui/swig/Makefile.am
index 1d8319987..ad6f49e00 100644
--- a/gr-qtgui/swig/Makefile.am
+++ b/gr-qtgui/swig/Makefile.am
@@ -31,6 +31,7 @@ AM_CPPFLAGS = \
$(STD_DEFINES_AND_INCLUDES) \
$(PYTHON_CPPFLAGS) \
$(QT_INCLUDES) \
+ $(GR_QTGUI_INCLUDES) \
$(WITH_INCLUDES)
##############################
diff --git a/gr-qtgui/swig/Makefile.swig.gen b/gr-qtgui/swig/Makefile.swig.gen
index 3659601c3..e343db374 100644
--- a/gr-qtgui/swig/Makefile.swig.gen
+++ b/gr-qtgui/swig/Makefile.swig.gen
@@ -105,7 +105,7 @@ _qtgui_swig_la_CXXFLAGS = \
$(qtgui_swig_la_swig_cxxflags)
python/qtgui_swig.cc: qtgui_swig.py
-qtgui_swig.py: qtgui_swig.i
+qtgui_swig.py: qtgui_swig.i
# Include the python dependencies for this file
-include python/qtgui_swig.d
diff --git a/gr-qtgui/swig/qtgui_sink_f.i b/gr-qtgui/swig/qtgui_sink_f.i
index c5eb656b9..a34420461 100644
--- a/gr-qtgui/swig/qtgui_sink_f.i
+++ b/gr-qtgui/swig/qtgui_sink_f.i
@@ -32,7 +32,7 @@ qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize, int wintype,
double fc=0, double bw=0.0,
const std::string &name="Display",
bool plotfreq=true, bool plotwaterfall=true,
- bool plottime=true, bool plotconst=true,
+ bool plottime=true, bool plotconst=false,
QWidget *parent=NULL);
class qtgui_sink_f : public gr_block
diff --git a/gr-qtgui/swig/qtgui_time_sink_c.i b/gr-qtgui/swig/qtgui_time_sink_c.i
index 8f5c9f4f0..e7240aa69 100644
--- a/gr-qtgui/swig/qtgui_time_sink_c.i
+++ b/gr-qtgui/swig/qtgui_time_sink_c.i
@@ -33,7 +33,7 @@ qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw,
int nconnections=1,
QWidget *parent=NULL);
-class qtgui_time_sink_c : public gr_block
+class qtgui_time_sink_c : public gr_sync_block
{
private:
friend qtgui_time_sink_c_sptr qtgui_make_time_sink_c(int size, double bw,
diff --git a/gr-qtgui/swig/qtgui_time_sink_f.i b/gr-qtgui/swig/qtgui_time_sink_f.i
index b92efe7be..06af42da3 100644
--- a/gr-qtgui/swig/qtgui_time_sink_f.i
+++ b/gr-qtgui/swig/qtgui_time_sink_f.i
@@ -33,7 +33,7 @@ qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw,
int nconnections=1,
QWidget *parent=NULL);
-class qtgui_time_sink_f : public gr_block
+class qtgui_time_sink_f : public gr_sync_block
{
private:
friend qtgui_time_sink_f_sptr qtgui_make_time_sink_f(int size, double bw,
diff --git a/gr-radar-mono/README b/gr-radar-mono/README
deleted file mode 100644
index 577c8e095..000000000
--- a/gr-radar-mono/README
+++ /dev/null
@@ -1,67 +0,0 @@
-This GNU Radio component implements a monostatic radar transmitter
-and receiver. It uses a custom FPGA build to generate a linear
-FM chirp waveform directly in the USRP. Echo returns are recorded
-to a file for offline analysis.
-
-The LFM chirp can be up to 32 MHz in width, whose center frequency
-is set by which transmit daughter board is installed. This gives
-a range resolution of approximately 5 meters.
-
-The script to run is placed in $prefix/bin:
-
-Usage: usrp_radar_mono.py [options]
-
-Options:
- -h, --help show this help message and exit
- -T TX_SUBDEV_SPEC, --tx-subdev-spec=TX_SUBDEV_SPEC
- use transmitter board side A or B (default is first
- found)
- -R RX_SUBDEV_SPEC, --rx-subdev-spec=RX_SUBDEV_SPEC
- use receiver board side A or B (default is first
- found)
- -g GAIN, --gain=GAIN set gain in dB (default is midpoint)
- -f FREQ, --frequency=FREQ
- set transmitter center frequency to FREQ in Hz,
- default is 0.0
- -w FREQ, --chirp-width=FREQ
- set LFM chirp bandwidth in Hz, default is 32M
- -a AMPLITUDE, --amplitude=AMPLITUDE
- set waveform amplitude in % full scale, default is 15,
- --ton=TON set pulse on period in seconds, default is 5e-06,
- --tsw=TSW set transmitter switching period in seconds, default
- is 4.0625e-07,
- --tlook=TLOOK set receiver look time in seconds, default is 5e-06,
- --prf=PRF set pulse repetition frequency in Hz, default is
- 10000.0,
- -v, --verbose enable verbose output, default is disabled
- -D, --debug enable debugging output, default is disabled
- -F FILENAME, --filename=FILENAME
- log received echos to file
-
-The transmitter creates an LFM chirp, evenly centered on the supplied frequency.
-The four timing parameters are:
-
-ton Chirp on time in seconds.
-
-tsw Transmitter switching time in seconds. This the delay after the chirp
- is transmitted before the receiver is enabled. These two (tsw and ton)
- parameters determine the minimum range of the radar.
-
-tlook The the amount of time in seconds the receiver is enabled to record
- echo responses ("look" time). This parameter determines the maximum
- radar range that can be measured, though transmitter power will also
- limit return strength and practical range.
-
-prf Pulse repetition frequency in Hz. This establishes to overall pulse
- repetition period, which results in idle time between when the receiver
- is turned off and the next transmitted chirp begins.
-
-The transmitter is completed. The receive path is logging echo data to a supplied
-file; however, no meta-data is logged.
-
-This is experimental code.
-
-Johnathan Corgan
-Corgan Enterprises LLC
-jcorgan@corganenterprises.com
-9/17/2007
diff --git a/gr-radar-mono/doc/.gitignore b/gr-radar-mono/doc/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-radar-mono/doc/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-radar-mono/doc/registers.ods b/gr-radar-mono/doc/registers.ods
deleted file mode 100644
index 7bafe2c58..000000000
--- a/gr-radar-mono/doc/registers.ods
+++ /dev/null
Binary files differ
diff --git a/gr-radar-mono/src/.gitignore b/gr-radar-mono/src/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-radar-mono/src/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-radar-mono/src/fpga/lib/.gitignore b/gr-radar-mono/src/fpga/lib/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-radar-mono/src/fpga/lib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-radar-mono/src/fpga/lib/Makefile.am b/gr-radar-mono/src/fpga/lib/Makefile.am
deleted file mode 100644
index e97ff1b6a..000000000
--- a/gr-radar-mono/src/fpga/lib/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright 2007,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- radar.v \
- radar_config.vh \
- radar_control.v \
- radar_tx.v \
- radar_rx.v \
- dac_interface.v \
- fifo32_2k.v \
- cordic_nco.v
-
-MOSTLYCLEANFILES += *.bak
diff --git a/gr-radar-mono/src/fpga/lib/cordic_nco.v b/gr-radar-mono/src/fpga/lib/cordic_nco.v
deleted file mode 100644
index b9858baf8..000000000
--- a/gr-radar-mono/src/fpga/lib/cordic_nco.v
+++ /dev/null
@@ -1,54 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module cordic_nco(clk_i,rst_i,ena_i,strobe_i,ampl_i,freq_i,phs_i,data_i_o,data_q_o);
- input clk_i;
- input rst_i;
- input ena_i;
- input strobe_i;
-
- input [15:0] ampl_i;
- input [31:0] freq_i;
- input [31:0] phs_i;
-
- output [15:0] data_i_o;
- output [15:0] data_q_o;
-
- reg [31:0] phase_reg;
- wire [31:0] phase = phase_reg + phs_i;
- wire [15:0] ampl;
-
- always @(posedge clk_i)
- begin
- if (rst_i | ~ena_i)
- phase_reg <= 32'b0;
- else if (strobe_i)
- phase_reg <= phase_reg + freq_i;
- end
-
- assign ampl = ena_i ? ampl_i : 16'b0;
-
- cordic tx_cordic
- (.clock(clk_i),.reset(rst_i),.enable(strobe_i),
- .xi(ampl),.yi(16'b0),.zi(phase[31:16]),
- .xo(data_i_o),.yo(data_q_o),.zo());
-
-endmodule // cordic_nco
diff --git a/gr-radar-mono/src/fpga/lib/dac_interface.v b/gr-radar-mono/src/fpga/lib/dac_interface.v
deleted file mode 100644
index 209aebd96..000000000
--- a/gr-radar-mono/src/fpga/lib/dac_interface.v
+++ /dev/null
@@ -1,60 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../top/config.vh"
-
-module dac_interface(clk_i,rst_i,ena_i,strobe_i,tx_i_i,tx_q_i,tx_data_o,tx_sync_o);
- input clk_i;
- input rst_i;
- input ena_i;
- input strobe_i;
-
- input [13:0] tx_i_i;
- input [13:0] tx_q_i;
-
- output [13:0] tx_data_o;
- output tx_sync_o;
-
-`ifdef TX_RATE_MAX
- wire clk128;
- reg clk64_d;
- reg [13:0] tx_data_o;
-
- // Create a 128 MHz clock
- dacpll pll128(.areset(rst_i),.inclk0(clk_i),.c0(clk128));
-
- // Register the clk64 clock in the clk128 domain
- always @(posedge clk128)
- clk64_d <= clk_i;
-
- // Register the tx data in the clk128 domain
- always @(posedge clk128)
- tx_data_o <= clk64_d ? tx_i_i : tx_q_i;
-
- assign tx_sync_o = clk64_d;
-
-
-`else // !`ifdef TX_RATE_MAX
- assign tx_data_o = strobe_i ? tx_i_i : tx_q_i;
- assign tx_sync_o = strobe_i;
-`endif // !`ifdef TX_RATE_MAX
-
-endmodule // dac_interface
diff --git a/gr-radar-mono/src/fpga/lib/fifo32_2k.v b/gr-radar-mono/src/fpga/lib/fifo32_2k.v
deleted file mode 100755
index c045b70e7..000000000
--- a/gr-radar-mono/src/fpga/lib/fifo32_2k.v
+++ /dev/null
@@ -1,161 +0,0 @@
-// megafunction wizard: %FIFO%
-// GENERATION: STANDARD
-// VERSION: WM1.0
-// MODULE: scfifo
-
-// ============================================================
-// File Name: fifo32_2k.v
-// Megafunction Name(s):
-// scfifo
-//
-// Simulation Library Files(s):
-// altera_mf
-// ============================================================
-// ************************************************************
-// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
-//
-// 7.1 Build 178 06/25/2007 SP 1 SJ Web Edition
-// ************************************************************
-
-
-//Copyright (C) 1991-2007 Altera Corporation
-//Your use of Altera Corporation's design tools, logic functions
-//and other software and tools, and its AMPP partner logic
-//functions, and any output files from any of the foregoing
-//(including device programming or simulation files), and any
-//associated documentation or information are expressly subject
-//to the terms and conditions of the Altera Program License
-//Subscription Agreement, Altera MegaCore Function License
-//Agreement, or other applicable license agreement, including,
-//without limitation, that your use is for the sole purpose of
-//programming logic devices manufactured by Altera and sold by
-//Altera or its authorized distributors. Please refer to the
-//applicable agreement for further details.
-
-
-// synopsys translate_off
-`timescale 1 ps / 1 ps
-// synopsys translate_on
-module fifo32_2k (
- clock,
- data,
- rdreq,
- sclr,
- wrreq,
- empty,
- q);
-
- input clock;
- input [31:0] data;
- input rdreq;
- input sclr;
- input wrreq;
- output empty;
- output [31:0] q;
-
- wire sub_wire0;
- wire [31:0] sub_wire1;
- wire empty = sub_wire0;
- wire [31:0] q = sub_wire1[31:0];
-
- scfifo scfifo_component (
- .rdreq (rdreq),
- .sclr (sclr),
- .clock (clock),
- .wrreq (wrreq),
- .data (data),
- .empty (sub_wire0),
- .q (sub_wire1)
- // synopsys translate_off
- ,
- .aclr (),
- .almost_empty (),
- .almost_full (),
- .full (),
- .usedw ()
- // synopsys translate_on
- );
- defparam
- scfifo_component.add_ram_output_register = "OFF",
- scfifo_component.intended_device_family = "Cyclone",
- scfifo_component.lpm_numwords = 2048,
- scfifo_component.lpm_showahead = "OFF",
- scfifo_component.lpm_type = "scfifo",
- scfifo_component.lpm_width = 32,
- scfifo_component.lpm_widthu = 11,
- scfifo_component.overflow_checking = "OFF",
- scfifo_component.underflow_checking = "OFF",
- scfifo_component.use_eab = "ON";
-
-
-endmodule
-
-// ============================================================
-// CNX file retrieval info
-// ============================================================
-// Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
-// Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
-// Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
-// Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
-// Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
-// Retrieval info: PRIVATE: Clock NUMERIC "0"
-// Retrieval info: PRIVATE: Depth NUMERIC "2048"
-// Retrieval info: PRIVATE: Empty NUMERIC "1"
-// Retrieval info: PRIVATE: Full NUMERIC "0"
-// Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone"
-// Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
-// Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
-// Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
-// Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "1"
-// Retrieval info: PRIVATE: Optimize NUMERIC "2"
-// Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
-// Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-// Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "1"
-// Retrieval info: PRIVATE: UsedW NUMERIC "0"
-// Retrieval info: PRIVATE: Width NUMERIC "32"
-// Retrieval info: PRIVATE: dc_aclr NUMERIC "0"
-// Retrieval info: PRIVATE: diff_widths NUMERIC "0"
-// Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
-// Retrieval info: PRIVATE: output_width NUMERIC "32"
-// Retrieval info: PRIVATE: rsEmpty NUMERIC "1"
-// Retrieval info: PRIVATE: rsFull NUMERIC "0"
-// Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
-// Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
-// Retrieval info: PRIVATE: sc_sclr NUMERIC "1"
-// Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
-// Retrieval info: PRIVATE: wsFull NUMERIC "1"
-// Retrieval info: PRIVATE: wsUsedW NUMERIC "0"
-// Retrieval info: CONSTANT: ADD_RAM_OUTPUT_REGISTER STRING "OFF"
-// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone"
-// Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "2048"
-// Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
-// Retrieval info: CONSTANT: LPM_TYPE STRING "scfifo"
-// Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "32"
-// Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "11"
-// Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "OFF"
-// Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "OFF"
-// Retrieval info: CONSTANT: USE_EAB STRING "ON"
-// Retrieval info: USED_PORT: clock 0 0 0 0 INPUT NODEFVAL clock
-// Retrieval info: USED_PORT: data 0 0 32 0 INPUT NODEFVAL data[31..0]
-// Retrieval info: USED_PORT: empty 0 0 0 0 OUTPUT NODEFVAL empty
-// Retrieval info: USED_PORT: q 0 0 32 0 OUTPUT NODEFVAL q[31..0]
-// Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq
-// Retrieval info: USED_PORT: sclr 0 0 0 0 INPUT NODEFVAL sclr
-// Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq
-// Retrieval info: CONNECT: @data 0 0 32 0 data 0 0 32 0
-// Retrieval info: CONNECT: q 0 0 32 0 @q 0 0 32 0
-// Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
-// Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
-// Retrieval info: CONNECT: @clock 0 0 0 0 clock 0 0 0 0
-// Retrieval info: CONNECT: empty 0 0 0 0 @empty 0 0 0 0
-// Retrieval info: CONNECT: @sclr 0 0 0 0 sclr 0 0 0 0
-// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k.v TRUE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k.inc FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k.cmp FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k.bsf FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k_inst.v FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k_bb.v FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k_waveforms.html FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL fifo32_2k_wave*.jpg FALSE
-// Retrieval info: LIB_FILE: altera_mf
diff --git a/gr-radar-mono/src/fpga/lib/radar.v b/gr-radar-mono/src/fpga/lib/radar.v
deleted file mode 100644
index 1023d2f25..000000000
--- a/gr-radar-mono/src/fpga/lib/radar.v
+++ /dev/null
@@ -1,81 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../lib/radar_config.vh"
-
-module radar(clk_i,saddr_i,sdata_i,s_strobe_i,
- tx_side_o,tx_strobe_o,tx_dac_i_o,tx_dac_q_o,
- rx_adc_i_i,rx_adc_q_i,
- rx_strobe_o,rx_ech_i_o,rx_ech_q_o,io_tx_ena_o);
-
- // System interface
- input clk_i; // Master clock @ 64 MHz
- input [6:0] saddr_i; // Configuration bus address
- input [31:0] sdata_i; // Configuration bus data
- input s_strobe_i; // Configuration bus write
-
- // Transmit subsystem
- output tx_side_o; // Transmitter slot
- output tx_strobe_o; // Generate an transmitter output sample
- output [13:0] tx_dac_i_o; // I channel transmitter output to DAC
- output [13:0] tx_dac_q_o; // Q channel transmitter output to DAC
- output io_tx_ena_o; // Transmit/Receive switching
-
- // Receive subsystem
- input [15:0] rx_adc_i_i; // I channel input from ADC
- input [15:0] rx_adc_q_i; // Q channel input from ADC
- output rx_strobe_o; // Indicates output samples ready for Rx FIFO
- output [15:0] rx_ech_i_o; // I channel processed echos to Rx FIFO
- output [15:0] rx_ech_q_o; // Q channel processed echos to Rx FIFO
-
- // Application control
- wire reset; // Master application reset
- wire tx_side; // Transmitter slot
- wire debug_enabled; // Enable debugging mode;
- wire tx_enable; // Transmitter enable
- wire rx_enable; // Receiver enable
- wire tx_ctrl; // Transmitter on control
- wire rx_ctrl; // Receiver on control
- wire [15:0] pulse_num; // Count of pulses since tx_enabled
-
- // Configuration
- wire [15:0] ampl; // Pulse amplitude
- wire [31:0] fstart; // Chirp start frequency
- wire [31:0] fincr; // Chirp per strobe frequency increment
-
- radar_control controller
- (.clk_i(clk_i),.saddr_i(saddr_i),.sdata_i(sdata_i),.s_strobe_i(s_strobe_i),
- .reset_o(reset),.tx_side_o(tx_side_o),.dbg_o(debug_enabled),
- .tx_strobe_o(tx_strobe_o),.tx_ctrl_o(tx_ctrl),.rx_ctrl_o(rx_ctrl),
- .ampl_o(ampl),.fstart_o(fstart),.fincr_o(fincr),.pulse_num_o(pulse_num),
- .io_tx_ena_o(io_tx_ena_o));
-
- radar_tx transmitter
- ( .clk_i(clk_i),.rst_i(reset),.ena_i(tx_ctrl),.strobe_i(tx_strobe_o),
- .ampl_i(ampl),.fstart_i(fstart),.fincr_i(fincr),
- .tx_i_o(tx_dac_i_o),.tx_q_o(tx_dac_q_o) );
-
- radar_rx receiver
- ( .clk_i(clk_i),.rst_i(reset),.ena_i(rx_ctrl),.dbg_i(debug_enabled),
- .pulse_num_i(pulse_num),.rx_in_i_i(rx_adc_i_i),.rx_in_q_i(rx_adc_q_i),
- .rx_strobe_o(rx_strobe_o),.rx_i_o(rx_ech_i_o),.rx_q_o(rx_ech_q_o) );
-
-endmodule // radar
diff --git a/gr-radar-mono/src/fpga/lib/radar_config.vh b/gr-radar-mono/src/fpga/lib/radar_config.vh
deleted file mode 100644
index 89a336735..000000000
--- a/gr-radar-mono/src/fpga/lib/radar_config.vh
+++ /dev/null
@@ -1,41 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-`define FR_RADAR_MODE `FR_USER_0
-`define bmFR_RADAR_MODE_RESET 32'b1 << 0
-`define bmFR_RADAR_TXSIDE 32'b1 << 1
-`define bmFR_RADAR_LOOP 32'b1 << 2
-`define bmFR_RADAR_META 32'b1 << 3
-`define bmFR_RADAR_DERAMP 32'b1 << 4
-`define bmFR_RADAR_CHIRPS 32'b11 << 5
-`define bmFR_RADAR_DEBUG 32'b1 << 7
-
-`define FR_RADAR_TON `FR_USER_1
-`define FR_RADAR_TSW `FR_USER_2
-`define FR_RADAR_TLOOK `FR_USER_3
-`define FR_RADAR_TIDLE `FR_USER_4
-`define FR_RADAR_AMPL `FR_USER_5
-`define FR_RADAR_FSTART `FR_USER_6
-`define FR_RADAR_FINCR `FR_USER_7
-`define FR_RADAR_ATRDEL `FR_USER_8
diff --git a/gr-radar-mono/src/fpga/lib/radar_control.v b/gr-radar-mono/src/fpga/lib/radar_control.v
deleted file mode 100644
index 05b78198d..000000000
--- a/gr-radar-mono/src/fpga/lib/radar_control.v
+++ /dev/null
@@ -1,166 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../lib/radar_config.vh"
-
-module radar_control(clk_i,saddr_i,sdata_i,s_strobe_i,reset_o,
- tx_side_o,dbg_o,tx_strobe_o,tx_ctrl_o,rx_ctrl_o,
- ampl_o,fstart_o,fincr_o,pulse_num_o,io_tx_ena_o);
-
- // System interface
- input clk_i; // Master clock @ 64 MHz
- input [6:0] saddr_i; // Configuration bus address
- input [31:0] sdata_i; // Configuration bus data
- input s_strobe_i; // Configuration bus write
-
- // Control and configuration outputs
- output reset_o;
- output tx_side_o;
- output dbg_o;
- output tx_strobe_o;
- output tx_ctrl_o;
- output rx_ctrl_o;
- output [15:0] ampl_o;
- output [31:0] fstart_o;
- output [31:0] fincr_o;
- output [15:0] pulse_num_o;
- output io_tx_ena_o;
-
- // Internal configuration
- wire lp_ena;
- wire md_ena;
- wire dr_ena;
- wire [1:0] chirps;
- wire [15:0] t_on;
- wire [15:0] t_sw;
- wire [15:0] t_look;
- wire [31:0] t_idle;
- wire [31:0] atrdel;
-
- // Configuration from host
- wire [31:0] mode;
- setting_reg #(`FR_RADAR_MODE) sr_mode(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(mode));
- assign reset_o = mode[0];
- assign tx_side_o = mode[1];
- assign lp_ena = mode[2];
- assign md_ena = mode[3];
- assign dr_ena = mode[4];
- assign chirps = mode[6:5];
- assign dbg_o = mode[7];
-
- setting_reg #(`FR_RADAR_TON) sr_ton(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(t_on));
-
- setting_reg #(`FR_RADAR_TSW) sr_tsw(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(t_sw));
-
- setting_reg #(`FR_RADAR_TLOOK) sr_tlook(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(t_look));
-
- setting_reg #(`FR_RADAR_TIDLE) sr_tidle(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(t_idle));
-
- setting_reg #(`FR_RADAR_AMPL) sr_ampl(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(ampl_o));
-
- setting_reg #(`FR_RADAR_FSTART) sr_fstart(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(fstart_o));
-
- setting_reg #(`FR_RADAR_FINCR) sr_fincr(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(fincr_o));
-
- setting_reg #(`FR_RADAR_ATRDEL) sr_atrdel(.clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(atrdel));
-
- // Pulse state machine
- `define ST_ON 4'b0001
- `define ST_SW 4'b0010
- `define ST_LOOK 4'b0100
- `define ST_IDLE 4'b1000
-
- reg [3:0] state;
- reg [31:0] count;
- reg [15:0] pulse_num_o;
-
- always @(posedge clk_i)
- if (reset_o)
- begin
- state <= `ST_ON;
- count <= 32'b0;
- pulse_num_o <= 16'b0;
- end
- else
- case (state)
- `ST_ON:
- if (count == {16'b0,t_on})
- begin
- state <= `ST_SW;
- count <= 32'b0;
- pulse_num_o <= pulse_num_o + 16'b1;
- end
- else
- count <= count + 32'b1;
-
- `ST_SW:
- if (count == {16'b0,t_sw})
- begin
- state <= `ST_LOOK;
- count <= 32'b0;
- end
- else
- count <= count + 32'b1;
-
- `ST_LOOK:
- if (count == {16'b0,t_look})
- begin
- state <= `ST_IDLE;
- count <= 32'b0;
- end
- else
- count <= count + 32'b1;
-
- `ST_IDLE:
- if (count == t_idle)
- begin
- state <= `ST_ON;
- count <= 32'b0;
- end
- else
- count <= count + 32'b1;
-
- default: // Invalid state, reset state machine
- begin
- state <= `ST_ON;
- count <= 32'b0;
- end
- endcase
-
- assign tx_strobe_o = count[0]; // Drive DAC inputs at 32 MHz
- assign tx_ctrl_o = (state == `ST_ON);
- assign rx_ctrl_o = (state == `ST_LOOK);
-
- // Create delayed version of tx_ctrl_o to drive mixers and TX/RX switch
- atr_delay atr_delay(.clk_i(clk_i),.rst_i(reset_o),.ena_i(1'b1),.tx_empty_i(!tx_ctrl_o),
- .tx_delay_i(atrdel[27:16]),.rx_delay_i(atrdel[11:0]),
- .atr_tx_o(io_tx_ena_o));
-
-endmodule // radar_control
diff --git a/gr-radar-mono/src/fpga/lib/radar_rx.v b/gr-radar-mono/src/fpga/lib/radar_rx.v
deleted file mode 100644
index 4b0b83c49..000000000
--- a/gr-radar-mono/src/fpga/lib/radar_rx.v
+++ /dev/null
@@ -1,109 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module radar_rx(clk_i,rst_i,ena_i,dbg_i,pulse_num_i,rx_in_i_i,
- rx_in_q_i,rx_i_o,rx_q_o,rx_strobe_o);
-
- input clk_i;
- input rst_i;
- input ena_i;
- input dbg_i;
-
- input [15:0] rx_in_i_i;
- input [15:0] rx_in_q_i;
- input [15:0] pulse_num_i;
-
- output [15:0] rx_i_o;
- output [15:0] rx_q_o;
- output reg rx_strobe_o;
-
- reg [15:0] count;
-
- always @(posedge clk_i)
- if (rst_i | ~ena_i)
- count <= 16'b0;
- else
- count <= count + 16'b1;
-
- wire [31:0] fifo_inp = dbg_i ? {count[15:0],pulse_num_i[15:0]} : {rx_in_i_i,rx_in_q_i};
-
- // Buffer incoming samples every clock
- wire [31:0] fifo_out;
- reg fifo_ack;
- wire fifo_empty;
-
-// Use model if simulating, otherwise Altera Megacell
-`ifdef SIMULATION
- fifo_1clk #(32, 2048) buffer(.clock(clk_i),.sclr(rst_i),
- .data(fifo_inp),.wrreq(ena_i),
- .rdreq(fifo_ack),.q(fifo_out),
- .empty(fifo_empty));
-`else
- fifo32_2k buffer(.clock(clk_i),.sclr(rst_i),
- .data(fifo_inp),.wrreq(ena_i),
- .rdreq(fifo_ack),.q(fifo_out),
- .empty(fifo_empty));
-`endif
-
- // Write samples to rx_fifo every third clock
- `define ST_FIFO_IDLE 3'b001
- `define ST_FIFO_STROBE 3'b010
- `define ST_FIFO_ACK 3'b100
-
- reg [2:0] state;
-
- always @(posedge clk_i)
- if (rst_i)
- begin
- state <= `ST_FIFO_IDLE;
- rx_strobe_o <= 1'b0;
- fifo_ack <= 1'b0;
- end
- else
- case (state)
- `ST_FIFO_IDLE:
- if (!fifo_empty)
- begin
- // Tell rx_fifo sample is ready
- rx_strobe_o <= 1'b1;
- state <= `ST_FIFO_STROBE;
- end
- `ST_FIFO_STROBE:
- begin
- rx_strobe_o <= 1'b0;
- // Ack our FIFO
- fifo_ack <= 1'b1;
- state <= `ST_FIFO_ACK;
- end
- `ST_FIFO_ACK:
- begin
- fifo_ack <= 1'b0;
- state <= `ST_FIFO_IDLE;
- end
- endcase // case(state)
-
- assign rx_i_o = fifo_out[31:16];
- assign rx_q_o = fifo_out[15:0];
-
-endmodule // radar_rx
diff --git a/gr-radar-mono/src/fpga/lib/radar_tx.v b/gr-radar-mono/src/fpga/lib/radar_tx.v
deleted file mode 100644
index c20dd0c1a..000000000
--- a/gr-radar-mono/src/fpga/lib/radar_tx.v
+++ /dev/null
@@ -1,59 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module radar_tx(clk_i,rst_i,ena_i,strobe_i,
- ampl_i,fstart_i,fincr_i,
- tx_i_o,tx_q_o);
-
- // System control
- input clk_i;
- input rst_i;
- input ena_i;
- input strobe_i;
-
- // Configuration
- input [15:0] ampl_i;
- input [31:0] fstart_i;
- input [31:0] fincr_i;
-
- // Chirp output
- output [13:0] tx_i_o;
- output [13:0] tx_q_o;
- wire [15:0] cordic_i, cordic_q;
-
- // Chirp generator
- reg [31:0] freq;
-
- always @(posedge clk_i)
- if (rst_i | ~ena_i)
- freq <= fstart_i;
- else
- if (strobe_i)
- freq <= freq + fincr_i;
-
- cordic_nco nco(.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(strobe_i),
- .ampl_i(ampl_i),.freq_i(freq),.phs_i(0),
- .data_i_o(cordic_i),.data_q_o(cordic_q));
-
- assign tx_i_o = cordic_i[13:0];
- assign tx_q_o = cordic_q[13:0];
-
-endmodule // radar_tx
diff --git a/gr-radar-mono/src/fpga/models/.gitignore b/gr-radar-mono/src/fpga/models/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-radar-mono/src/fpga/models/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-radar-mono/src/fpga/models/Makefile.am b/gr-radar-mono/src/fpga/models/Makefile.am
deleted file mode 100644
index 8a1a09597..000000000
--- a/gr-radar-mono/src/fpga/models/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright 2007,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- fifo_1clk.v
diff --git a/gr-radar-mono/src/fpga/models/fifo_1clk.v b/gr-radar-mono/src/fpga/models/fifo_1clk.v
deleted file mode 100644
index 93ada6c8d..000000000
--- a/gr-radar-mono/src/fpga/models/fifo_1clk.v
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- verilog -*- */
-/*
- * Copyright (C) 2003 Matt Ettus
- * Copyright (C) 2007 Corgan Enterprises LLC
- *
- * 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.
- */
-
-// Model of Altera FIFO with common clock domain
-
-module fifo_1clk(data, wrreq, rdreq, clock, sclr, q,
- full, empty, usedw);
-
- parameter width = 32;
- parameter depth = 4096;
- //`define rd_req 0; // Set this to 0 for rd_ack, 1 for rd_req
-
- input [31:0] data;
- input wrreq;
- input rdreq;
- input clock;
- input sclr;
- output [31:0] q;
- output full;
- output empty;
- output [11:0] usedw;
-
- reg [width-1:0] mem [0:depth-1];
- reg [7:0] rdptr;
- reg [7:0] wrptr;
-
-`ifdef rd_req
- reg [width-1:0] q;
-`else
- wire [width-1:0] q;
-`endif
-
- reg [11:0] usedw;
-
- integer i;
-
- always @( sclr)
- begin
- wrptr <= #1 0;
- rdptr <= #1 0;
- for(i=0;i<depth;i=i+1)
- mem[i] <= #1 0;
- end
-
- always @(posedge clock)
- if(wrreq)
- begin
- wrptr <= #1 wrptr+1;
- mem[wrptr] <= #1 data;
- end
-
- always @(posedge clock)
- if(rdreq)
- begin
- rdptr <= #1 rdptr+1;
-`ifdef rd_req
- q <= #1 mem[rdptr];
-`endif
- end
-
-`ifdef rd_req
-`else
- assign q = mem[rdptr];
-`endif
-
- always @(posedge clock)
- usedw <= #1 wrptr - rdptr;
-
- assign empty = (wrptr == rdptr);
-endmodule
diff --git a/gr-radar-mono/src/fpga/tb/.gitignore b/gr-radar-mono/src/fpga/tb/.gitignore
deleted file mode 100644
index d709d8c29..000000000
--- a/gr-radar-mono/src/fpga/tb/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-/Makefile
-/Makefile.in
-/radar_tb
-/out
-/*.out*
-/*.vcd
diff --git a/gr-radar-mono/src/fpga/tb/Makefile.am b/gr-radar-mono/src/fpga/tb/Makefile.am
deleted file mode 100644
index da45f497a..000000000
--- a/gr-radar-mono/src/fpga/tb/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2007,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- radar_tb.v \
- radar_tb.sav \
- radar_tb.sh \
- radar_tb_wave.sh
-
-MOSTLYCLEANFILES += *.vcd *.out* radar_tb
diff --git a/gr-radar-mono/src/fpga/tb/radar_tb.sav b/gr-radar-mono/src/fpga/tb/radar_tb.sav
deleted file mode 100644
index 66289c07e..000000000
--- a/gr-radar-mono/src/fpga/tb/radar_tb.sav
+++ /dev/null
@@ -1,42 +0,0 @@
-*-24.712532 40200000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-@28
-radar_tb.clk
-radar_tb.ena
-radar_tb.rst
-radar_tb.uut.reset
-@200
--
-@420
-radar_tb.uut.controller.ampl_o[15:0]
-@22
-radar_tb.uut.controller.fstart_o[31:0]
-radar_tb.uut.controller.fincr_o[31:0]
-radar_tb.uut.transmitter.freq[31:0]
-@200
--
-@28
-radar_tb.tx_strobe
-@8420
-radar_tb.uut.tx_dac_i_o[13:0]
-@8421
-radar_tb.uut.tx_dac_q_o[13:0]
-@200
--
-@28
-radar_tb.uut.io_tx_ena_o
-radar_tb.uut.controller.tx_ctrl_o
-radar_tb.uut.controller.rx_ctrl_o
-@200
--
-@28
-radar_tb.fifo_strobe
-@8024
-radar_tb.fifo_i[15:0]
-@22
-radar_tb.fifo_q[15:0]
-@200
--
-@22
-radar_tb.uut.pulse_num[15:0]
-@200
--
diff --git a/gr-radar-mono/src/fpga/tb/radar_tb.sh b/gr-radar-mono/src/fpga/tb/radar_tb.sh
deleted file mode 100755
index dabbe6754..000000000
--- a/gr-radar-mono/src/fpga/tb/radar_tb.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-iverilog \
- -D SIMULATION \
- -y ../lib/ \
- -y ../../../../usrp/fpga/sdr_lib \
- -y ../models/ \
- radar_tb.v -o radar_tb && ./radar_tb > radar_tb.out
diff --git a/gr-radar-mono/src/fpga/tb/radar_tb.v b/gr-radar-mono/src/fpga/tb/radar_tb.v
deleted file mode 100644
index 3583b70e9..000000000
--- a/gr-radar-mono/src/fpga/tb/radar_tb.v
+++ /dev/null
@@ -1,215 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`timescale 1ns/1ps
-
-`include "../lib/radar.v"
-
-module radar_tb;
-
- // System bus
- reg clk;
- reg rst;
- reg ena;
-
- // Configuration bus
- reg [6:0] saddr;
- reg [31:0] sdata;
- reg s_strobe;
-
- // DAC bus
- wire tx_strobe;
- wire [13:0] tx_dac_i;
- wire [13:0] tx_dac_q;
-
- // ADC bus
- reg [15:0] rx_adc_i;
- reg [15:0] rx_adc_q;
-
- // FIFO bus
- wire fifo_strobe;
- wire [15:0] fifo_i;
- wire [15:0] fifo_q;
-
- // Configuration shadow registers
- reg [31:0] mode;
-
- radar uut
- (.clk_i(clk),.saddr_i(saddr),.sdata_i(sdata),.s_strobe_i(s_strobe),
- .tx_strobe_o(tx_strobe),.tx_dac_i_o(tx_dac_i),.tx_dac_q_o(tx_dac_q),
- .rx_adc_i_i(rx_adc_i),.rx_adc_q_i(rx_adc_q),
- .rx_strobe_o(fifo_strobe),.rx_ech_i_o(fifo_i),.rx_ech_q_o(fifo_q));
-
- // Start up initialization
- initial
- begin
- clk = 0;
- rst = 0;
- ena = 0;
- saddr = 0;
- sdata = 0;
- s_strobe = 0;
- rx_adc_i = 0;
- rx_adc_q = 0;
- mode = 0;
-
- @(posedge clk);
- rst = 1;
- @(posedge clk);
- rst = 0;
- @(posedge clk);
- ena = 1;
- end
-
- always
- #5 clk <= ~clk;
-
- initial
- begin
- //$monitor($time, " clk=%b rst=%b", clk, uut.reset);
-
- $dumpfile("radar_tb.vcd");
- $dumpvars(0, radar_tb);
- end
-
- // Test tasks
- task write_cfg_register;
- input [6:0] regno;
- input [31:0] value;
-
- begin
- @(posedge clk);
- saddr <= regno;
- sdata <= value;
- s_strobe <= 1'b1;
- @(posedge clk);
- s_strobe <= 0;
- end
- endtask // write_cfg_register
-
- // Application reset line
- task set_reset;
- input reset;
-
- begin
- mode = reset ? (mode | `bmFR_RADAR_MODE_RESET) : (mode & ~`bmFR_RADAR_MODE_RESET);
- write_cfg_register(`FR_RADAR_MODE, mode);
- end
- endtask // reset
-
- // Waveform on time
- task set_ton;
- input [23:0] t_on;
-
- begin
- write_cfg_register(`FR_RADAR_TON, t_on);
- end
- endtask // set_ton
-
- // Transmitter switching time
- task set_tsw;
- input [23:0] t_sw;
-
- begin
- write_cfg_register(`FR_RADAR_TSW, t_sw);
- end
- endtask // t_sw
-
- // Receiver look time
- task set_tlook;
- input [23:0] t_look;
-
- begin
- write_cfg_register(`FR_RADAR_TLOOK, t_look);
- end
- endtask // set_tlook
-
- // Inter-pulse idle time
- task set_tidle;
- input [23:0] t_idle;
-
- begin
- write_cfg_register(`FR_RADAR_TIDLE, t_idle);
- end
- endtask // set_tidle
-
- // Chirp amplitude
- task set_ampl;
- input [31:0] ampl;
-
- begin
- write_cfg_register(`FR_RADAR_AMPL, ampl);
- end
- endtask // set_ampl
-
- // Chirp start frequency
- task set_fstart;
- input [31:0] fstart;
-
- begin
- write_cfg_register(`FR_RADAR_FSTART, fstart);
- end
- endtask // set_fstart
-
- // Chirp frequency increment
- task set_fincr;
- input [31:0] fincr;
-
- begin
- write_cfg_register(`FR_RADAR_FINCR, fincr);
- end
- endtask // set_fincr
-
- // Chirp frequency increment
- task set_atrdel;
- input [31:0] atrdel;
-
- begin
- write_cfg_register(`FR_RADAR_ATRDEL, atrdel);
- end
- endtask // set_fincr
-
- // Test transmitter functionality
- task test_tx;
- begin
- #20 set_reset(1);
-
- #20 set_ton(320-1); // 5us on time
- #20 set_tsw(26-1); // 406ns switching time
- #20 set_tlook(640-1); // 10us look time
- #20 set_tidle(2854-1); // 60us pulse period
-
- #20 set_ampl(16'd9946);
- #20 set_fstart(32'h80000000); // -16 to 16 MHz
- #20 set_fincr (32'h0199999A);
- #20 set_atrdel(32'h00400046); // 64 TX clks, 70 RX clks
- #20 set_reset(0);
- #200000;
- end
- endtask // test_tx
-
- // Execute tests
- initial
- begin
- #20 test_tx;
- #100 $finish;
- end
-endmodule
diff --git a/gr-radar-mono/src/fpga/tb/radar_tb_wave.sh b/gr-radar-mono/src/fpga/tb/radar_tb_wave.sh
deleted file mode 100755
index 45bba9f5e..000000000
--- a/gr-radar-mono/src/fpga/tb/radar_tb_wave.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-gtkwave radar_tb.vcd radar_tb.sav
diff --git a/gr-radar-mono/src/fpga/top/.gitignore b/gr-radar-mono/src/fpga/top/.gitignore
deleted file mode 100644
index 40492321d..000000000
--- a/gr-radar-mono/src/fpga/top/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-/*.qmsg
-/*.qws
-/*.eqn
-/*.done
-/*.htm
-/*.rpt
-/*.ini
-/*.fsf
-/*.jam
-/*.jbc
-/*.pin
-/*.pof
-/*.rbf
-/*.smsg
-/*.sof
-/*.ttf
-/*.summary
-/undo_redo.txt
-/db
-/Makefile
-/Makefile.in
diff --git a/gr-radar-mono/src/fpga/top/config.vh b/gr-radar-mono/src/fpga/top/config.vh
deleted file mode 100644
index 176979412..000000000
--- a/gr-radar-mono/src/fpga/top/config.vh
+++ /dev/null
@@ -1,24 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// Uncomment to enable 64 MHz Tx clock, otherwise 32 MHz
-//`define TX_RATE_MAX
-
diff --git a/gr-radar-mono/src/fpga/top/dacpll.v b/gr-radar-mono/src/fpga/top/dacpll.v
deleted file mode 100644
index f3941bc67..000000000
--- a/gr-radar-mono/src/fpga/top/dacpll.v
+++ /dev/null
@@ -1,291 +0,0 @@
-// megafunction wizard: %ALTPLL%
-// GENERATION: STANDARD
-// VERSION: WM1.0
-// MODULE: altpll
-
-// ============================================================
-// File Name: dacpll.v
-// Megafunction Name(s):
-// altpll
-//
-// Simulation Library Files(s):
-// altera_mf
-// ============================================================
-// ************************************************************
-// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
-//
-// 7.0 Build 33 02/05/2007 SJ Web Edition
-// ************************************************************
-
-
-//Copyright (C) 1991-2007 Altera Corporation
-//Your use of Altera Corporation's design tools, logic functions
-//and other software and tools, and its AMPP partner logic
-//functions, and any output files from any of the foregoing
-//(including device programming or simulation files), and any
-//associated documentation or information are expressly subject
-//to the terms and conditions of the Altera Program License
-//Subscription Agreement, Altera MegaCore Function License
-//Agreement, or other applicable license agreement, including,
-//without limitation, that your use is for the sole purpose of
-//programming logic devices manufactured by Altera and sold by
-//Altera or its authorized distributors. Please refer to the
-//applicable agreement for further details.
-
-
-// synopsys translate_off
-`timescale 1 ps / 1 ps
-// synopsys translate_on
-module dacpll (
- areset,
- inclk0,
- c0);
-
- input areset;
- input inclk0;
- output c0;
-
- wire [5:0] sub_wire0;
- wire [0:0] sub_wire4 = 1'h0;
- wire [0:0] sub_wire1 = sub_wire0[0:0];
- wire c0 = sub_wire1;
- wire sub_wire2 = inclk0;
- wire [1:0] sub_wire3 = {sub_wire4, sub_wire2};
-
- altpll altpll_component (
- .inclk (sub_wire3),
- .areset (areset),
- .clk (sub_wire0),
- .activeclock (),
- .clkbad (),
- .clkena ({6{1'b1}}),
- .clkloss (),
- .clkswitch (1'b0),
- .configupdate (1'b1),
- .enable0 (),
- .enable1 (),
- .extclk (),
- .extclkena ({4{1'b1}}),
- .fbin (1'b1),
- .fbout (),
- .locked (),
- .pfdena (1'b1),
- .phasecounterselect ({4{1'b1}}),
- .phasedone (),
- .phasestep (1'b1),
- .phaseupdown (1'b1),
- .pllena (1'b1),
- .scanaclr (1'b0),
- .scanclk (1'b0),
- .scanclkena (1'b1),
- .scandata (1'b0),
- .scandataout (),
- .scandone (),
- .scanread (1'b0),
- .scanwrite (1'b0),
- .sclkout0 (),
- .sclkout1 (),
- .vcooverrange (),
- .vcounderrange ());
- defparam
- altpll_component.clk0_divide_by = 1,
- altpll_component.clk0_duty_cycle = 50,
- altpll_component.clk0_multiply_by = 2,
- altpll_component.clk0_phase_shift = "0000",
- altpll_component.compensate_clock = "CLK0",
- altpll_component.inclk0_input_frequency = 15625,
- altpll_component.intended_device_family = "Cyclone",
- altpll_component.lpm_type = "altpll",
- altpll_component.operation_mode = "NORMAL",
- altpll_component.pll_type = "AUTO",
- altpll_component.port_activeclock = "PORT_UNUSED",
- altpll_component.port_areset = "PORT_USED",
- altpll_component.port_clkbad0 = "PORT_UNUSED",
- altpll_component.port_clkbad1 = "PORT_UNUSED",
- altpll_component.port_clkloss = "PORT_UNUSED",
- altpll_component.port_clkswitch = "PORT_UNUSED",
- altpll_component.port_configupdate = "PORT_UNUSED",
- altpll_component.port_fbin = "PORT_UNUSED",
- altpll_component.port_inclk0 = "PORT_USED",
- altpll_component.port_inclk1 = "PORT_UNUSED",
- altpll_component.port_locked = "PORT_UNUSED",
- altpll_component.port_pfdena = "PORT_UNUSED",
- altpll_component.port_phasecounterselect = "PORT_UNUSED",
- altpll_component.port_phasedone = "PORT_UNUSED",
- altpll_component.port_phasestep = "PORT_UNUSED",
- altpll_component.port_phaseupdown = "PORT_UNUSED",
- altpll_component.port_pllena = "PORT_UNUSED",
- altpll_component.port_scanaclr = "PORT_UNUSED",
- altpll_component.port_scanclk = "PORT_UNUSED",
- altpll_component.port_scanclkena = "PORT_UNUSED",
- altpll_component.port_scandata = "PORT_UNUSED",
- altpll_component.port_scandataout = "PORT_UNUSED",
- altpll_component.port_scandone = "PORT_UNUSED",
- altpll_component.port_scanread = "PORT_UNUSED",
- altpll_component.port_scanwrite = "PORT_UNUSED",
- altpll_component.port_clk0 = "PORT_USED",
- altpll_component.port_clk1 = "PORT_UNUSED",
- altpll_component.port_clk3 = "PORT_UNUSED",
- altpll_component.port_clk4 = "PORT_UNUSED",
- altpll_component.port_clk5 = "PORT_UNUSED",
- altpll_component.port_clkena0 = "PORT_UNUSED",
- altpll_component.port_clkena1 = "PORT_UNUSED",
- altpll_component.port_clkena3 = "PORT_UNUSED",
- altpll_component.port_clkena4 = "PORT_UNUSED",
- altpll_component.port_clkena5 = "PORT_UNUSED",
- altpll_component.port_extclk0 = "PORT_UNUSED",
- altpll_component.port_extclk1 = "PORT_UNUSED",
- altpll_component.port_extclk2 = "PORT_UNUSED",
- altpll_component.port_extclk3 = "PORT_UNUSED";
-
-
-endmodule
-
-// ============================================================
-// CNX file retrieval info
-// ============================================================
-// Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
-// Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
-// Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
-// Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
-// Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
-// Retrieval info: PRIVATE: BANDWIDTH_USE_CUSTOM STRING "0"
-// Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
-// Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
-// Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
-// Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
-// Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
-// Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
-// Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
-// Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
-// Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "e0"
-// Retrieval info: PRIVATE: DEVICE_FAMILY NUMERIC "11"
-// Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "8"
-// Retrieval info: PRIVATE: DEV_FAMILY STRING "Cyclone"
-// Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "1"
-// Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
-// Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
-// Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
-// Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
-// Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
-// Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
-// Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "64.000"
-// Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
-// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
-// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
-// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
-// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
-// Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
-// Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "0"
-// Retrieval info: PRIVATE: LOCK_LOSS_SWITCHOVER_CHECK STRING "0"
-// Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
-// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "512.000"
-// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
-// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
-// Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
-// Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "2"
-// Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
-// Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "100.00000000"
-// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
-// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
-// Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
-// Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
-// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "ns"
-// Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
-// Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
-// Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
-// Retrieval info: PRIVATE: PLL_ENA_CHECK STRING "0"
-// Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
-// Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
-// Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
-// Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
-// Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
-// Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
-// Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
-// Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
-// Retrieval info: PRIVATE: SPREAD_USE STRING "0"
-// Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
-// Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
-// Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
-// Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: USE_CLK0 STRING "1"
-// Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
-// Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
-// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-// Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "1"
-// Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
-// Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "2"
-// Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
-// Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
-// Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "15625"
-// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone"
-// Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
-// Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
-// Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
-// Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED"
-// Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
-// Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
-// Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
-// Retrieval info: USED_PORT: @clk 0 0 6 0 OUTPUT_CLK_EXT VCC "@clk[5..0]"
-// Retrieval info: USED_PORT: @extclk 0 0 4 0 OUTPUT_CLK_EXT VCC "@extclk[3..0]"
-// Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
-// Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
-// Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
-// Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
-// Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
-// Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
-// Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.v TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.ppf TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.inc FALSE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.cmp FALSE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.bsf TRUE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_inst.v TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_bb.v TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_waveforms.html TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_wave*.jpg FALSE FALSE
-// Retrieval info: LIB_FILE: altera_mf
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.csf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.csf
deleted file mode 100644
index 121b15aaf..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.csf
+++ /dev/null
@@ -1,444 +0,0 @@
-COMPILER_SETTINGS
-{
- IO_PLACEMENT_OPTIMIZATION = OFF;
- ENABLE_DRC_SETTINGS = OFF;
- PHYSICAL_SYNTHESIS_REGISTER_RETIMING = OFF;
- PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION = OFF;
- PHYSICAL_SYNTHESIS_COMBO_LOGIC = OFF;
- DRC_FANOUT_EXCEEDING = 30;
- DRC_REPORT_FANOUT_EXCEEDING = OFF;
- DRC_TOP_FANOUT = 50;
- DRC_REPORT_TOP_FANOUT = OFF;
- RUN_DRC_DURING_COMPILATION = OFF;
- ADV_NETLIST_OPT_RETIME_CORE_AND_IO = ON;
- ADV_NETLIST_OPT_SYNTH_USE_FITTER_INFO = OFF;
- ADV_NETLIST_OPT_SYNTH_GATE_RETIME = OFF;
- ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP = OFF;
- SMART_COMPILE_IGNORES_TDC_FOR_STRATIX_PLL_CHANGES = OFF;
- MERGE_HEX_FILE = OFF;
- TRUE_WYSIWYG_FLOW = OFF;
- SEED = 1;
- FINAL_PLACEMENT_OPTIMIZATION = AUTOMATICALLY;
- FAMILY = Cyclone;
- DPRAM_DUAL_PORT_MODE_OTHER_SIGNALS_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_OUTPUT_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_OUTPUT_EPXA1 = "LOWER TO 1ESB UPPER TO 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_OUTPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_INPUT_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_INPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_INPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_OTHER_SIGNALS_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_WIDE_MODE_OTHER_SIGNALS_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DEEP_MODE_OTHER_SIGNALS_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DUAL_PORT_MODE_OUTPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4ESB";
- DPRAM_SINGLE_PORT_MODE_OUTPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4ESB";
- DPRAM_WIDE_MODE_OUTPUT_EPXA4_10 = "LOWER TO 3 UPPER TO 4ESB";
- DPRAM_DEEP_MODE_OUTPUT_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DUAL_PORT_MODE_INPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_SINGLE_PORT_MODE_INPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_WIDE_MODE_INPUT_EPXA4_10 = "LOWER TO 3 UPPER TO 4";
- DPRAM_DEEP_MODE_INPUT_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_OTHER_SIGNALS_EPXA4_10 = "DEFAULT OTHER ROUTING OPTIONS";
- DPRAM_OUTPUT_EPXA4_10 = "DEFAULT OUTPUT ROUTING OPTIONS";
- DPRAM_INPUT_EPXA4_10 = "DEFAULT INPUT ROUTING OPTIONS";
- STRIPE_TO_PLD_INTERRUPTS_EPXA4_10 = "MEGALAB COLUMN 2";
- PLD_TO_STRIPE_INTERRUPTS_EPXA4_10 = "MEGALAB COLUMN 2";
- PROCESSOR_DEBUG_EXTENSIONS_EPXA4_10 = "MEGALAB COLUMN 2";
- STRIPE_TO_PLD_BRIDGE_EPXA4_10 = "MEGALAB COLUMN 1";
- FAST_FIT_COMPILATION = OFF;
- SIGNALPROBE_DURING_NORMAL_COMPILATION = OFF;
- OPTIMIZE_IOC_REGISTER_PLACEMENT_FOR_TIMING = ON;
- OPTIMIZE_TIMING = "NORMAL COMPILATION";
- OPTIMIZE_HOLD_TIMING = OFF;
- COMPILATION_LEVEL = FULL;
- SAVE_DISK_SPACE = OFF;
- SPEED_DISK_USAGE_TRADEOFF = NORMAL;
- LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT = OFF;
- SIGNALPROBE_ALLOW_OVERUSE = OFF;
- FOCUS_ENTITY_NAME = |usrp_radar_mono;
- ROUTING_BACK_ANNOTATION_MODE = OFF;
- INC_PLC_MODE = OFF;
- FIT_ONLY_ONE_ATTEMPT = OFF;
-}
-DEFAULT_DEVICE_OPTIONS
-{
- GENERATE_CONFIG_HEXOUT_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_JBC_FILE = OFF;
- GENERATE_CONFIG_JAM_FILE = OFF;
- GENERATE_CONFIG_ISC_FILE = OFF;
- GENERATE_CONFIG_SVF_FILE = OFF;
- GENERATE_JBC_FILE_COMPRESSED = ON;
- GENERATE_JBC_FILE = OFF;
- GENERATE_JAM_FILE = OFF;
- GENERATE_ISC_FILE = OFF;
- GENERATE_SVF_FILE = OFF;
- RESERVE_PIN = "AS INPUT TRI-STATED";
- RESERVE_ALL_UNUSED_PINS = "AS OUTPUT DRIVING GROUND";
- HEXOUT_FILE_COUNT_DIRECTION = UP;
- HEXOUT_FILE_START_ADDRESS = 0;
- GENERATE_HEX_FILE = OFF;
- GENERATE_RBF_FILE = OFF;
- GENERATE_TTF_FILE = OFF;
- RESERVE_ASDO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA0_AFTER_CONFIGURATION = "AS INPUT TRI-STATED";
- RESERVE_DATA7_THROUGH_DATA1_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_RDYNBUSY_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_NWS_NRS_NCS_CS_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- DISABLE_NCS_AND_OE_PULLUPS_ON_CONFIG_DEVICE = OFF;
- AUTO_INCREMENT_CONFIG_DEVICE_JTAG_USER_CODE = ON;
- EPROM_USE_CHECKSUM_AS_USERCODE = OFF;
- FLEX10K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIGURATION_DEVICE = AUTO;
- CYCLONE_CONFIGURATION_DEVICE = AUTO;
- FLEX10K_CONFIGURATION_DEVICE = AUTO;
- FLEX6K_CONFIGURATION_DEVICE = AUTO;
- MERCURY_CONFIGURATION_DEVICE = AUTO;
- EXCALIBUR_CONFIGURATION_DEVICE = AUTO;
- APEX20K_CONFIGURATION_DEVICE = AUTO;
- USE_CONFIGURATION_DEVICE = ON;
- ENABLE_INIT_DONE_OUTPUT = OFF;
- FLEX10K_ENABLE_LOCK_OUTPUT = OFF;
- ENABLE_DEVICE_WIDE_OE = OFF;
- ENABLE_DEVICE_WIDE_RESET = OFF;
- RELEASE_CLEARS_BEFORE_TRI_STATES = OFF;
- AUTO_RESTART_CONFIGURATION = OFF;
- ENABLE_VREFB_PIN = OFF;
- ENABLE_VREFA_PIN = OFF;
- SECURITY_BIT = OFF;
- USER_START_UP_CLOCK = OFF;
- APEXII_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX10K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX6K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- MERCURY_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- EXCALIBUR_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- CYCLONE_CONFIGURATION_SCHEME = "ACTIVE SERIAL";
- STRATIX_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- APEX20K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- STRATIX_UPDATE_MODE = STANDARD;
- USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_JTAG_USER_CODE = 7F;
- MERCURY_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_JTAG_USER_CODE = FFFFFFFF;
- MAX7000S_JTAG_USER_CODE = FFFF;
- RESERVE_NCEO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- FLEX10K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- FLEX6K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = OFF;
- ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- MAX7000_ENABLE_JTAG_BST_SUPPORT = ON;
- ENABLE_JTAG_BST_SUPPORT = OFF;
- CONFIGURATION_CLOCK_DIVISOR = 1;
- CONFIGURATION_CLOCK_FREQUENCY = "10 MHZ";
- CLOCK_SOURCE = INTERNAL;
- COMPRESSION_MODE = OFF;
- ON_CHIP_BITSTREAM_DECOMPRESSION = OFF;
-}
-AUTO_SLD_HUB_ENTITY
-{
- AUTO_INSERT_SLD_HUB_ENTITY = ENABLE;
- HUB_INSTANCE_NAME = SLD_HUB_INST;
- HUB_ENTITY_NAME = SLD_HUB;
-}
-SIGNALTAP_LOGIC_ANALYZER_SETTINGS
-{
- ENABLE_SIGNALTAP = Off;
- AUTO_ENABLE_SMART_COMPILE = On;
-}
-CHIP(usrp_radar_mono)
-{
- DEVICE = EP1C12Q240C8;
- DEVICE_FILTER_PACKAGE = "ANY QFP";
- DEVICE_FILTER_PIN_COUNT = 240;
- DEVICE_FILTER_SPEED_GRADE = ANY;
- AUTO_RESTART_CONFIGURATION = OFF;
- RELEASE_CLEARS_BEFORE_TRI_STATES = OFF;
- USER_START_UP_CLOCK = OFF;
- ENABLE_DEVICE_WIDE_RESET = OFF;
- ENABLE_DEVICE_WIDE_OE = OFF;
- ENABLE_INIT_DONE_OUTPUT = OFF;
- FLEX10K_ENABLE_LOCK_OUTPUT = OFF;
- ENABLE_JTAG_BST_SUPPORT = OFF;
- MAX7000_ENABLE_JTAG_BST_SUPPORT = ON;
- APEX20K_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_JTAG_USER_CODE = 7F;
- MAX7000_JTAG_USER_CODE = FFFFFFFF;
- MAX7000S_JTAG_USER_CODE = FFFF;
- STRATIX_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- MERCURY_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX6K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX10K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- EXCALIBUR_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- APEXII_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- STRATIX_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- CYCLONE_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- USE_CONFIGURATION_DEVICE = OFF;
- APEX20K_CONFIGURATION_DEVICE = AUTO;
- MERCURY_CONFIGURATION_DEVICE = AUTO;
- FLEX6K_CONFIGURATION_DEVICE = AUTO;
- FLEX10K_CONFIGURATION_DEVICE = AUTO;
- EXCALIBUR_CONFIGURATION_DEVICE = AUTO;
- STRATIX_CONFIGURATION_DEVICE = AUTO;
- CYCLONE_CONFIGURATION_DEVICE = AUTO;
- STRATIX_UPDATE_MODE = STANDARD;
- APEX20K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- AUTO_INCREMENT_CONFIG_DEVICE_JTAG_USER_CODE = ON;
- DISABLE_NCS_AND_OE_PULLUPS_ON_CONFIG_DEVICE = OFF;
- COMPRESSION_MODE = OFF;
- ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- FLEX6K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = OFF;
- FLEX10K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- EPROM_USE_CHECKSUM_AS_USERCODE = OFF;
- USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_USE_CHECKSUM_AS_USERCODE = OFF;
- GENERATE_TTF_FILE = OFF;
- GENERATE_RBF_FILE = ON;
- GENERATE_HEX_FILE = OFF;
- SECURITY_BIT = OFF;
- ENABLE_VREFA_PIN = OFF;
- ENABLE_VREFB_PIN = OFF;
- GENERATE_SVF_FILE = OFF;
- GENERATE_ISC_FILE = OFF;
- GENERATE_JAM_FILE = OFF;
- GENERATE_JBC_FILE = OFF;
- GENERATE_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_SVF_FILE = OFF;
- GENERATE_CONFIG_ISC_FILE = OFF;
- GENERATE_CONFIG_JAM_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_HEXOUT_FILE = OFF;
- ON_CHIP_BITSTREAM_DECOMPRESSION = OFF;
- BASE_PIN_OUT_FILE_ON_SAMEFRAME_DEVICE = OFF;
- HEXOUT_FILE_START_ADDRESS = 0;
- HEXOUT_FILE_COUNT_DIRECTION = UP;
- RESERVE_ALL_UNUSED_PINS = "AS INPUT TRI-STATED";
- STRATIX_DEVICE_IO_STANDARD = LVTTL;
- CLOCK_SOURCE = INTERNAL;
- CONFIGURATION_CLOCK_FREQUENCY = "10 MHZ";
- CONFIGURATION_CLOCK_DIVISOR = 1;
- RESERVE_NWS_NRS_NCS_CS_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_RDYNBUSY_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA7_THROUGH_DATA1_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA0_AFTER_CONFIGURATION = "AS INPUT TRI-STATED";
- RESERVE_NCEO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_ASDO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- SCLK : LOCATION = Pin_101;
- SDI : LOCATION = Pin_100;
- SEN : LOCATION = Pin_98;
- SLD : LOCATION = Pin_95;
- adc1_data[0] : LOCATION = Pin_5;
- adc1_data[10] : LOCATION = Pin_235;
- adc1_data[11] : LOCATION = Pin_234;
- adc1_data[1] : LOCATION = Pin_4;
- adc1_data[2] : LOCATION = Pin_3;
- adc1_data[3] : LOCATION = Pin_2;
- adc1_data[4] : LOCATION = Pin_1;
- adc1_data[4] : IO_STANDARD = LVTTL;
- adc1_data[5] : LOCATION = Pin_240;
- adc1_data[6] : LOCATION = Pin_239;
- adc1_data[7] : LOCATION = Pin_238;
- adc1_data[8] : LOCATION = Pin_237;
- adc1_data[9] : LOCATION = Pin_236;
- adc2_data[0] : LOCATION = Pin_20;
- adc2_data[10] : LOCATION = Pin_8;
- adc2_data[11] : LOCATION = Pin_7;
- adc2_data[1] : LOCATION = Pin_19;
- adc2_data[2] : LOCATION = Pin_18;
- adc2_data[3] : LOCATION = Pin_17;
- adc2_data[4] : LOCATION = Pin_16;
- adc2_data[5] : LOCATION = Pin_15;
- adc2_data[6] : LOCATION = Pin_14;
- adc2_data[7] : LOCATION = Pin_13;
- adc2_data[8] : LOCATION = Pin_12;
- adc2_data[9] : LOCATION = Pin_11;
- adc3_data[0] : LOCATION = Pin_200;
- adc3_data[10] : LOCATION = Pin_184;
- adc3_data[11] : LOCATION = Pin_183;
- adc3_data[1] : LOCATION = Pin_197;
- adc3_data[2] : LOCATION = Pin_196;
- adc3_data[3] : LOCATION = Pin_195;
- adc3_data[4] : LOCATION = Pin_194;
- adc3_data[5] : LOCATION = Pin_193;
- adc3_data[6] : LOCATION = Pin_188;
- adc3_data[7] : LOCATION = Pin_187;
- adc3_data[8] : LOCATION = Pin_186;
- adc3_data[9] : LOCATION = Pin_185;
- adc4_data[0] : LOCATION = Pin_222;
- adc4_data[10] : LOCATION = Pin_203;
- adc4_data[11] : LOCATION = Pin_202;
- adc4_data[1] : LOCATION = Pin_219;
- adc4_data[2] : LOCATION = Pin_217;
- adc4_data[3] : LOCATION = Pin_216;
- adc4_data[4] : LOCATION = Pin_215;
- adc4_data[5] : LOCATION = Pin_214;
- adc4_data[6] : LOCATION = Pin_213;
- adc4_data[7] : LOCATION = Pin_208;
- adc4_data[8] : LOCATION = Pin_207;
- adc4_data[9] : LOCATION = Pin_206;
- adc_oeb[0] : LOCATION = Pin_228;
- adc_oeb[1] : LOCATION = Pin_21;
- adc_oeb[2] : LOCATION = Pin_181;
- adc_oeb[3] : LOCATION = Pin_218;
- adc_otr[0] : LOCATION = Pin_233;
- adc_otr[1] : LOCATION = Pin_6;
- adc_otr[2] : LOCATION = Pin_182;
- adc_otr[3] : LOCATION = Pin_201;
- adclk0 : LOCATION = Pin_224;
- adclk1 : LOCATION = Pin_226;
- clk0 : LOCATION = Pin_28;
- clk0 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk0 : IO_STANDARD = LVTTL;
- clk1 : LOCATION = Pin_29;
- clk1 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk1 : IO_STANDARD = LVTTL;
- clk3 : LOCATION = Pin_152;
- clk3 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk3 : IO_STANDARD = LVTTL;
- clk_120mhz : LOCATION = Pin_153;
- clk_120mhz : IO_STANDARD = LVTTL;
- clk_out : LOCATION = Pin_63;
- clk_out : IO_STANDARD = LVTTL;
- dac1_data[0] : LOCATION = Pin_165;
- dac1_data[10] : LOCATION = Pin_177;
- dac1_data[11] : LOCATION = Pin_178;
- dac1_data[12] : LOCATION = Pin_179;
- dac1_data[13] : LOCATION = Pin_180;
- dac1_data[1] : LOCATION = Pin_166;
- dac1_data[2] : LOCATION = Pin_167;
- dac1_data[3] : LOCATION = Pin_168;
- dac1_data[4] : LOCATION = Pin_169;
- dac1_data[5] : LOCATION = Pin_170;
- dac1_data[6] : LOCATION = Pin_173;
- dac1_data[7] : LOCATION = Pin_174;
- dac1_data[8] : LOCATION = Pin_175;
- dac1_data[9] : LOCATION = Pin_176;
- dac2_data[0] : LOCATION = Pin_159;
- dac2_data[10] : LOCATION = Pin_163;
- dac2_data[11] : LOCATION = Pin_139;
- dac2_data[12] : LOCATION = Pin_164;
- dac2_data[13] : LOCATION = Pin_138;
- dac2_data[1] : LOCATION = Pin_158;
- dac2_data[2] : LOCATION = Pin_160;
- dac2_data[3] : LOCATION = Pin_156;
- dac2_data[4] : LOCATION = Pin_161;
- dac2_data[5] : LOCATION = Pin_144;
- dac2_data[6] : LOCATION = Pin_162;
- dac2_data[7] : LOCATION = Pin_141;
- dac2_data[8] : LOCATION = Pin_143;
- dac2_data[9] : LOCATION = Pin_140;
- dac3_data[0] : LOCATION = Pin_122;
- dac3_data[10] : LOCATION = Pin_134;
- dac3_data[11] : LOCATION = Pin_135;
- dac3_data[12] : LOCATION = Pin_136;
- dac3_data[13] : LOCATION = Pin_137;
- dac3_data[1] : LOCATION = Pin_123;
- dac3_data[2] : LOCATION = Pin_124;
- dac3_data[3] : LOCATION = Pin_125;
- dac3_data[4] : LOCATION = Pin_126;
- dac3_data[5] : LOCATION = Pin_127;
- dac3_data[6] : LOCATION = Pin_128;
- dac3_data[7] : LOCATION = Pin_131;
- dac3_data[8] : LOCATION = Pin_132;
- dac3_data[9] : LOCATION = Pin_133;
- dac4_data[0] : LOCATION = Pin_104;
- dac4_data[10] : LOCATION = Pin_118;
- dac4_data[11] : LOCATION = Pin_119;
- dac4_data[12] : LOCATION = Pin_120;
- dac4_data[13] : LOCATION = Pin_121;
- dac4_data[1] : LOCATION = Pin_105;
- dac4_data[2] : LOCATION = Pin_106;
- dac4_data[3] : LOCATION = Pin_107;
- dac4_data[4] : LOCATION = Pin_108;
- dac4_data[5] : LOCATION = Pin_113;
- dac4_data[6] : LOCATION = Pin_114;
- dac4_data[7] : LOCATION = Pin_115;
- dac4_data[8] : LOCATION = Pin_116;
- dac4_data[9] : LOCATION = Pin_117;
- enable_rx : LOCATION = Pin_88;
- enable_tx : LOCATION = Pin_93;
- gndbus[0] : LOCATION = Pin_223;
- gndbus[0] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[0] : IO_STANDARD = LVTTL;
- gndbus[1] : LOCATION = Pin_225;
- gndbus[1] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[1] : IO_STANDARD = LVTTL;
- gndbus[2] : LOCATION = Pin_227;
- gndbus[2] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[2] : IO_STANDARD = LVTTL;
- gndbus[3] : LOCATION = Pin_62;
- gndbus[3] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[3] : IO_STANDARD = LVTTL;
- gndbus[4] : LOCATION = Pin_64;
- gndbus[4] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[4] : IO_STANDARD = LVTTL;
- misc_pins[0] : LOCATION = Pin_87;
- misc_pins[0] : IO_STANDARD = LVTTL;
- misc_pins[10] : LOCATION = Pin_76;
- misc_pins[10] : IO_STANDARD = LVTTL;
- misc_pins[11] : LOCATION = Pin_74;
- misc_pins[11] : IO_STANDARD = LVTTL;
- misc_pins[1] : LOCATION = Pin_86;
- misc_pins[1] : IO_STANDARD = LVTTL;
- misc_pins[2] : LOCATION = Pin_85;
- misc_pins[2] : IO_STANDARD = LVTTL;
- misc_pins[3] : LOCATION = Pin_84;
- misc_pins[3] : IO_STANDARD = LVTTL;
- misc_pins[4] : LOCATION = Pin_83;
- misc_pins[4] : IO_STANDARD = LVTTL;
- misc_pins[5] : LOCATION = Pin_82;
- misc_pins[5] : IO_STANDARD = LVTTL;
- misc_pins[6] : LOCATION = Pin_79;
- misc_pins[6] : IO_STANDARD = LVTTL;
- misc_pins[7] : LOCATION = Pin_78;
- misc_pins[7] : IO_STANDARD = LVTTL;
- misc_pins[8] : LOCATION = Pin_77;
- misc_pins[8] : IO_STANDARD = LVTTL;
- misc_pins[9] : LOCATION = Pin_75;
- misc_pins[9] : IO_STANDARD = LVTTL;
- reset : LOCATION = Pin_94;
- usbclk : LOCATION = Pin_55;
- usbctl[0] : LOCATION = Pin_56;
- usbctl[1] : LOCATION = Pin_54;
- usbctl[2] : LOCATION = Pin_53;
- usbctl[3] : LOCATION = Pin_58;
- usbctl[4] : LOCATION = Pin_57;
- usbctl[5] : LOCATION = Pin_44;
- usbdata[0] : LOCATION = Pin_73;
- usbdata[10] : LOCATION = Pin_41;
- usbdata[11] : LOCATION = Pin_39;
- usbdata[12] : LOCATION = Pin_38;
- usbdata[12] : IO_STANDARD = LVTTL;
- usbdata[13] : LOCATION = Pin_37;
- usbdata[14] : LOCATION = Pin_24;
- usbdata[15] : LOCATION = Pin_23;
- usbdata[1] : LOCATION = Pin_68;
- usbdata[2] : LOCATION = Pin_67;
- usbdata[3] : LOCATION = Pin_66;
- usbdata[4] : LOCATION = Pin_65;
- usbdata[5] : LOCATION = Pin_61;
- usbdata[6] : LOCATION = Pin_60;
- usbdata[7] : LOCATION = Pin_59;
- usbdata[8] : LOCATION = Pin_43;
- usbdata[9] : LOCATION = Pin_42;
- usbrdy[0] : LOCATION = Pin_45;
- usbrdy[1] : LOCATION = Pin_46;
- usbrdy[2] : LOCATION = Pin_47;
- usbrdy[3] : LOCATION = Pin_48;
- usbrdy[4] : LOCATION = Pin_49;
- usbrdy[5] : LOCATION = Pin_50;
- clear_status : LOCATION = Pin_99;
-}
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.esf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.esf
deleted file mode 100644
index 6a8aaae42..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.esf
+++ /dev/null
@@ -1,14 +0,0 @@
-SIMULATOR_SETTINGS
-{
- ESTIMATE_POWER_CONSUMPTION = OFF;
- GLITCH_INTERVAL = 1NS;
- GLITCH_DETECTION = OFF;
- SIMULATION_COVERAGE = ON;
- CHECK_OUTPUTS = OFF;
- SETUP_HOLD_DETECTION = OFF;
- POWER_ESTIMATION_START_TIME = "0 NS";
- ADD_DEFAULT_PINS_TO_SIMULATION_OUTPUT_WAVEFORMS = ON;
- SIMULATION_MODE = TIMING;
- START_TIME = 0NS;
- USE_COMPILER_SETTINGS = usrp_radar_mono;
-}
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.psf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.psf
deleted file mode 100644
index 064967399..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.psf
+++ /dev/null
@@ -1,312 +0,0 @@
-DEFAULT_DESIGN_ASSISTANT_SETTINGS
-{
- HCPY_ALOAD_SIGNALS = OFF;
- HCPY_VREF_PINS = OFF;
- HCPY_CAT = OFF;
- HCPY_ILLEGAL_HC_DEV_PKG = OFF;
- ACLK_RULE_IMSZER_ADOMAIN = OFF;
- ACLK_RULE_SZER_BTW_ACLK_DOMAIN = OFF;
- ACLK_RULE_NO_SZER_ACLK_DOMAIN = OFF;
- ACLK_CAT = OFF;
- SIGNALRACE_RULE_ASYNCHPIN_SYNCH_CLKPIN = OFF;
- SIGNALRACE_CAT = OFF;
- NONSYNCHSTRUCT_RULE_LATCH_UNIDENTIFIED = OFF;
- NONSYNCHSTRUCT_RULE_SRLATCH = OFF;
- NONSYNCHSTRUCT_RULE_DLATCH = OFF;
- NONSYNCHSTRUCT_RULE_MULTI_VIBRATOR = OFF;
- NONSYNCHSTRUCT_RULE_ILLEGAL_PULSE_GEN = OFF;
- NONSYNCHSTRUCT_RULE_RIPPLE_CLK = OFF;
- NONSYNCHSTRUCT_RULE_DELAY_CHAIN = OFF;
- NONSYNCHSTRUCT_RULE_REG_LOOP = OFF;
- NONSYNCHSTRUCT_RULE_COMBLOOP = OFF;
- NONSYNCHSTRUCT_CAT = OFF;
- NONSYNCHSTRUCT_RULE_COMB_DRIVES_RAM_WE = OFF;
- TIMING_RULE_COIN_CLKEDGE = OFF;
- TIMING_RULE_SHIFT_REG = OFF;
- TIMING_RULE_HIGH_FANOUTS = OFF;
- TIMING_CAT = OFF;
- RESET_RULE_ALL = OFF;
- RESET_RULE_IMSYNCH_ASYNCH_DOMAIN = OFF;
- RESET_RULE_UNSYNCH_ASYNCH_DOMAIN = OFF;
- RESET_RULE_REG_ASNYCH = OFF;
- RESET_RULE_COMB_ASYNCH_RESET = OFF;
- RESET_RULE_IMSYNCH_EXRESET = OFF;
- RESET_RULE_UNSYNCH_EXRESET = OFF;
- RESET_RULE_INPINS_RESETNET = OFF;
- RESET_CAT = OFF;
- CLK_RULE_ALL = OFF;
- CLK_RULE_MIX_EDGES = OFF;
- CLK_RULE_CLKNET_CLKSPINES = OFF;
- CLK_RULE_INPINS_CLKNET = OFF;
- CLK_RULE_GATING_SCHEME = OFF;
- CLK_RULE_INV_CLOCK = OFF;
- CLK_RULE_COMB_CLOCK = OFF;
- CLK_CAT = OFF;
- HCPY_EXCEED_USER_IO_USAGE = OFF;
- HCPY_EXCEED_RAM_USAGE = OFF;
- NONSYNCHSTRUCT_RULE_ASYN_RAM = OFF;
- SIGNALRACE_RULE_TRISTATE = OFF;
- ASSG_RULE_MISSING_TIMING = OFF;
- ASSG_RULE_MISSING_FMAX = OFF;
- ASSG_CAT = OFF;
-}
-SYNTHESIS_FITTING_SETTINGS
-{
- AUTO_SHIFT_REGISTER_RECOGNITION = ON;
- AUTO_DSP_RECOGNITION = ON;
- AUTO_RAM_RECOGNITION = ON;
- REMOVE_DUPLICATE_LOGIC = ON;
- AUTO_TURBO_BIT = ON;
- AUTO_MERGE_PLLS = ON;
- AUTO_OPEN_DRAIN_PINS = ON;
- AUTO_PARALLEL_EXPANDERS = ON;
- AUTO_FAST_OUTPUT_ENABLE_REGISTERS = OFF;
- AUTO_FAST_OUTPUT_REGISTERS = OFF;
- AUTO_FAST_INPUT_REGISTERS = OFF;
- AUTO_CASCADE_CHAINS = ON;
- AUTO_CARRY_CHAINS = ON;
- AUTO_DELAY_CHAINS = ON;
- MAX7000_PARALLEL_EXPANDER_CHAIN_LENGTH = 4;
- PARALLEL_EXPANDER_CHAIN_LENGTH = 16;
- CASCADE_CHAIN_LENGTH = 2;
- STRATIX_CARRY_CHAIN_LENGTH = 70;
- MERCURY_CARRY_CHAIN_LENGTH = 48;
- FLEX10K_CARRY_CHAIN_LENGTH = 32;
- FLEX6K_CARRY_CHAIN_LENGTH = 32;
- CARRY_CHAIN_LENGTH = 48;
- CARRY_OUT_PINS_LCELL_INSERT = ON;
- NORMAL_LCELL_INSERT = ON;
- AUTO_LCELL_INSERTION = ON;
- ALLOW_XOR_GATE_USAGE = ON;
- AUTO_PACKED_REGISTERS_STRATIX = NORMAL;
- AUTO_PACKED_REGISTERS = OFF;
- AUTO_PACKED_REG_CYCLONE = NORMAL;
- FLEX10K_OPTIMIZATION_TECHNIQUE = AREA;
- FLEX6K_OPTIMIZATION_TECHNIQUE = AREA;
- MERCURY_OPTIMIZATION_TECHNIQUE = AREA;
- APEX20K_OPTIMIZATION_TECHNIQUE = SPEED;
- MAX7000_OPTIMIZATION_TECHNIQUE = SPEED;
- STRATIX_OPTIMIZATION_TECHNIQUE = SPEED;
- CYCLONE_OPTIMIZATION_TECHNIQUE = AREA;
- FLEX10K_TECHNOLOGY_MAPPER = LUT;
- FLEX6K_TECHNOLOGY_MAPPER = LUT;
- MERCURY_TECHNOLOGY_MAPPER = LUT;
- APEX20K_TECHNOLOGY_MAPPER = LUT;
- MAX7000_TECHNOLOGY_MAPPER = "PRODUCT TERM";
- STRATIX_TECHNOLOGY_MAPPER = LUT;
- AUTO_IMPLEMENT_IN_ROM = OFF;
- AUTO_GLOBAL_MEMORY_CONTROLS = OFF;
- AUTO_GLOBAL_REGISTER_CONTROLS = ON;
- AUTO_GLOBAL_OE = ON;
- AUTO_GLOBAL_CLOCK = ON;
- USE_LPM_FOR_AHDL_OPERATORS = ON;
- LIMIT_AHDL_INTEGERS_TO_32_BITS = OFF;
- ENABLE_BUS_HOLD_CIRCUITRY = OFF;
- WEAK_PULL_UP_RESISTOR = OFF;
- TURBO_BIT = ON;
- MAX7000_IGNORE_SOFT_BUFFERS = OFF;
- IGNORE_SOFT_BUFFERS = ON;
- MAX7000_IGNORE_LCELL_BUFFERS = AUTO;
- IGNORE_LCELL_BUFFERS = OFF;
- IGNORE_ROW_GLOBAL_BUFFERS = OFF;
- IGNORE_GLOBAL_BUFFERS = OFF;
- IGNORE_CASCADE_BUFFERS = OFF;
- IGNORE_CARRY_BUFFERS = OFF;
- REMOVE_DUPLICATE_REGISTERS = ON;
- REMOVE_REDUNDANT_LOGIC_CELLS = OFF;
- ALLOW_POWER_UP_DONT_CARE = ON;
- PCI_IO = OFF;
- NOT_GATE_PUSH_BACK = ON;
- SLOW_SLEW_RATE = OFF;
- DSP_BLOCK_BALANCING = AUTO;
- STATE_MACHINE_PROCESSING = AUTO;
-}
-DEFAULT_HARDCOPY_SETTINGS
-{
- HARDCOPY_EXTERNAL_CLOCK_JITTER = "0.0 NS";
-}
-DEFAULT_TIMING_REQUIREMENTS
-{
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- RUN_ALL_TIMING_ANALYSES = ON;
- IGNORE_CLOCK_SETTINGS = OFF;
- DEFAULT_HOLD_MULTICYCLE = "SAME AS MULTICYCLE";
- CUT_OFF_IO_PIN_FEEDBACK = ON;
- CUT_OFF_CLEAR_AND_PRESET_PATHS = ON;
- CUT_OFF_READ_DURING_WRITE_PATHS = ON;
- CUT_OFF_PATHS_BETWEEN_CLOCK_DOMAINS = ON;
- DO_MIN_ANALYSIS = ON;
- DO_MIN_TIMING = OFF;
- NUMBER_OF_PATHS_TO_REPORT = 200;
- NUMBER_OF_DESTINATION_TO_REPORT = 10;
- NUMBER_OF_SOURCES_PER_DESTINATION_TO_REPORT = 10;
- MAX_SCC_SIZE = 50;
-}
-HDL_SETTINGS
-{
- VERILOG_INPUT_VERSION = VERILOG_2001;
- ENABLE_IP_DEBUG = OFF;
- VHDL_INPUT_VERSION = VHDL93;
- VHDL_SHOW_LMF_MAPPING_MESSAGES = OFF;
-}
-PROJECT_INFO(usrp_radar_mono)
-{
- ORIGINAL_QUARTUS_VERSION = 3.0;
- PROJECT_CREATION_TIME_DATE = "00:14:04 JULY 13, 2003";
- LAST_QUARTUS_VERSION = 3.0;
- SHOW_REGISTRATION_MESSAGE = ON;
- USER_LIBRARIES = "h:\\gnuradio\\trunk\\usrp\\fpga\\megacells";
-}
-THIRD_PARTY_EDA_TOOLS(usrp_radar_mono)
-{
- EDA_DESIGN_ENTRY_SYNTHESIS_TOOL = "<NONE>";
- EDA_SIMULATION_TOOL = "<NONE>";
- EDA_TIMING_ANALYSIS_TOOL = "<NONE>";
- EDA_BOARD_DESIGN_TOOL = "<NONE>";
- EDA_FORMAL_VERIFICATION_TOOL = "<NONE>";
- EDA_RESYNTHESIS_TOOL = "<NONE>";
-}
-EDA_TOOL_SETTINGS(eda_design_synthesis)
-{
- EDA_INPUT_GND_NAME = GND;
- EDA_INPUT_VCC_NAME = VCC;
- EDA_SHOW_LMF_MAPPING_MESSAGES = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_INPUT_DATA_FORMAT = EDIF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_simulation)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_timing_analysis)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- EDA_LAUNCH_CMD_LINE_TOOL = OFF;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_board_design)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_formal_verification)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_palace)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- RESYNTHESIS_RETIMING = FULL;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
-}
-CLOCK(clk_120mhz)
-{
- FMAX_REQUIREMENT = "120.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(usbclk)
-{
- FMAX_REQUIREMENT = "48.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(SCLK)
-{
- FMAX_REQUIREMENT = "1.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(adclk0)
-{
- FMAX_REQUIREMENT = "60.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(adclk1)
-{
- FMAX_REQUIREMENT = "60.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.qpf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.qpf
deleted file mode 100644
index d85239e99..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.qpf
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 1991-2004 Altera Corporation
-# Any megafunction design, and related netlist (encrypted or decrypted),
-# support information, device programming or simulation file, and any other
-# associated documentation or information provided by Altera or a partner
-# under Altera's Megafunction Partnership Program may be used only
-# to program PLD devices (but not masked PLD devices) from Altera. Any
-# other use of such megafunction design, netlist, support information,
-# device programming or simulation file, or any other related documentation
-# or information is prohibited for any other purpose, including, but not
-# limited to modification, reverse engineering, de-compiling, or use with
-# any other silicon devices, unless such use is explicitly licensed under
-# a separate agreement with Altera or a megafunction partner. Title to the
-# intellectual property, including patents, copyrights, trademarks, trade
-# secrets, or maskworks, embodied in any such megafunction design, netlist,
-# support information, device programming or simulation file, or any other
-# related documentation or information provided by Altera or a megafunction
-# partner, remains with Altera, the megafunction partner, or their respective
-# licensors. No other licenses, including any licenses needed under any third
-# party's intellectual property, are provided herein.
-
-
-
-QUARTUS_VERSION = "4.0"
-DATE = "17:10:11 December 20, 2004"
-
-
-# Active Revisions
-
-PROJECT_REVISION = "usrp_radar_mono"
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.qsf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.qsf
deleted file mode 100644
index 9b13989c2..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.qsf
+++ /dev/null
@@ -1,402 +0,0 @@
-# Copyright (C) 1991-2007 Altera Corporation
-# Your use of Altera Corporation's design tools, logic functions
-# and other software and tools, and its AMPP partner logic
-# functions, and any output files from any of the foregoing
-# (including device programming or simulation files), and any
-# associated documentation or information are expressly subject
-# to the terms and conditions of the Altera Program License
-# Subscription Agreement, Altera MegaCore Function License
-# Agreement, or other applicable license agreement, including,
-# without limitation, that your use is for the sole purpose of
-# programming logic devices manufactured by Altera and sold by
-# Altera or its authorized distributors. Please refer to the
-# applicable agreement for further details.
-
-
-# The default values for assignments are stored in the file
-# usrp_radar_mono_assignment_defaults.qdf
-# If this file doesn't exist, and for assignments not listed, see file
-# assignment_defaults.qdf
-
-# Altera recommends that you do not modify this file. This
-# file is updated automatically by the Quartus II software
-# and any changes you make may be lost or overwritten.
-
-
-
-# Project-Wide Assignments
-# ========================
-set_global_assignment -name ORIGINAL_QUARTUS_VERSION 3.0
-set_global_assignment -name PROJECT_CREATION_TIME_DATE "00:14:04 JULY 13, 2003"
-set_global_assignment -name LAST_QUARTUS_VERSION "7.1 SP1"
-set_global_assignment -name MESSAGE_SUPPRESSION_RULE_FILE usrp_radar_mono.srf
-
-# Pin & Location Assignments
-# ==========================
-set_global_assignment -name RESERVE_PIN "AS INPUT TRI-STATED"
-set_location_assignment PIN_29 -to SCLK
-set_location_assignment PIN_117 -to SDI
-set_location_assignment PIN_28 -to usbclk
-set_location_assignment PIN_107 -to usbctl[0]
-set_location_assignment PIN_106 -to usbctl[1]
-set_location_assignment PIN_105 -to usbctl[2]
-set_location_assignment PIN_100 -to usbdata[0]
-set_location_assignment PIN_84 -to usbdata[10]
-set_location_assignment PIN_83 -to usbdata[11]
-set_location_assignment PIN_82 -to usbdata[12]
-set_location_assignment PIN_79 -to usbdata[13]
-set_location_assignment PIN_78 -to usbdata[14]
-set_location_assignment PIN_77 -to usbdata[15]
-set_location_assignment PIN_99 -to usbdata[1]
-set_location_assignment PIN_98 -to usbdata[2]
-set_location_assignment PIN_95 -to usbdata[3]
-set_location_assignment PIN_94 -to usbdata[4]
-set_location_assignment PIN_93 -to usbdata[5]
-set_location_assignment PIN_88 -to usbdata[6]
-set_location_assignment PIN_87 -to usbdata[7]
-set_location_assignment PIN_86 -to usbdata[8]
-set_location_assignment PIN_85 -to usbdata[9]
-set_location_assignment PIN_104 -to usbrdy[0]
-set_location_assignment PIN_101 -to usbrdy[1]
-set_location_assignment PIN_76 -to FX2_1
-set_location_assignment PIN_75 -to FX2_2
-set_location_assignment PIN_74 -to FX2_3
-set_location_assignment PIN_116 -to io_rx_a[0]
-set_location_assignment PIN_115 -to io_rx_a[1]
-set_location_assignment PIN_114 -to io_rx_a[2]
-set_location_assignment PIN_113 -to io_rx_a[3]
-set_location_assignment PIN_108 -to io_rx_a[4]
-set_location_assignment PIN_195 -to io_rx_a[5]
-set_location_assignment PIN_196 -to io_rx_a[6]
-set_location_assignment PIN_197 -to io_rx_a[7]
-set_location_assignment PIN_200 -to io_rx_a[8]
-set_location_assignment PIN_201 -to io_rx_a[9]
-set_location_assignment PIN_202 -to io_rx_a[10]
-set_location_assignment PIN_203 -to io_rx_a[11]
-set_location_assignment PIN_206 -to io_rx_a[12]
-set_location_assignment PIN_207 -to io_rx_a[13]
-set_location_assignment PIN_208 -to io_rx_a[14]
-set_location_assignment PIN_214 -to io_rx_b[0]
-set_location_assignment PIN_215 -to io_rx_b[1]
-set_location_assignment PIN_216 -to io_rx_b[2]
-set_location_assignment PIN_217 -to io_rx_b[3]
-set_location_assignment PIN_218 -to io_rx_b[4]
-set_location_assignment PIN_219 -to io_rx_b[5]
-set_location_assignment PIN_222 -to io_rx_b[6]
-set_location_assignment PIN_223 -to io_rx_b[7]
-set_location_assignment PIN_224 -to io_rx_b[8]
-set_location_assignment PIN_225 -to io_rx_b[9]
-set_location_assignment PIN_226 -to io_rx_b[10]
-set_location_assignment PIN_227 -to io_rx_b[11]
-set_location_assignment PIN_228 -to io_rx_b[12]
-set_location_assignment PIN_233 -to io_rx_b[13]
-set_location_assignment PIN_234 -to io_rx_b[14]
-set_location_assignment PIN_175 -to io_tx_a[0]
-set_location_assignment PIN_176 -to io_tx_a[1]
-set_location_assignment PIN_177 -to io_tx_a[2]
-set_location_assignment PIN_178 -to io_tx_a[3]
-set_location_assignment PIN_179 -to io_tx_a[4]
-set_location_assignment PIN_180 -to io_tx_a[5]
-set_location_assignment PIN_181 -to io_tx_a[6]
-set_location_assignment PIN_182 -to io_tx_a[7]
-set_location_assignment PIN_183 -to io_tx_a[8]
-set_location_assignment PIN_184 -to io_tx_a[9]
-set_location_assignment PIN_185 -to io_tx_a[10]
-set_location_assignment PIN_186 -to io_tx_a[11]
-set_location_assignment PIN_187 -to io_tx_a[12]
-set_location_assignment PIN_188 -to io_tx_a[13]
-set_location_assignment PIN_193 -to io_tx_a[14]
-set_location_assignment PIN_73 -to io_tx_b[0]
-set_location_assignment PIN_68 -to io_tx_b[1]
-set_location_assignment PIN_67 -to io_tx_b[2]
-set_location_assignment PIN_66 -to io_tx_b[3]
-set_location_assignment PIN_65 -to io_tx_b[4]
-set_location_assignment PIN_64 -to io_tx_b[5]
-set_location_assignment PIN_63 -to io_tx_b[6]
-set_location_assignment PIN_62 -to io_tx_b[7]
-set_location_assignment PIN_61 -to io_tx_b[8]
-set_location_assignment PIN_60 -to io_tx_b[9]
-set_location_assignment PIN_59 -to io_tx_b[10]
-set_location_assignment PIN_58 -to io_tx_b[11]
-set_location_assignment PIN_57 -to io_tx_b[12]
-set_location_assignment PIN_56 -to io_tx_b[13]
-set_location_assignment PIN_55 -to io_tx_b[14]
-set_location_assignment PIN_152 -to master_clk
-set_location_assignment PIN_144 -to rx_a_a[0]
-set_location_assignment PIN_143 -to rx_a_a[1]
-set_location_assignment PIN_141 -to rx_a_a[2]
-set_location_assignment PIN_140 -to rx_a_a[3]
-set_location_assignment PIN_139 -to rx_a_a[4]
-set_location_assignment PIN_138 -to rx_a_a[5]
-set_location_assignment PIN_137 -to rx_a_a[6]
-set_location_assignment PIN_136 -to rx_a_a[7]
-set_location_assignment PIN_135 -to rx_a_a[8]
-set_location_assignment PIN_134 -to rx_a_a[9]
-set_location_assignment PIN_133 -to rx_a_a[10]
-set_location_assignment PIN_132 -to rx_a_a[11]
-set_location_assignment PIN_23 -to rx_a_b[0]
-set_location_assignment PIN_21 -to rx_a_b[1]
-set_location_assignment PIN_20 -to rx_a_b[2]
-set_location_assignment PIN_19 -to rx_a_b[3]
-set_location_assignment PIN_18 -to rx_a_b[4]
-set_location_assignment PIN_17 -to rx_a_b[5]
-set_location_assignment PIN_16 -to rx_a_b[6]
-set_location_assignment PIN_15 -to rx_a_b[7]
-set_location_assignment PIN_14 -to rx_a_b[8]
-set_location_assignment PIN_13 -to rx_a_b[9]
-set_location_assignment PIN_12 -to rx_a_b[10]
-set_location_assignment PIN_11 -to rx_a_b[11]
-set_location_assignment PIN_131 -to rx_b_a[0]
-set_location_assignment PIN_128 -to rx_b_a[1]
-set_location_assignment PIN_127 -to rx_b_a[2]
-set_location_assignment PIN_126 -to rx_b_a[3]
-set_location_assignment PIN_125 -to rx_b_a[4]
-set_location_assignment PIN_124 -to rx_b_a[5]
-set_location_assignment PIN_123 -to rx_b_a[6]
-set_location_assignment PIN_122 -to rx_b_a[7]
-set_location_assignment PIN_121 -to rx_b_a[8]
-set_location_assignment PIN_120 -to rx_b_a[9]
-set_location_assignment PIN_119 -to rx_b_a[10]
-set_location_assignment PIN_118 -to rx_b_a[11]
-set_location_assignment PIN_8 -to rx_b_b[0]
-set_location_assignment PIN_7 -to rx_b_b[1]
-set_location_assignment PIN_6 -to rx_b_b[2]
-set_location_assignment PIN_5 -to rx_b_b[3]
-set_location_assignment PIN_4 -to rx_b_b[4]
-set_location_assignment PIN_3 -to rx_b_b[5]
-set_location_assignment PIN_2 -to rx_b_b[6]
-set_location_assignment PIN_240 -to rx_b_b[7]
-set_location_assignment PIN_239 -to rx_b_b[8]
-set_location_assignment PIN_238 -to rx_b_b[9]
-set_location_assignment PIN_237 -to rx_b_b[10]
-set_location_assignment PIN_236 -to rx_b_b[11]
-set_location_assignment PIN_156 -to SDO
-set_location_assignment PIN_153 -to SEN_FPGA
-set_location_assignment PIN_159 -to tx_a[0]
-set_location_assignment PIN_160 -to tx_a[1]
-set_location_assignment PIN_161 -to tx_a[2]
-set_location_assignment PIN_162 -to tx_a[3]
-set_location_assignment PIN_163 -to tx_a[4]
-set_location_assignment PIN_164 -to tx_a[5]
-set_location_assignment PIN_165 -to tx_a[6]
-set_location_assignment PIN_166 -to tx_a[7]
-set_location_assignment PIN_167 -to tx_a[8]
-set_location_assignment PIN_168 -to tx_a[9]
-set_location_assignment PIN_169 -to tx_a[10]
-set_location_assignment PIN_170 -to tx_a[11]
-set_location_assignment PIN_173 -to tx_a[12]
-set_location_assignment PIN_174 -to tx_a[13]
-set_location_assignment PIN_38 -to tx_b[0]
-set_location_assignment PIN_39 -to tx_b[1]
-set_location_assignment PIN_41 -to tx_b[2]
-set_location_assignment PIN_42 -to tx_b[3]
-set_location_assignment PIN_43 -to tx_b[4]
-set_location_assignment PIN_44 -to tx_b[5]
-set_location_assignment PIN_45 -to tx_b[6]
-set_location_assignment PIN_46 -to tx_b[7]
-set_location_assignment PIN_47 -to tx_b[8]
-set_location_assignment PIN_48 -to tx_b[9]
-set_location_assignment PIN_49 -to tx_b[10]
-set_location_assignment PIN_50 -to tx_b[11]
-set_location_assignment PIN_53 -to tx_b[12]
-set_location_assignment PIN_54 -to tx_b[13]
-set_location_assignment PIN_158 -to TXSYNC_A
-set_location_assignment PIN_37 -to TXSYNC_B
-set_location_assignment PIN_235 -to io_rx_b[15]
-set_location_assignment PIN_24 -to io_tx_b[15]
-set_location_assignment PIN_213 -to io_rx_a[15]
-set_location_assignment PIN_194 -to io_tx_a[15]
-set_location_assignment PIN_1 -to MYSTERY_SIGNAL
-
-# Classic Timing Assignments
-# ==========================
-set_global_assignment -name INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS OFF
-set_global_assignment -name MAX_SCC_SIZE 50
-
-# Analysis & Synthesis Assignments
-# ================================
-set_global_assignment -name SAVE_DISK_SPACE OFF
-set_global_assignment -name DEVICE_FILTER_PACKAGE "ANY QFP"
-set_global_assignment -name DEVICE_FILTER_PIN_COUNT 240
-set_global_assignment -name EDA_DESIGN_ENTRY_SYNTHESIS_TOOL "<None>"
-set_global_assignment -name FAMILY Cyclone
-set_global_assignment -name CYCLONE_OPTIMIZATION_TECHNIQUE BALANCED
-set_global_assignment -name STRATIX_OPTIMIZATION_TECHNIQUE SPEED
-set_global_assignment -name APEX20K_OPTIMIZATION_TECHNIQUE SPEED
-set_global_assignment -name VHDL_SHOW_LMF_MAPPING_MESSAGES OFF
-set_global_assignment -name USER_LIBRARIES "h:\\gnuradio\\trunk\\usrp\\fpga\\megacells"
-set_global_assignment -name AUTO_ENABLE_SMART_COMPILE ON
-set_global_assignment -name TOP_LEVEL_ENTITY usrp_radar_mono
-
-# Fitter Assignments
-# ==================
-set_global_assignment -name DEVICE EP1C12Q240C8
-set_global_assignment -name CYCLONE_CONFIGURATION_SCHEME "PASSIVE SERIAL"
-set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
-set_global_assignment -name OPTIMIZE_HOLD_TIMING OFF
-set_global_assignment -name OPTIMIZE_TIMING "NORMAL COMPILATION"
-set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF
-set_global_assignment -name IO_PLACEMENT_OPTIMIZATION ON
-set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT NORMAL
-set_global_assignment -name INC_PLC_MODE OFF
-set_global_assignment -name ROUTING_BACK_ANNOTATION_MODE OFF
-set_instance_assignment -name IO_STANDARD LVTTL -to usbdata[12]
-set_global_assignment -name STRATIX_DEVICE_IO_STANDARD LVTTL
-set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1
-
-# EDA Netlist Writer Assignments
-# ==============================
-set_global_assignment -name EDA_SIMULATION_TOOL "<None>"
-set_global_assignment -name EDA_TIMING_ANALYSIS_TOOL "<NONE>"
-set_global_assignment -name EDA_BOARD_DESIGN_TOOL "<NONE>"
-set_global_assignment -name EDA_FORMAL_VERIFICATION_TOOL "<NONE>"
-set_global_assignment -name EDA_RESYNTHESIS_TOOL "<NONE>"
-
-# Assembler Assignments
-# =====================
-set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
-set_global_assignment -name GENERATE_RBF_FILE ON
-set_global_assignment -name RESERVE_ALL_UNUSED_PINS_NO_OUTPUT_GND "AS INPUT TRI-STATED"
-set_global_assignment -name AUTO_RESTART_CONFIGURATION OFF
-
-# Simulator Assignments
-# =====================
-set_global_assignment -name START_TIME "0 ns"
-set_global_assignment -name VECTOR_COMPARE_TRIGGER_MODE INPUT_EDGE
-
-# Design Assistant Assignments
-# ============================
-set_global_assignment -name DRC_REPORT_TOP_FANOUT OFF
-set_global_assignment -name DRC_REPORT_FANOUT_EXCEEDING OFF
-set_global_assignment -name ASSG_CAT OFF
-set_global_assignment -name ASSG_RULE_MISSING_FMAX OFF
-set_global_assignment -name ASSG_RULE_MISSING_TIMING OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_ASYN_RAM OFF
-set_global_assignment -name CLK_CAT OFF
-set_global_assignment -name CLK_RULE_COMB_CLOCK OFF
-set_global_assignment -name CLK_RULE_INV_CLOCK OFF
-set_global_assignment -name CLK_RULE_GATING_SCHEME OFF
-set_global_assignment -name CLK_RULE_INPINS_CLKNET OFF
-set_global_assignment -name CLK_RULE_CLKNET_CLKSPINES OFF
-set_global_assignment -name CLK_RULE_MIX_EDGES OFF
-set_global_assignment -name RESET_CAT OFF
-set_global_assignment -name RESET_RULE_INPINS_RESETNET OFF
-set_global_assignment -name RESET_RULE_UNSYNCH_EXRESET OFF
-set_global_assignment -name RESET_RULE_IMSYNCH_EXRESET OFF
-set_global_assignment -name RESET_RULE_COMB_ASYNCH_RESET OFF
-set_global_assignment -name RESET_RULE_UNSYNCH_ASYNCH_DOMAIN OFF
-set_global_assignment -name RESET_RULE_IMSYNCH_ASYNCH_DOMAIN OFF
-set_global_assignment -name TIMING_CAT OFF
-set_global_assignment -name TIMING_RULE_SHIFT_REG OFF
-set_global_assignment -name TIMING_RULE_COIN_CLKEDGE OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_COMB_DRIVES_RAM_WE OFF
-set_global_assignment -name NONSYNCHSTRUCT_CAT OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_COMBLOOP OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_REG_LOOP OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_DELAY_CHAIN OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_RIPPLE_CLK OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_ILLEGAL_PULSE_GEN OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_MULTI_VIBRATOR OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_SRLATCH OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_LATCH_UNIDENTIFIED OFF
-set_global_assignment -name SIGNALRACE_CAT OFF
-set_global_assignment -name ACLK_CAT OFF
-set_global_assignment -name ACLK_RULE_NO_SZER_ACLK_DOMAIN OFF
-set_global_assignment -name ACLK_RULE_SZER_BTW_ACLK_DOMAIN OFF
-set_global_assignment -name ACLK_RULE_IMSZER_ADOMAIN OFF
-set_global_assignment -name HCPY_CAT OFF
-set_global_assignment -name HCPY_VREF_PINS OFF
-set_global_assignment -name ENABLE_DA_RULE "C101, C102, C103, C104, C105, C106, R101, R102, R103, R104, R105, T101, T102, A101, A102, A103, A104, A105, A106, A107, A108, A109, A110, S101, S102, D101, D102, D103, H102"
-set_global_assignment -name DISABLE_DA_RULE H101
-
-# SignalTap II Assignments
-# ========================
-set_global_assignment -name HUB_ENTITY_NAME SLD_HUB
-set_global_assignment -name HUB_INSTANCE_NAME SLD_HUB_INST
-set_global_assignment -name ENABLE_SIGNALTAP OFF
-
-# LogicLock Region Assignments
-# ============================
-set_global_assignment -name LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT OFF
-
-# start CLOCK(SCLK)
-# -----------------
-
- # Classic Timing Assignments
- # ==========================
-set_global_assignment -name DUTY_CYCLE 50 -section_id SCLK
-set_global_assignment -name FMAX_REQUIREMENT "1 MHz" -section_id SCLK
-
-# end CLOCK(SCLK)
-# ---------------
-
-# start CLOCK(master_clk)
-# -----------------------
-
- # Classic Timing Assignments
- # ==========================
-set_global_assignment -name DUTY_CYCLE 50 -section_id master_clk
-set_global_assignment -name FMAX_REQUIREMENT "64 MHz" -section_id master_clk
-
-# end CLOCK(master_clk)
-# ---------------------
-
-# start CLOCK(usbclk)
-# -------------------
-
- # Classic Timing Assignments
- # ==========================
-set_global_assignment -name DUTY_CYCLE 50 -section_id usbclk
-set_global_assignment -name FMAX_REQUIREMENT "48 MHz" -section_id usbclk
-
-# end CLOCK(usbclk)
-# -----------------
-
-# -----------------------------
-# start ENTITY(usrp_radar_mono)
-
- # Classic Timing Assignments
- # ==========================
-set_instance_assignment -name CLOCK_SETTINGS SCLK -to SCLK
-set_instance_assignment -name CLOCK_SETTINGS usbclk -to usbclk
-set_instance_assignment -name CLOCK_SETTINGS master_clk -to master_clk
-
- # start DESIGN_PARTITION(Top)
- # ---------------------------
-
- # Incremental Compilation Assignments
- # ===================================
-set_instance_assignment -name PARTITION_HIERARCHY no_file_for_top_partition -to | -section_id Top
-set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
-
- # end DESIGN_PARTITION(Top)
- # -------------------------
-
-# end ENTITY(usrp_radar_mono)
-# ---------------------------
-set_global_assignment -name VERILOG_FILE usrp_radar_mono.v
-set_global_assignment -name VERILOG_FILE dacpll.v
-set_global_assignment -name VERILOG_FILE ../lib/cordic_nco.v
-set_global_assignment -name VERILOG_FILE ../lib/dac_interface.v
-set_global_assignment -name VERILOG_FILE ../lib/fifo32_2k.v
-set_global_assignment -name VERILOG_FILE ../lib/radar_control.v
-set_global_assignment -name VERILOG_FILE ../lib/radar_rx.v
-set_global_assignment -name VERILOG_FILE ../lib/radar_tx.v
-set_global_assignment -name VERILOG_FILE ../lib/radar.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/adc_interface.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/atr_delay.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/bidir_reg.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/clk_divider.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cordic_stage.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cordic.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/gen_sync.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/io_pins.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/master_control.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rssi.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rx_buffer.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rx_dcoffset.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/serial_io.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/setting_reg.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/strobe_gen.v \ No newline at end of file
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.rbf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.rbf
deleted file mode 100644
index ee8859b1b..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.rbf
+++ /dev/null
Binary files differ
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.srf b/gr-radar-mono/src/fpga/top/usrp_radar_mono.srf
deleted file mode 100644
index e5645322b..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.srf
+++ /dev/null
@@ -1,65 +0,0 @@
-{ "Warning" "WSGN_SEARCH_FILE" "../../../../../trunk/usrp/fpga/megacells/bustri.v 1 1 " "Warning: Using design file ../../../../../trunk/usrp/fpga/megacells/bustri.v, which is not specified as a design file for the current project, but contains definitions for 1 design units and 1 entities in project" { } { } 0 0 "Using design file %1!s!, which is not specified as a design file for the current project, but contains definitions for %2!d! design units and %3!d! entities in project" 1 0 "" 0}
-{ "Warning" "WSGN_SEARCH_FILE" "../../../../../trunk/usrp/fpga/megacells/fifo_4k.v 10 10 " "Warning: Using design file ../../../../../trunk/usrp/fpga/megacells/fifo_4k.v, which is not specified as a design file for the current project, but contains definitions for 10 design units and 10 entities in project" { } { } 0 0 "Using design file %1!s!, which is not specified as a design file for the current project, but contains definitions for %2!d! design units and %3!d! entities in project" 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_rx_delay 12 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_rx_delay\" is connected to a signal of width 12. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_rx_delay" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 138 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_tx_delay 12 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_tx_delay\" is connected to a signal of width 12. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_tx_delay" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 137 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_rxval_3 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_rxval_3\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_rxval_3" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 134 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_txval_3 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_txval_3\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_txval_3" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 133 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_mask_3 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_mask_3\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_mask_3" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 132 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_rxval_2 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_rxval_2\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_rxval_2" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 130 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_txval_2 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_txval_2\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_txval_2" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 129 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_mask_2 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_mask_2\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_mask_2" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 128 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_rxval_1 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_rxval_1\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_rxval_1" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 126 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_txval_1 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_txval_1\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_txval_1" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 125 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_mask_1 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_mask_1\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_mask_1" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 124 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_rxval_0 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_rxval_0\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_rxval_0" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 122 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_txval_0 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_txval_0\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_txval_0" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 121 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_atr_mask_0 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_atr_mask_0\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_atr_mask_0" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 120 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_WIDE" "ratio clk_div_3 7 8 " "Warning: Port \"ratio\" on the entity instantiation of \"clk_div_3\" is connected to a signal of width 7. The formal width of the signal in the module is 8. Extra bits will be driven by GND." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "clk_div_3" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 98 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be driven by GND." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_WIDE" "ratio clk_div_2 7 8 " "Warning: Port \"ratio\" on the entity instantiation of \"clk_div_2\" is connected to a signal of width 7. The formal width of the signal in the module is 8. Extra bits will be driven by GND." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "clk_div_2" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 97 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be driven by GND." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_WIDE" "ratio clk_div_1 7 8 " "Warning: Port \"ratio\" on the entity instantiation of \"clk_div_1\" is connected to a signal of width 7. The formal width of the signal in the module is 8. Extra bits will be driven by GND." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "clk_div_1" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 96 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be driven by GND." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_WIDE" "ratio clk_div_0 7 8 " "Warning: Port \"ratio\" on the entity instantiation of \"clk_div_0\" is connected to a signal of width 7. The formal width of the signal in the module is 8. Extra bits will be driven by GND." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "clk_div_0" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 95 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be driven by GND." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_debugen 4 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_debugen\" is connected to a signal of width 4. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_debugen" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 93 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_rxbref 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_rxbref\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_rxbref" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 91 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_txbref 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_txbref\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_txbref" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 90 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_rxaref 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_rxaref\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_rxaref" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 89 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_txaref 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_txaref\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_txaref" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 88 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_decim 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_decim\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_decim" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 51 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_interp 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_interp\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_interp" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 50 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_mstr_ctrl 8 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_mstr_ctrl\" is connected to a signal of width 8. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/master_control.v" "sr_mstr_ctrl" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/master_control.v" 42 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage11 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage11\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage11" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 100 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage10 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage10\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage10" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 99 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage9 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage9\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage9" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 98 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage8 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage8\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage8" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 97 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage7 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage7\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage7" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 96 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage6 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage6\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage6" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 95 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage5 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage5\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage5" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 94 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage4 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage4\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage4" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 93 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage3 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage3\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage3" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 92 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage2 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage2\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage2" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 91 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage1 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage1\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage1" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 90 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_INPUT_PORT_TOO_NARROW" "ordered port 6 cordic_stage0 16 15 " "Warning: Port \"ordered port 6\" on the entity instantiation of \"cordic_stage0\" is connected to a signal of width 16. The formal width of the signal in the module is 15. Extra bits will be ignored." { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "cordic_stage0" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 89 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be ignored." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_ampl 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_ampl\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_ampl" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 81 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_tlook 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_tlook\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_tlook" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 75 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_tsw 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_tsw\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_tsw" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 72 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_ton 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_ton\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_ton" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 69 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_rxformat 11 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_rxformat\" is connected to a signal of width 11. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/rx_buffer.v" "sr_rxformat" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/rx_buffer.v" 66 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_rxmux 20 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_rxmux\" is connected to a signal of width 20. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/adc_interface.v" "sr_rxmux" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/adc_interface.v" 54 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_dco_en 4 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_dco_en\" is connected to a signal of width 4. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../../../../usrp/fpga/sdr_lib/adc_interface.v" "sr_dco_en" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/adc_interface.v" 32 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WCDB_SGATE_CDB_WARN_TRIVIAL_REG" "radar:radar_mono\|radar_tx:transmitter\|cordic_nco:nco\|cordic:tx_cordic\|y0\[0\] data_in GND " "Warning: Reduced register \"radar:radar_mono\|radar_tx:transmitter\|cordic_nco:nco\|cordic:tx_cordic\|y0\[0\]\" with stuck data_in port to stuck value GND" { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 64 -1 0 } } } 0 0 "Reduced register \"%1!s!\" with stuck %2!s! port to stuck value %3!s!" 1 0 "" 0}
-{ "Warning" "WCDB_SGATE_CDB_WARN_TRIVIAL_REG" "radar:radar_mono\|radar_tx:transmitter\|cordic_nco:nco\|cordic:tx_cordic\|y0\[1\] data_in GND " "Warning: Reduced register \"radar:radar_mono\|radar_tx:transmitter\|cordic_nco:nco\|cordic:tx_cordic\|y0\[1\]\" with stuck data_in port to stuck value GND" { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 64 -1 0 } } } 0 0 "Reduced register \"%1!s!\" with stuck %2!s! port to stuck value %3!s!" 1 0 "" 0}
-{ "Warning" "WCDB_SGATE_CDB_WARN_TRIVIAL_REG" "master_control:master_control\|atr_delay:atr_delay\|state.0001 data_in GND " "Warning: Reduced register \"master_control:master_control\|atr_delay:atr_delay\|state.0001\" with stuck data_in port to stuck value GND" { } { { "../../../../usrp/fpga/sdr_lib/atr_delay.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/atr_delay.v" 31 -1 0 } } } 0 0 "Reduced register \"%1!s!\" with stuck %2!s! port to stuck value %3!s!" 1 0 "" 0}
-{ "Warning" "WOPT_MLS_STUCK_PIN_HDR" "" "Warning: Output pins are stuck at VCC or GND" { { "Warning" "WOPT_MLS_STUCK_PIN" "MYSTERY_SIGNAL GND " "Warning: Pin \"MYSTERY_SIGNAL\" stuck at GND" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 24 -1 0 } } } 0 0 "Pin \"%1!s!\" stuck at %2!s!" 1 0 "" 0} } { } 0 0 "Output pins are stuck at VCC or GND" 0 0 "" 0}
-{ "Warning" "WOPT_MLS_STUCK_PIN_HDR" "" "Warning: Output pins are stuck at VCC or GND" { { "Warning" "WOPT_MLS_STUCK_PIN" "FX2_3 GND " "Warning: Pin \"FX2_3\" stuck at GND" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 33 -1 0 } } } 0 0 "Pin \"%1!s!\" stuck at %2!s!" 1 0 "" 0} } { } 0 0 "Output pins are stuck at VCC or GND" 0 0 "" 0}
-{ "Warning" "WOPT_MLS_STUCK_PIN_HDR" "" "Warning: Output pins are stuck at VCC or GND" { { "Warning" "WOPT_MLS_STUCK_PIN" "usbrdy\[0\] GND " "Warning: Pin \"usbrdy\[0\]\" stuck at GND" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 49 -1 0 } } } 0 0 "Pin \"%1!s!\" stuck at %2!s!" 1 0 "" 0} } { } 0 0 "Output pins are stuck at VCC or GND" 0 0 "" 0}
-{ "Warning" "WCUT_CUT_UNNECESSARY_INPUT_PIN_HDR" "1 " "Warning: Design contains * input pin(s) that do not drive logic" { { "Warning" "WCUT_CUT_UNNECESSARY_INPUT_PIN" "usbctl\[0\] " "Warning: No output dependent on input pin \"usbctl\[0\]\"" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 48 -1 0 } } } 0 0 "No output dependent on input pin \"%1!s!\"" 1 0 "" 0} } { } 0 0 "Design contains %1!d! input pin(s) that do not drive logic" 0 0 "" 0}
-{ "Warning" "WFIOMGR_BIDIR_OR_OUTPUT_WITH_TRIVIAL_DATAIN" "3 " "Warning: Following * pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results" { { "Info" "IFIOMGR_BIDIR_OR_OUTPUT_WITH_TRIVIAL_DATAIN_SUB" "MYSTERY_SIGNAL GND " "Info: Pin MYSTERY_SIGNAL has GND driving its datain port" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 24 -1 0 } } { "c:/altera/71sp1/quartus/bin/Assignment Editor.qase" "" { Assignment "c:/altera/71sp1/quartus/bin/Assignment Editor.qase" 1 { { 0 "MYSTERY_SIGNAL" } } } } { "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" { Floorplan "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" "" { MYSTERY_SIGNAL } "NODE_NAME" } } { "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" { Floorplan "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" "" { MYSTERY_SIGNAL } "NODE_NAME" } } } 0 0 "Pin %1!s! has %2!s! driving its datain port" 1 0 "" 0} } { } 0 0 "Following %1!d! pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results" 0 0 "" 0}
-{ "Warning" "WFIOMGR_BIDIR_OR_OUTPUT_WITH_TRIVIAL_DATAIN" "3 " "Warning: Following * pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results" { { "Info" "IFIOMGR_BIDIR_OR_OUTPUT_WITH_TRIVIAL_DATAIN_SUB" "FX2_3 GND " "Info: Pin FX2_3 has GND driving its datain port" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 33 -1 0 } } { "c:/altera/71sp1/quartus/bin/Assignment Editor.qase" "" { Assignment "c:/altera/71sp1/quartus/bin/Assignment Editor.qase" 1 { { 0 "FX2_3" } } } } { "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" { Floorplan "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" "" { FX2_3 } "NODE_NAME" } } { "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" { Floorplan "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" "" { FX2_3 } "NODE_NAME" } } } 0 0 "Pin %1!s! has %2!s! driving its datain port" 1 0 "" 0} } { } 0 0 "Following %1!d! pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results" 0 0 "" 0}
-{ "Warning" "WFIOMGR_BIDIR_OR_OUTPUT_WITH_TRIVIAL_DATAIN" "3 " "Warning: Following * pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results" { { "Info" "IFIOMGR_BIDIR_OR_OUTPUT_WITH_TRIVIAL_DATAIN_SUB" "usbrdy\[0\] GND " "Info: Pin usbrdy\[0\] has GND driving its datain port" { } { { "usrp_radar_mono.v" "" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/top/usrp_radar_mono.v" 49 -1 0 } } { "c:/altera/71sp1/quartus/bin/Assignment Editor.qase" "" { Assignment "c:/altera/71sp1/quartus/bin/Assignment Editor.qase" 1 { { 0 "usbrdy\[0\]" } } } } { "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" { Floorplan "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" "" { usbrdy[0] } "NODE_NAME" } } { "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" { Floorplan "c:/altera/71sp1/quartus/bin/TimingClosureFloorplan.fld" "" "" { usbrdy[0] } "NODE_NAME" } } } 0 0 "Pin %1!s! has %2!s! driving its datain port" 1 0 "" 0} } { } 0 0 "Following %1!d! pins have nothing, GND, or VCC driving datain port -- changes to this connectivity may change fitting results" 0 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_ampl 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_ampl\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_ampl" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 79 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_tlook 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_tlook\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_tlook" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 73 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_tsw 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_tsw\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_tsw" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 70 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WSGN_WIDTH_MISMATCH_OUTPUT_PORT" "out sr_ton 16 32 " "Warning: Port \"out\" on the entity instantiation of \"sr_ton\" is connected to a signal of width 16. The formal width of the signal in the module is 32. Extra bits will be left dangling without any fanout logic." { } { { "../lib/radar_control.v" "sr_ton" { Text "H:/gnuradio/radar/gr-radar-mono/src/fpga/lib/radar_control.v" 67 0 0 } } } 0 0 "Port \"%1!s!\" on the entity instantiation of \"%2!s!\" is connected to a signal of width %3!d!. The formal width of the signal in the module is %4!d!. Extra bits will be left dangling without any fanout logic." 1 0 "" 0}
-{ "Warning" "WVRFX_L2_VERI_EXPRESSION_TRUNCATED_TO_FIT" "32 12 atr_delay.v(58) " "Warning (10230): Verilog HDL assignment warning at atr_delay.v(58): truncated value with size 32 to match size of target (12)" { } { { "../../../../usrp/fpga/sdr_lib/atr_delay.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/atr_delay.v" 58 0 0 } } } 0 10230 "Verilog HDL assignment warning at %3!s!: truncated value with size %1!d! to match size of target (%2!d!)" 1 0 "" 0}
-{ "Warning" "WVRFX_L2_VERI_EXPRESSION_TRUNCATED_TO_FIT" "32 12 atr_delay.v(71) " "Warning (10230): Verilog HDL assignment warning at atr_delay.v(71): truncated value with size 32 to match size of target (12)" { } { { "../../../../usrp/fpga/sdr_lib/atr_delay.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/atr_delay.v" 71 0 0 } } } 0 10230 "Verilog HDL assignment warning at %3!s!: truncated value with size %1!d! to match size of target (%2!d!)" 1 0 "" 0}
-{ "Warning" "WVRFX_L2_HDL_OBJECT_ASSIGNED_NOT_READ" "write_done serial_io.v(48) " "Warning (10036): Verilog HDL or VHDL warning at serial_io.v(48): object \"write_done\" assigned a value but never read" { } { { "../../../../usrp/fpga/sdr_lib/serial_io.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/serial_io.v" 48 0 0 } } } 0 10036 "Verilog HDL or VHDL warning at %2!s!: object \"%1!s!\" assigned a value but never read" 1 0 "" 0}
-{ "Warning" "WCDB_SGATE_CDB_WARN_TRIVIAL_REG" "radar:radar_mono\|radar_tx:transmitter\|cordic_nco:nco\|cordic:tx_cordic\|y0\[2\] data_in GND " "Warning: Reduced register \"radar:radar_mono\|radar_tx:transmitter\|cordic_nco:nco\|cordic:tx_cordic\|y0\[2\]\" with stuck data_in port to stuck value GND" { } { { "../../../../usrp/fpga/sdr_lib/cordic.v" "" { Text "H:/gnuradio/radar/usrp/fpga/sdr_lib/cordic.v" 64 -1 0 } } } 0 0 "Reduced register \"%1!s!\" with stuck %2!s! port to stuck value %3!s!" 1 0 "" 0}
diff --git a/gr-radar-mono/src/fpga/top/usrp_radar_mono.v b/gr-radar-mono/src/fpga/top/usrp_radar_mono.v
deleted file mode 100644
index 2620a3288..000000000
--- a/gr-radar-mono/src/fpga/top/usrp_radar_mono.v
+++ /dev/null
@@ -1,213 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2003,2004 Matt Ettus
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module usrp_radar_mono
-(output MYSTERY_SIGNAL,
- input master_clk,
- input SCLK,
- input SDI,
- inout SDO,
- input SEN_FPGA,
-
- input FX2_1,
- output FX2_2,
- output FX2_3,
-
- input wire [11:0] rx_a_a,
- input wire [11:0] rx_b_a,
- input wire [11:0] rx_a_b,
- input wire [11:0] rx_b_b,
-
- output wire [13:0] tx_a,
- output wire [13:0] tx_b,
-
- output wire TXSYNC_A,
- output wire TXSYNC_B,
-
- // USB interface
- input usbclk,
- input wire [2:0] usbctl,
- output wire [1:0] usbrdy,
- inout [15:0] usbdata, // NB Careful, inout
-
- // These are the general purpose i/o's that go to the daughterboard slots
- inout wire [15:0] io_tx_a,
- inout wire [15:0] io_tx_b,
- inout wire [15:0] io_rx_a,
- inout wire [15:0] io_rx_b
- );
- wire [15:0] debugdata,debugctrl;
- assign MYSTERY_SIGNAL = 1'b0;
-
- wire clk64;
-
- // wire WR = usbctl[0];
- wire RD = usbctl[1];
- wire OE = usbctl[2];
-
- wire have_pkt_rdy;
- assign usbrdy[0] = 1'b0; // have_space;
- assign usbrdy[1] = have_pkt_rdy;
-
- wire tx_underrun, rx_overrun;
- wire clear_status = FX2_1;
- assign FX2_2 = rx_overrun;
- assign FX2_3 = 1'b0; // tx_underrun;
-
- wire [15:0] usbdata_out;
-
- wire [3:0] rx_numchan;
- wire enable_tx, enable_rx;
- wire tx_dsp_reset, rx_dsp_reset, tx_bus_reset, rx_bus_reset;
-
- // Tri-state bus macro
- bustri bustri( .data(usbdata_out),.enabledt(OE),.tridata(usbdata) );
-
- assign clk64 = master_clk;
-
- // TX
- wire tx_sample_strobe;
- wire io_tx_ena;
-
- wire serial_strobe;
- wire [6:0] serial_addr;
- wire [31:0] serial_data;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Transmit Side
-
- wire tx_side;
- wire [13:0] tx_i, tx_q;
- wire [13:0] tx_dac;
- wire tx_sync;
-
- dac_interface dac(.clk_i(clk64),.rst_i(tx_dsp_reset),.ena_i(enable_tx),
- .strobe_i(tx_sample_strobe),.tx_i_i(tx_i),.tx_q_i(tx_q),
- .tx_data_o(tx_dac),.tx_sync_o(tx_sync));
-
- // Route transmitted signal to side A or side B
- assign tx_a = tx_side ? 14'b0 : tx_dac;
- assign tx_b = tx_side ? tx_dac : 14'b0;
- assign TXSYNC_A = tx_side ? 1'b0 : tx_sync;
- assign TXSYNC_B = tx_side ? tx_sync : 1'b0;
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Receive Side
- wire rx_strobe;
- wire [15:0] rx_adc0_i, rx_adc0_q;
- wire [15:0] rx_buf_i, rx_buf_q;
-
- adc_interface adc_interface(.clock(clk64),.reset(rx_dsp_reset),.enable(enable_rx),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .rx_a_a(rx_a_a),.rx_b_a(rx_b_a),.rx_a_b(rx_a_b),.rx_b_b(rx_b_b),
- .rssi_0(),.rssi_1(),.rssi_2(),.rssi_3(),
- .ddc0_in_i(rx_adc0_i),.ddc0_in_q(rx_adc0_q),
- .ddc1_in_i(),.ddc1_in_q(),
- .ddc2_in_i(),.ddc2_in_q(),
- .ddc3_in_i(),.ddc3_in_q(),.rx_numchan(rx_numchan) );
-
- rx_buffer rx_buffer
- ( .usbclk(usbclk),.bus_reset(rx_bus_reset),.reset(rx_dsp_reset),
- .reset_regs(rx_dsp_reset),
- .usbdata(usbdata_out),.RD(RD),.have_pkt_rdy(have_pkt_rdy),.rx_overrun(rx_overrun),
- .channels(rx_numchan),
- .ch_0(rx_buf_i),.ch_1(rx_buf_q),
- .ch_2(),.ch_3(),
- .ch_4(),.ch_5(),
- .ch_6(),.ch_7(),
- .rxclk(clk64),.rxstrobe(rx_strobe),
- .clear_status(clear_status),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .debugbus() );
-
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Top level application
- radar radar_mono ( .clk_i(clk64),.saddr_i(serial_addr),.sdata_i(serial_data),.s_strobe_i(serial_strobe),
- .tx_side_o(tx_side),.tx_strobe_o(tx_sample_strobe),.tx_dac_i_o(tx_i),.tx_dac_q_o(tx_q),
- .rx_adc_i_i(rx_adc0_i),.rx_adc_q_i(rx_adc0_q),
- .rx_strobe_o(rx_strobe),.rx_ech_i_o(rx_buf_i),.rx_ech_q_o(rx_buf_q),.io_tx_ena_o(io_tx_ena)
- );
-
- // Route TX enable out to RFX transmit mixer enable
- assign io_tx_a[5] = tx_side ? 1'bz : io_tx_ena;
- assign io_tx_b[5] = tx_side ? io_tx_ena : 1'bz;
-
- // Route opposite of TX enable out to RFX receive mixer
- //assign io_rx_a[5] = tx_side ? 1'bz : ~io_tx_ena;
- //assign io_rx_b[5] = tx_side ? ~io_tx_ena : 1'bz;
- assign io_rx_a[5] = 1'b1;
- assign io_rx_b[5] = 1'b1;
-
-
- // Route TX enable out to RX/TX switch
- assign io_tx_a[6] = tx_side ? 1'bz : ~io_tx_ena;
- assign io_tx_b[6] = tx_side ? ~io_tx_ena : 1'bz;
-
- // Enable common RX/TX antenna
- assign io_rx_a[6] = tx_side ? 1'bz : 1'b0;
- assign io_rx_b[6] = tx_side ? 1'b0 : 1'bz;
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Control Functions
-
- wire [31:0] capabilities;
- assign capabilities[7] = 0; // `TX_CAP_HB;
- assign capabilities[6:4] = 1; // `TX_CAP_NCHAN;
- assign capabilities[3] = 0; // `RX_CAP_HB;
- assign capabilities[2:0] = 2; // `RX_CAP_NCHAN;
-
- serial_io serial_io
- ( .master_clk(clk64),.serial_clock(SCLK),.serial_data_in(SDI),
- .enable(SEN_FPGA),.reset(1'b0),.serial_data_out(SDO),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .readback_0({io_rx_a,io_tx_a}),.readback_1({io_rx_b,io_tx_b}),.readback_2(capabilities),.readback_3(32'hf0f0931a),
- .readback_4(),.readback_5(),.readback_6(),.readback_7()
- );
-
- wire [15:0] reg_0,reg_1,reg_2,reg_3;
- master_control master_control
- ( .master_clk(clk64),.usbclk(usbclk),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .tx_bus_reset(tx_bus_reset),.rx_bus_reset(rx_bus_reset),
- .tx_dsp_reset(tx_dsp_reset),.rx_dsp_reset(rx_dsp_reset),
- .enable_tx(enable_tx),.enable_rx(enable_rx),
- .interp_rate(),.decim_rate(),
- .tx_sample_strobe(),.strobe_interp(),
- .rx_sample_strobe(),.strobe_decim(),
- .tx_empty(),
- .debug_0(),.debug_1(),
- .debug_2(),.debug_3(),
- .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3) );
-
- wire [1:0] dummy_io = 2'bz;
-
- io_pins io_pins
- (.io_0({io_tx_a[15:7],dummy_io,io_tx_a[4:0]}), // Don't connect pins used above
- .io_1({io_rx_a[15:7],dummy_io,io_rx_a[4:0]}),
- .io_2({io_tx_b[15:7],dummy_io,io_tx_b[4:0]}),
- .io_3({io_rx_b[15:7],dummy_io,io_rx_b[4:0]}),
- .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3),
- .clock(clk64),.rx_reset(rx_dsp_reset),.tx_reset(tx_dsp_reset),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe));
-
-endmodule // usrp_radar_mono
diff --git a/gr-radar-mono/src/lib/.gitignore b/gr-radar-mono/src/lib/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-radar-mono/src/lib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-radar-mono/src/python/.gitignore b/gr-radar-mono/src/python/.gitignore
deleted file mode 100644
index f104c5892..000000000
--- a/gr-radar-mono/src/python/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/Makefile
-/Makefile.in
-/run_tests
-/*.pyc
diff --git a/gr-radar-mono/src/python/Makefile.am b/gr-radar-mono/src/python/Makefile.am
deleted file mode 100644
index 535bb85a4..000000000
--- a/gr-radar-mono/src/python/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2007,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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-radar_mono_pythondir = $(grpythondir)
-
-dist_bin_SCRIPTS = \
- usrp_radar_mono.py
-
-radar_mono_python_PYTHON = \
- radar_mono.py
diff --git a/gr-radar-mono/src/python/qa_nothing.py b/gr-radar-mono/src/python/qa_nothing.py
deleted file mode 100644
index e69de29bb..000000000
--- a/gr-radar-mono/src/python/qa_nothing.py
+++ /dev/null
diff --git a/gr-radar-mono/src/python/radar_mono.py b/gr-radar-mono/src/python/radar_mono.py
deleted file mode 100644
index 1a7b9260a..000000000
--- a/gr-radar-mono/src/python/radar_mono.py
+++ /dev/null
@@ -1,330 +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.
-#
-
-from gnuradio import gr, usrp
-from gnuradio import eng_notation
-from gr import gr_threading as _threading
-
-n2s = eng_notation.num_to_str
-
-txp_delay = 60 # Pipeline delay to turn on transmit mixer
-rxp_delay = 76 # Pipeline delay to turn off transmit mixer
-
-#-----------------------------------------------------------------------
-# FPGA Register Definitions
-#-----------------------------------------------------------------------
-FR_RADAR_MODE = usrp.FR_USER_0 # Operational mode
-bmFR_RADAR_MODE_RESET = 1 << 0 # bit 0: active high reset
-bmFR_RADAR_TXSIDE = 1 << 1 # bit 1: use TX side A or B
-#bmFR_RADAR_MODE_LP = 1 << 2 # bit 2: enable digital loopback
-#bmFR_RADAR_MODE_DR = 1 << 3 # bit 3: enable on-board deramping
-#bmFR_RADAR_MODE_MD = 1 << 4 # bit 4: enable echo metadata
-#bmFR_RADAR_MODE_CHIRPS = 3 << 5 # bit 5,6: number of chirp center frequencies
-bmFR_RADAR_DEBUG = 1 << 7 # bit 7: enable debugging mode
-
-FR_RADAR_TON = usrp.FR_USER_1 # 16-bit transmitter on time in clocks
-FR_RADAR_TSW = usrp.FR_USER_2 # 16-bit transmitter switch time in clocks
-FR_RADAR_TLOOK = usrp.FR_USER_3 # 16-bit receiver look time in clocks
-FR_RADAR_TIDLE = usrp.FR_USER_4 # 32-bit inter-pulse idle time
-FR_RADAR_AMPL = usrp.FR_USER_5 # 16-bit pulse amplitude (2s complement) into CORDIC
-FR_RADAR_FSTART = usrp.FR_USER_6 # 32-bit FTW for chirp start frequency
-FR_RADAR_FINCR = usrp.FR_USER_7 # 32-bit FTW increment per transmit clock
-FR_RADAR_ATRDEL = usrp.FR_USER_8 # 16-bit TX delay in clocks, 16-bit RX delay in clocks
-
-# These are for phase II development (need to renumber)
-#FR_RADAR_FREQ1N = usrp.FR_USER_8 # 24-bit N register for chirp #1
-#FR_RADAR_FREQ1R = usrp.FR_USER_9 # 24-bit R register for chirp #1
-#FR_RADAR_FREQ1C = usrp.FR_USER_10 # 24-bit C register for chirp #1
-#FR_RADAR_FREQ2N = usrp.FR_USER_11 # 24-bit N register for chirp #2
-#FR_RADAR_FREQ2R = usrp.FR_USER_12 # 24-bit R register for chirp #2
-#FR_RADAR_FREQ2C = usrp.FR_USER_13 # 24-bit C register for chirp #2
-#FR_RADAR_FREQ3N = usrp.FR_USER_14 # 24-bit N register for chirp #3
-#FR_RADAR_FREQ3R = usrp.FR_USER_15 # 24-bit R register for chirp #3
-#FR_RADAR_FREQ3C = usrp.FR_USER_16 # 24-bit C register for chirp #3
-#FR_RADAR_FREQ4N = usrp.FR_USER_17 # 24-bit N register for chirp #4
-#FR_RADAR_FREQ4R = usrp.FR_USER_18 # 24-bit R register for chirp #4
-#FR_RADAR_FREQ4C = usrp.FR_USER_19 # 24-bit C register for chirp #4
-
-#-----------------------------------------------------------------------
-# Transmitter object. Uses usrp_sink, but only for a handle to the
-# FPGA registers.
-#-----------------------------------------------------------------------
-class radar_tx(object):
- def __init__(self, options):
- self._subdev_spec = options.tx_subdev_spec
- self._verbose = options.verbose
- self._debug = options.debug
- self._u = usrp.sink_s(fpga_filename='usrp_radar_mono.rbf')
-
- if self._subdev_spec == None:
- self._subdev_spec = usrp.pick_tx_subdevice(self._u)
-
- self._subdev = usrp.selected_subdev(self._u, self._subdev_spec)
- self._subdev.set_lo_offset(0.0)
- self._ton_ticks = 0
- self._tsw_ticks = 0
- self._tlook_ticks = 0
- self._tidle_ticks = 0
-
- if self._verbose:
- print "Using", self._subdev.name(), "for radar transmitter."
-
- def set_ton(self, ton):
- self._ton_ticks = 2*(int(ton*64e6)/2)-1 # Even number, then subtract 1
- if self._verbose:
- print "Setting pulse on time to", ton, " sec ("+`self._ton_ticks+1`+" ticks)"
- self._u._write_fpga_reg(FR_RADAR_TON, self._ton_ticks)
-
- def set_tsw(self, tsw):
- self._tsw_ticks = 2*(int(tsw*64e6)/2)-1+rxp_delay # Even number, then subtract 1
- if self._verbose:
- print "Setting pulse switching time to", tsw, " sec ("+`self._tsw_ticks+1`+" ticks)"
- self._u._write_fpga_reg(FR_RADAR_TSW, self._tsw_ticks)
-
- def set_tlook(self, tlook):
- self._tlook_ticks = 2*(int(tlook*64e6)/2)-1 # Even number, then subtract 1
- if self._verbose:
- print "Setting receiver look time to", tlook, " sec ("+`self._tlook_ticks+1`+" ticks)"
- self._u._write_fpga_reg(FR_RADAR_TLOOK, self._tlook_ticks)
-
- def set_prf(self, prf):
- period = 2*int(32e6/prf)
- self._tidle_ticks = period-(self._ton_ticks+self._tsw_ticks+self._tlook_ticks+3)-1
- if self._verbose:
- print "Setting PRF to", prf, "Hz ("+`self._tidle_ticks+1`+" ticks idle time)"
- self._u._write_fpga_reg(FR_RADAR_TIDLE, self._tidle_ticks)
-
- def set_amplitude(self, ampl):
- self._amplitude = int(ampl*9946/100.0) # CORDIC gain correction
- self._u._write_fpga_reg(FR_RADAR_AMPL, self._amplitude)
-
- def set_freq(self, center_freq, chirp_width):
- self._center_freq = center_freq
- self._chirp_width = chirp_width
- self._fstart = -int((chirp_width/2)*(2**32)/32e6)
- self._fincr = int((chirp_width/16e6)*(2**32)/(self._ton_ticks+1))
-
- if self._verbose:
- print "Setting transmitter center frequency to", n2s(center_freq)
- print "Setting chirp width to", n2s(chirp_width), "Hz "+"("+hex(self._fstart)+", "+hex(self._fincr)+")"
-
- result = self._u.tune(0, self._subdev, center_freq)
- if result == False:
- raise RuntimeError("Failed to set transmitter frequency.")
- self._u._write_fpga_reg(FR_RADAR_FSTART, self._fstart)
- self._u._write_fpga_reg(FR_RADAR_FINCR, self._fincr)
-
- def start(self):
- self._u.start()
- self._subdev.set_enable(True)
-
- def stop(self):
- self._subdev.set_enable(False)
- self._u.stop()
-
- def subdev_spec(self):
- return self._subdev_spec
-
- def echo_length(self):
- return self._tlook_ticks+1
-
- def __del__(self):
- del self._subdev # Avoid weak reference error
-
-#-----------------------------------------------------------------------
-# Receiver object. Uses usrp_source_c to receive echo records.
-#-----------------------------------------------------------------------
-class radar_rx(gr.top_block):
- def __init__(self, options, callback):
- gr.top_block.__init__(self, "radar_rx")
-
- self._u = None
- self._subdev_spec = options.rx_subdev_spec
- self._gain = options.gain
- self._verbose = options.verbose
- self._debug = options.debug
- self._callback = callback
- self._length_set = False
- self._connected = False
- self._frequency = 0.0
- self._msgq = gr.msg_queue()
- self._watcher = _queue_watcher_thread(self._msgq, self._callback)
-
- def set_echo_length(self, length):
- # Only call once
- if self._length_set is True:
- raise RuntimeError("Can only set echo length once.")
- self._length = length
- self._length_set = True
-
- def tune(self, frequency):
- if self._verbose:
- print "Setting receiver frequency to", n2s(frequency)
- self._frequency = frequency
- if (self._u):
- result = self._u.tune(0, self._subdev, frequency)
- if result == False:
- raise RuntimeError("Failed to set receiver frequency.")
-
- def set_gain(self, gain):
- self._gain = gain
- if self._gain == None:
- # if no gain was specified, use the mid-point in dB
- g = self._subdev.gain_range()
- self._gain = float(g[0]+g[1])/2
- self._subdev.set_gain(self._gain)
-
- def begin(self):
- if not self._connected:
- self._setup_connections()
-
- if self._verbose:
- print "Starting receiver..."
- self.start()
-
- def end(self):
- if self._verbose:
- print "Stopping receiver..."
- self.stop()
- self.wait()
- if self._verbose:
- print "Receiver stopped."
-
- def _setup_usrp(self):
- self._u = usrp.source_c(fpga_filename='usrp_radar_mono.rbf')
- if self._subdev_spec == None:
- self._subdev_spec = usrp.pick_rx_subdevice(self._u)
- self._u.set_mux(usrp.determine_rx_mux_value(self._u, self._subdev_spec))
- self._subdev = usrp.selected_subdev(self._u, self._subdev_spec)
-
- if self._verbose:
- print "Using", self._subdev.side_and_name(), "for radar receiver."
- print "Setting receiver gain to", self._gain
- self.set_gain(self._gain)
- self.tune(self._frequency)
-
- def _setup_connections(self):
- if not self._length_set:
- raise RuntimeError("Echo length not set.")
- self._setup_usrp()
- self._vblen = gr.sizeof_gr_complex*self._length
- self._s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self._length)
- self._sink = gr.message_sink(self._vblen, self._msgq, False)
- self.connect(self._u, self._s2v, self._sink)
-
- if self._verbose:
- print "Generating echo vectors of length", self._length, \
- "(samples)", self._vblen, "(bytes)"
-
- self._connected = True
-
-class radar(object):
- def __init__(self, options, callback):
-
- self._verbose = options.verbose
- self._debug = options.debug
-
- self._mode = 0
- self._trans = radar_tx(options)
- self._rcvr = radar_rx(options, callback)
- self.set_reset(True)
- self.set_tx_board(self._trans.subdev_spec())
- self.set_debug(self._debug)
- self.set_atrdel()
-
- def _write_mode(self):
- self._trans._u._write_fpga_reg(FR_RADAR_MODE, self._mode)
-
- def set_reset(self, value):
- if value:
- self._mode |= bmFR_RADAR_MODE_RESET
- else:
- self._mode &= ~bmFR_RADAR_MODE_RESET
- self._write_mode()
-
- def set_tx_board(self, tx_subdev_spec):
- if tx_subdev_spec[0] == 1:
- self._mode |= bmFR_RADAR_TXSIDE
- else:
- self._mode &= ~bmFR_RADAR_TXSIDE
- self._write_mode()
-
- def set_debug(self, value):
- if value:
- self._mode |= bmFR_RADAR_DEBUG
- else:
- self._mode &= ~bmFR_RADAR_DEBUG
- self._write_mode()
-
- def set_ton(self, ton):
- self._trans.set_ton(ton)
-
- def set_tsw(self, tsw):
- self._trans.set_tsw(tsw)
-
- def set_tlook(self, tlook):
- self._trans.set_tlook(tlook)
- self._rcvr.set_echo_length(self._trans.echo_length())
-
- def set_prf(self, prf):
- self._trans.set_prf(prf)
-
- def set_amplitude(self, ampl):
- self._trans.set_amplitude(ampl)
-
- def set_freq(self, center_freq, chirp_width):
- self._trans.set_freq(center_freq, chirp_width)
- self._rcvr.tune(center_freq)
-
- def set_atrdel(self, tx_delay=txp_delay, rx_delay=rxp_delay):
- if self._verbose:
- print "Setting TX delay of", tx_delay, "clocks, RX delay of", rx_delay
- self._trans._u._write_fpga_reg(FR_RADAR_ATRDEL, tx_delay << 16 | rx_delay)
-
- def start(self):
- self.set_reset(False)
- self._trans.start()
- self._rcvr.begin()
-
- def stop(self):
- self._rcvr.end()
- self._trans.stop()
- self.set_reset(True)
-
-#-----------------------------------------------------------------------
-# Queue watcher. Dispatches received echos to callback.
-#-----------------------------------------------------------------------
-class _queue_watcher_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 == True:
- msg = self._msgq.delete_head()
- if self._callback:
- self._callback(msg.to_string())
-
diff --git a/gr-radar-mono/src/python/run_tests.in b/gr-radar-mono/src/python/run_tests.in
deleted file mode 100644
index 19b6b895c..000000000
--- a/gr-radar-mono/src/python/run_tests.in
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# 1st parameter is absolute path to component source directory
-# 2nd parameter is absolute path to component build directory
-# 3rd parameter is path to Python QA directory
-
-@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-sar-fe \
- @abs_top_builddir@/gr-sar-fe \
- @srcdir@
diff --git a/gr-radar-mono/src/python/usrp_radar_mono.py b/gr-radar-mono/src/python/usrp_radar_mono.py
deleted file mode 100755
index 3f2ad28e2..000000000
--- a/gr-radar-mono/src/python/usrp_radar_mono.py
+++ /dev/null
@@ -1,96 +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.
-#
-
-from gnuradio import gr
-from gnuradio.radar_mono import radar
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import sys, time
-
-n2s = eng_notation.num_to_str
-logfile = None
-
-def process_echo(echo):
- global logfile
- if logfile is not None:
- logfile.write(echo)
-
-def main():
- global logfile
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-T", "--tx-subdev-spec", type="subdev", default=None,
- help="use transmitter board side A or B (default is first found)")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="use receiver board side A or B (default is first found)")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-f", "--frequency", type="eng_float", default=0.0,
- help="set transmitter center frequency to FREQ in Hz, default is %default", metavar="FREQ")
- parser.add_option("-w", "--chirp-width", type="eng_float", default=32e6,
- help="set LFM chirp bandwidth in Hz, default is %default", metavar="FREQ")
- parser.add_option("-a", "--amplitude", type="eng_float", default=15,
- help="set waveform amplitude in % full scale, default is %default,")
- parser.add_option("", "--ton", type="eng_float", default=5e-6,
- help="set pulse on period in seconds, default is %default,")
- parser.add_option("", "--tsw", type="eng_float", default=0.0,
- help="set transmitter switching period in seconds, default is %default,")
- parser.add_option("", "--tlook", type="eng_float", default=5e-6,
- help="set receiver look time in seconds, default is %default,")
- parser.add_option("", "--prf", type="eng_float", default=100,
- help="set pulse repetition frequency in Hz, default is %default,")
- parser.add_option("-v", "--verbose", action="store_true", default=False,
- help="enable verbose output, default is disabled")
- parser.add_option("-D", "--debug", action="store_true", default=False,
- help="enable debugging output, default is disabled")
- parser.add_option("-F", "--filename", default=None,
- help="log received echos to file")
-
- (options, args) = parser.parse_args()
-
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- if options.filename is not None:
- if options.verbose:
- print "Logging echo records to file: ", options.filename
- logfile = open(options.filename, 'wb')
-
- r = radar(options, process_echo)
-
- r.set_ton(options.ton)
- r.set_tsw(options.tsw)
- r.set_tlook(options.tlook)
- r.set_prf(options.prf)
- r.set_amplitude(options.amplitude)
- r.set_freq(options.frequency, options.chirp_width)
-
- r.start()
- raw_input("Press ENTER to stop.")
- r.stop()
-
- if logfile is not None:
- logfile.close()
-
-if __name__ == "__main__":
- main()
diff --git a/gr-radar-mono/src/utils/calc_avg.m b/gr-radar-mono/src/utils/calc_avg.m
deleted file mode 100644
index b240d245e..000000000
--- a/gr-radar-mono/src/utils/calc_avg.m
+++ /dev/null
@@ -1,8 +0,0 @@
-function avg = calc_avg(rlen, mintime)
- avg = read_avg('echos.dat', rlen);
- x = 1:rlen;
- x = (x/64e6+mintime)*3e8/2;
- plot(x, abs(avg), "^;Amplitude;");
- xlabel("Range (meters)");
- axis([max(x) 0])
-endfunction
diff --git a/gr-radar-mono/src/utils/czpad.m b/gr-radar-mono/src/utils/czpad.m
deleted file mode 100644
index e2131030d..000000000
--- a/gr-radar-mono/src/utils/czpad.m
+++ /dev/null
@@ -1,8 +0,0 @@
-# Center and zero pad v to length n
-function pad = czpad(v, n)
- c = n/2;
- l = length(v);
- pad(c-l/2+1:c+l/2) = v;
- pad(c+l/2+1:n) = 0;
-endfunction
- \ No newline at end of file
diff --git a/gr-radar-mono/src/utils/echo_image.m b/gr-radar-mono/src/utils/echo_image.m
deleted file mode 100644
index 2e066aef5..000000000
--- a/gr-radar-mono/src/utils/echo_image.m
+++ /dev/null
@@ -1,6 +0,0 @@
-function echo_image(filename, data)
- d = abs(data);
- d = d-min(min(d));
- d = d/(max(max(d)))*255;
- pngwrite(filename, d, d, d, ones(size(d)));
-endfunction \ No newline at end of file
diff --git a/gr-radar-mono/src/utils/fftcorr.m b/gr-radar-mono/src/utils/fftcorr.m
deleted file mode 100644
index 548988973..000000000
--- a/gr-radar-mono/src/utils/fftcorr.m
+++ /dev/null
@@ -1,4 +0,0 @@
-# Perform circular correlation via FFT
-function corr = fftcorr(v,ref)
- corr = ifft(conj(fft(ref)).*fft(v));
-endfunction
diff --git a/gr-radar-mono/src/utils/pulse b/gr-radar-mono/src/utils/pulse
deleted file mode 100644
index 887558d1e..000000000
--- a/gr-radar-mono/src/utils/pulse
+++ /dev/null
@@ -1,396 +0,0 @@
-# Created by Octave 2.1.73, Tue Sep 25 14:17:22 2007 EDT <jcorgan@mobile>
-# name: __nargin__
-# type: scalar
-0
-# name: pulse321
-# type: complex matrix
-# rows: 64
-# columns: 1
- (-0.0003662109375,0.9998779296875)
- (-0.0003662109375,0.9998779296875)
- (0,-0.9996337890625)
- (0,-0.9996337890625)
- (-0.0010986328125,-0.961181640625)
- (-0.0010986328125,-0.961181640625)
- (0.0072021484375,0.882568359375)
- (0.0072021484375,0.882568359375)
- (-0.0279541015625,-0.7666015625)
- (-0.0279541015625,-0.7666015625)
- (0.0765380859375,0.616943359375)
- (0.0765380859375,0.616943359375)
- (-0.1688232421875,-0.4447021484375)
- (-0.1688232421875,-0.4447021484375)
- (0.3212890625,0.26611328125)
- (0.3212890625,0.26611328125)
- (-0.54638671875,-0.1092529296875)
- (-0.54638671875,-0.1092529296875)
- (0.843994140625,0.012451171875)
- (0.843994140625,0.012451171875)
- (0.8046875,-0.019775390625)
- (0.8046875,-0.019775390625)
- (-0.444580078125,0.1688232421875)
- (-0.444580078125,0.1688232421875)
- (0.147705078125,-0.477294921875)
- (0.147705078125,-0.477294921875)
- (-0.0032958984375,0.921142578125)
- (-0.0032958984375,0.921142578125)
- (0.09228515625,0.5811767578125)
- (0.09228515625,0.5811767578125)
- (-0.4447021484375,-0.1688232421875)
- (-0.4447021484375,-0.1688232421875)
- (0.9996337890625,0.000244140625)
- (0.9996337890625,0.000244140625)
- (0.4127197265625,-0.19140625)
- (0.4127197265625,-0.19140625)
- (-0.0379638671875,0.728759765625)
- (-0.0379638671875,0.728759765625)
- (0.09228515625,0.5811767578125)
- (0.09228515625,0.5811767578125)
- (-0.617919921875,-0.0762939453125)
- (-0.617919921875,-0.0762939453125)
- (-0.6170654296875,0.0765380859375)
- (-0.6170654296875,0.0765380859375)
- (0.0621337890625,-0.654296875)
- (0.0621337890625,-0.654296875)
- (-0.127685546875,-0.511962890625)
- (-0.127685546875,-0.511962890625)
- (0.843994140625,0.012451171875)
- (0.843994140625,0.012451171875)
- (0.29296875,-0.293212890625)
- (0.29296875,-0.293212890625)
- (-0.01953125,-0.8046875)
- (-0.01953125,-0.8046875)
- (0.654296875,0.0618896484375)
- (0.654296875,0.0618896484375)
- (0.3505859375,-0.239990234375)
- (0.3505859375,-0.239990234375)
- (-0.0279541015625,-0.7666015625)
- (-0.0279541015625,-0.7666015625)
- (0.805419921875,0.01953125)
- (0.805419921875,0.01953125)
- (0.1688232421875,-0.444580078125)
- (0.1688232421875,-0.444580078125)
-# name: pulse325
-# type: complex matrix
-# rows: 320
-# columns: 1
- (-0.0003662109375,0.9998779296875)
- (-0.0003662109375,0.9998779296875)
- (0,-0.9996337890625)
- (0,-0.9996337890625)
- (-0.0010986328125,-0.961181640625)
- (-0.0010986328125,-0.961181640625)
- (0.0072021484375,0.882568359375)
- (0.0072021484375,0.882568359375)
- (-0.0279541015625,-0.7666015625)
- (-0.0279541015625,-0.7666015625)
- (0.0765380859375,0.616943359375)
- (0.0765380859375,0.616943359375)
- (-0.1688232421875,-0.4447021484375)
- (-0.1688232421875,-0.4447021484375)
- (0.3212890625,0.26611328125)
- (0.3212890625,0.26611328125)
- (-0.54638671875,-0.1092529296875)
- (-0.54638671875,-0.1092529296875)
- (0.843994140625,0.012451171875)
- (0.843994140625,0.012451171875)
- (0.8046875,-0.019775390625)
- (0.8046875,-0.019775390625)
- (-0.444580078125,0.1688232421875)
- (-0.444580078125,0.1688232421875)
- (0.147705078125,-0.477294921875)
- (0.147705078125,-0.477294921875)
- (-0.0032958984375,0.921142578125)
- (-0.0032958984375,0.921142578125)
- (0.09228515625,0.5811767578125)
- (0.09228515625,0.5811767578125)
- (-0.4447021484375,-0.1688232421875)
- (-0.4447021484375,-0.1688232421875)
- (0.9996337890625,0.000244140625)
- (0.9996337890625,0.000244140625)
- (0.4127197265625,-0.19140625)
- (0.4127197265625,-0.19140625)
- (-0.0379638671875,0.728759765625)
- (-0.0379638671875,0.728759765625)
- (0.09228515625,0.5811767578125)
- (0.09228515625,0.5811767578125)
- (-0.617919921875,-0.0762939453125)
- (-0.617919921875,-0.0762939453125)
- (-0.6170654296875,0.0765380859375)
- (-0.6170654296875,0.0765380859375)
- (0.0621337890625,-0.654296875)
- (0.0621337890625,-0.654296875)
- (-0.127685546875,-0.511962890625)
- (-0.127685546875,-0.511962890625)
- (0.843994140625,0.012451171875)
- (0.843994140625,0.012451171875)
- (0.29296875,-0.293212890625)
- (0.29296875,-0.293212890625)
- (-0.01953125,-0.8046875)
- (-0.01953125,-0.8046875)
- (0.654296875,0.0618896484375)
- (0.654296875,0.0618896484375)
- (0.3505859375,-0.239990234375)
- (0.3505859375,-0.239990234375)
- (-0.0279541015625,-0.7666015625)
- (-0.0279541015625,-0.7666015625)
- (0.805419921875,0.01953125)
- (0.805419921875,0.01953125)
- (0.1688232421875,-0.444580078125)
- (0.1688232421875,-0.444580078125)
- (-0.1910400390625,-0.4127197265625)
- (-0.1910400390625,-0.4127197265625)
- (-0.6912841796875,0.049072265625)
- (-0.6912841796875,0.049072265625)
- (0.0009765625,0.9613037109375)
- (0.0009765625,0.9613037109375)
- (-0.8055419921875,-0.0194091796875)
- (-0.8055419921875,-0.0194091796875)
- (-0.076171875,0.6177978515625)
- (-0.076171875,0.6177978515625)
- (0.4771728515625,0.14794921875)
- (0.4771728515625,0.14794921875)
- (0.2144775390625,-0.3812255859375)
- (0.2144775390625,-0.3812255859375)
- (-0.3214111328125,-0.2659912109375)
- (-0.3214111328125,-0.2659912109375)
- (-0.29296875,0.293212890625)
- (-0.29296875,0.293212890625)
- (0.293212890625,0.29296875)
- (0.293212890625,0.29296875)
- (0.265869140625,-0.3212890625)
- (0.265869140625,-0.3212890625)
- (-0.3814697265625,-0.2144775390625)
- (-0.3814697265625,-0.2144775390625)
- (-0.1480712890625,0.4774169921875)
- (-0.1480712890625,0.4774169921875)
- (0.617919921875,0.0760498046875)
- (0.617919921875,0.0760498046875)
- (0.019287109375,-0.805419921875)
- (0.019287109375,-0.805419921875)
- (0.961181640625,-0.0009765625)
- (0.961181640625,-0.0009765625)
- (-0.049072265625,-0.6915283203125)
- (-0.049072265625,-0.6915283203125)
- (-0.412353515625,0.19091796875)
- (-0.412353515625,0.19091796875)
- (0.4444580078125,0.1689453125)
- (0.4444580078125,0.1689453125)
- (0.019287109375,-0.805419921875)
- (0.019287109375,-0.805419921875)
- (0.7664794921875,-0.02783203125)
- (0.7664794921875,-0.02783203125)
- (-0.2401123046875,-0.3507080078125)
- (-0.2401123046875,-0.3507080078125)
- (-0.06201171875,0.6541748046875)
- (-0.06201171875,0.6541748046875)
- (-0.804443359375,0.0194091796875)
- (-0.804443359375,0.0194091796875)
- (0.293212890625,0.29296875)
- (0.293212890625,0.29296875)
- (0.012451171875,-0.843994140625)
- (0.012451171875,-0.843994140625)
- (0.5118408203125,-0.127685546875)
- (0.5118408203125,-0.127685546875)
- (-0.6541748046875,-0.062255859375)
- (-0.6541748046875,-0.062255859375)
- (-0.07666015625,-0.6170654296875)
- (-0.07666015625,-0.6170654296875)
- (-0.076171875,0.6177978515625)
- (-0.076171875,0.6177978515625)
- (-0.581298828125,0.0921630859375)
- (-0.581298828125,0.0921630859375)
- (0.7286376953125,0.037841796875)
- (0.7286376953125,0.037841796875)
- (0.1912841796875,0.412353515625)
- (0.1912841796875,0.412353515625)
- (0,-0.9996337890625)
- (0,-0.9996337890625)
- (0.1688232421875,-0.444580078125)
- (0.1688232421875,-0.444580078125)
- (0.581298828125,-0.0924072265625)
- (0.581298828125,-0.0924072265625)
- (-0.9212646484375,-0.003662109375)
- (-0.9212646484375,-0.003662109375)
- (-0.4775390625,-0.1478271484375)
- (-0.4775390625,-0.1478271484375)
- (-0.1688232421875,-0.4447021484375)
- (-0.1688232421875,-0.4447021484375)
- (-0.01953125,-0.8046875)
- (-0.01953125,-0.8046875)
- (-0.012451171875,0.8438720703125)
- (-0.012451171875,0.8438720703125)
- (-0.109375,0.5462646484375)
- (-0.109375,0.5462646484375)
- (-0.26611328125,0.321533203125)
- (-0.26611328125,0.321533203125)
- (-0.444580078125,0.1688232421875)
- (-0.444580078125,0.1688232421875)
- (-0.6170654296875,0.0765380859375)
- (-0.6170654296875,0.0765380859375)
- (-0.7666015625,0.02783203125)
- (-0.7666015625,0.02783203125)
- (-0.882568359375,0.00732421875)
- (-0.882568359375,0.00732421875)
- (-0.9613037109375,0.0010986328125)
- (-0.9613037109375,0.0010986328125)
- (0.9996337890625,0.000244140625)
- (0.9996337890625,0.000244140625)
- (0.9996337890625,0.000244140625)
- (0.9996337890625,0.000244140625)
- (-0.9613037109375,0.0010986328125)
- (-0.9613037109375,0.0010986328125)
- (-0.882568359375,0.00732421875)
- (-0.882568359375,0.00732421875)
- (-0.7666015625,0.02783203125)
- (-0.7666015625,0.02783203125)
- (-0.6170654296875,0.0765380859375)
- (-0.6170654296875,0.0765380859375)
- (-0.444580078125,0.1688232421875)
- (-0.444580078125,0.1688232421875)
- (-0.26611328125,0.321533203125)
- (-0.26611328125,0.321533203125)
- (-0.109375,0.5462646484375)
- (-0.109375,0.5462646484375)
- (-0.012451171875,0.8438720703125)
- (-0.012451171875,0.8438720703125)
- (-0.01953125,-0.8046875)
- (-0.01953125,-0.8046875)
- (-0.1688232421875,-0.4447021484375)
- (-0.1688232421875,-0.4447021484375)
- (-0.4775390625,-0.1478271484375)
- (-0.4775390625,-0.1478271484375)
- (-0.9212646484375,-0.003662109375)
- (-0.9212646484375,-0.003662109375)
- (0.581298828125,-0.0924072265625)
- (0.581298828125,-0.0924072265625)
- (0.1688232421875,-0.444580078125)
- (0.1688232421875,-0.444580078125)
- (0,-0.9996337890625)
- (0,-0.9996337890625)
- (0.1912841796875,0.412353515625)
- (0.1912841796875,0.412353515625)
- (0.7286376953125,0.037841796875)
- (0.7286376953125,0.037841796875)
- (-0.581298828125,0.0921630859375)
- (-0.581298828125,0.0921630859375)
- (-0.076171875,0.6177978515625)
- (-0.076171875,0.6177978515625)
- (-0.07666015625,-0.6170654296875)
- (-0.07666015625,-0.6170654296875)
- (-0.6541748046875,-0.062255859375)
- (-0.6541748046875,-0.062255859375)
- (0.5118408203125,-0.127685546875)
- (0.5118408203125,-0.127685546875)
- (0.012451171875,-0.843994140625)
- (0.012451171875,-0.843994140625)
- (0.293212890625,0.29296875)
- (0.293212890625,0.29296875)
- (-0.804443359375,0.0194091796875)
- (-0.804443359375,0.0194091796875)
- (-0.06201171875,0.6541748046875)
- (-0.06201171875,0.6541748046875)
- (-0.2401123046875,-0.3507080078125)
- (-0.2401123046875,-0.3507080078125)
- (0.7664794921875,-0.02783203125)
- (0.7664794921875,-0.02783203125)
- (0.019287109375,-0.805419921875)
- (0.019287109375,-0.805419921875)
- (0.4444580078125,0.1689453125)
- (0.4444580078125,0.1689453125)
- (-0.412353515625,0.19091796875)
- (-0.412353515625,0.19091796875)
- (-0.049072265625,-0.6915283203125)
- (-0.049072265625,-0.6915283203125)
- (0.961181640625,-0.0009765625)
- (0.961181640625,-0.0009765625)
- (0.019287109375,-0.805419921875)
- (0.019287109375,-0.805419921875)
- (0.617919921875,0.0760498046875)
- (0.617919921875,0.0760498046875)
- (-0.1480712890625,0.4774169921875)
- (-0.1480712890625,0.4774169921875)
- (-0.3814697265625,-0.2144775390625)
- (-0.3814697265625,-0.2144775390625)
- (0.265869140625,-0.3212890625)
- (0.265869140625,-0.3212890625)
- (0.293212890625,0.29296875)
- (0.293212890625,0.29296875)
- (-0.29296875,0.293212890625)
- (-0.29296875,0.293212890625)
- (-0.3214111328125,-0.2659912109375)
- (-0.3214111328125,-0.2659912109375)
- (0.2144775390625,-0.3812255859375)
- (0.2144775390625,-0.3812255859375)
- (0.4771728515625,0.14794921875)
- (0.4771728515625,0.14794921875)
- (-0.076171875,0.6177978515625)
- (-0.076171875,0.6177978515625)
- (-0.8055419921875,-0.0194091796875)
- (-0.8055419921875,-0.0194091796875)
- (0.0009765625,0.9613037109375)
- (0.0009765625,0.9613037109375)
- (-0.6912841796875,0.049072265625)
- (-0.6912841796875,0.049072265625)
- (-0.1910400390625,-0.4127197265625)
- (-0.1910400390625,-0.4127197265625)
- (0.1688232421875,-0.444580078125)
- (0.1688232421875,-0.444580078125)
- (0.805419921875,0.01953125)
- (0.805419921875,0.01953125)
- (-0.0279541015625,-0.7666015625)
- (-0.0279541015625,-0.7666015625)
- (0.3505859375,-0.239990234375)
- (0.3505859375,-0.239990234375)
- (0.654296875,0.0618896484375)
- (0.654296875,0.0618896484375)
- (-0.01953125,-0.8046875)
- (-0.01953125,-0.8046875)
- (0.29296875,-0.293212890625)
- (0.29296875,-0.293212890625)
- (0.843994140625,0.012451171875)
- (0.843994140625,0.012451171875)
- (-0.127685546875,-0.511962890625)
- (-0.127685546875,-0.511962890625)
- (0.0621337890625,-0.654296875)
- (0.0621337890625,-0.654296875)
- (-0.6170654296875,0.0765380859375)
- (-0.6170654296875,0.0765380859375)
- (-0.617919921875,-0.0762939453125)
- (-0.617919921875,-0.0762939453125)
- (0.09228515625,0.5811767578125)
- (0.09228515625,0.5811767578125)
- (-0.0379638671875,0.728759765625)
- (-0.0379638671875,0.728759765625)
- (0.4127197265625,-0.19140625)
- (0.4127197265625,-0.19140625)
- (0.9996337890625,0.000244140625)
- (0.9996337890625,0.000244140625)
- (-0.4447021484375,-0.1688232421875)
- (-0.4447021484375,-0.1688232421875)
- (0.09228515625,0.5811767578125)
- (0.09228515625,0.5811767578125)
- (-0.0032958984375,0.921142578125)
- (-0.0032958984375,0.921142578125)
- (0.147705078125,-0.477294921875)
- (0.147705078125,-0.477294921875)
- (-0.444580078125,0.1688232421875)
- (-0.444580078125,0.1688232421875)
- (0.8046875,-0.019775390625)
- (0.8046875,-0.019775390625)
- (0.843994140625,0.012451171875)
- (0.843994140625,0.012451171875)
- (-0.54638671875,-0.1092529296875)
- (-0.54638671875,-0.1092529296875)
- (0.3212890625,0.26611328125)
- (0.3212890625,0.26611328125)
- (-0.1688232421875,-0.4447021484375)
- (-0.1688232421875,-0.4447021484375)
- (0.0765380859375,0.616943359375)
- (0.0765380859375,0.616943359375)
- (-0.0279541015625,-0.7666015625)
- (-0.0279541015625,-0.7666015625)
- (0.0072021484375,0.882568359375)
- (0.0072021484375,0.882568359375)
- (-0.0010986328125,-0.961181640625)
- (-0.0010986328125,-0.961181640625)
diff --git a/gr-radar-mono/src/utils/read_avg.m b/gr-radar-mono/src/utils/read_avg.m
deleted file mode 100644
index 7df3d4cdd..000000000
--- a/gr-radar-mono/src/utils/read_avg.m
+++ /dev/null
@@ -1,22 +0,0 @@
-function avg = read_avg(name, vlen)
-
- f = fopen(name, "rb");
- s = zeros(1, vlen);
- n = 0;
-
- while (!feof(f))
- t = fread(f, [2, vlen], "float");
- if (size(t) == [2, vlen])
- n = n+1;
- c = t(1,:)+t(2,:)*j;
- if (n > 10)
- s = s+c;
- endif
- endif
- endwhile
-
- avg = s/(n-1);
-
- fclose(f);
-
-endfunction
diff --git a/gr-radar-mono/src/utils/read_avg_sec.m b/gr-radar-mono/src/utils/read_avg_sec.m
deleted file mode 100644
index 7aa77675d..000000000
--- a/gr-radar-mono/src/utils/read_avg_sec.m
+++ /dev/null
@@ -1,25 +0,0 @@
-function avg = read_avg_sec(name, vlen)
-
- f = fopen(name, "rb");
- s = zeros(1, vlen);
- n = 0;
- m = 0;
-
- while (!feof(f))
- t = fread(f, [2, vlen], "float");
- if (size(t) == [2, vlen])
- n = n+1;
- c = t(1,:)+t(2,:)*j;
- s = s+c;
- m = m+1;
- if (m == 1000)
- avg(n/1000,:) = s/1000;
- s = zeros(1, vlen);
- m = 0;
- endif
- endif
- endwhile
-
- fclose(f);
-
-endfunction
diff --git a/gr-radar-mono/src/utils/read_echos.m b/gr-radar-mono/src/utils/read_echos.m
deleted file mode 100644
index 3fae47b4e..000000000
--- a/gr-radar-mono/src/utils/read_echos.m
+++ /dev/null
@@ -1,7 +0,0 @@
-# Read echos from file into array
-function echos = read_echos(filename, len, drop)
- e = read_complex_binary(filename);
- n = length(e)/len-drop;
- start = drop*len+1;
- echos = reshape(e(start:end), len, n).';
-endfunction
diff --git a/gr-radio-astronomy/src/lib/Makefile.swig.gen b/gr-radio-astronomy/src/lib/Makefile.swig.gen
index d560e3919..faad880cf 100644
--- a/gr-radio-astronomy/src/lib/Makefile.swig.gen
+++ b/gr-radio-astronomy/src/lib/Makefile.swig.gen
@@ -105,7 +105,7 @@ _ra_la_CXXFLAGS = \
$(ra_la_swig_cxxflags)
python/ra.cc: ra.py
-ra.py: ra.i
+ra.py: ra.i
# Include the python dependencies for this file
-include python/ra.d
diff --git a/gr-sounder/.gitignore b/gr-sounder/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-sounder/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-sounder/Makefile.am b/gr-sounder/Makefile.am
deleted file mode 100644
index 40b11dcea..000000000
--- a/gr-sounder/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = src doc
diff --git a/gr-sounder/README b/gr-sounder/README
deleted file mode 100644
index 3c5df21d4..000000000
--- a/gr-sounder/README
+++ /dev/null
@@ -1,91 +0,0 @@
-This is a work-in-progress implementation of a m-sequence based channel
-sounder for GNU Radio and the USRP.
-
-In typical use, the user would run the sounder as a transmitter on one
-USRP, and a receiver on another at a different location. The receiver
-will determine the impulse response of the RF channel in between.
-
-The sounder uses a custom FPGA bitstream that is able to generate and
-receive a sounder waveform across a full 32 MHz wide swath of RF spectrum;
-the waveform generation and impulse response processing occur in logic in
-the USRP FPGA and not in the host PC. This avoids the USB throughput
-bottleneck entirely. Unfortunately, there is still roll-off in the AD9862
-digital up-converter interpolation filter that impacts the outer 20% of
-bandwidth, but this can be compensated for by measuring and subtracting
-out this response during calibration.
-
-The sounder is based on sending a maximal-length PN code modulated as BPSK
-with the supplied center frequency, with a chip-rate of 32 MHz. The
-receiver correlates the received signal across all phases of the PN code
-and outputs an impulse response vector. As auto-correlation of an m-sequence
-is near zero for any relative phase shift, the actual measured energy at a
-particular phase shift is related to the impulse response for that time delay.
-This is the same principle used in spread-spectrum RAKE receivers such as are
-used with GPS and CDMA.
-
-The transmitter is designed to work only with the board in side A. The
-receiver may be in side A or side B. The boards may be standalone LFTX/LFRXs
-or RFX daughterboards.
-
-To use, the following script is installed into $prefix/bin:
-
-Usage: usrp_sounder.py [options]
-
-Options:
- -h, --help show this help message and exit
- -R RX_SUBDEV_SPEC, --rx-subdev-spec=RX_SUBDEV_SPEC
- select USRP Rx side A or B
- -f FREQ, --frequency=FREQ
- set frequency to FREQ in Hz, default is 0.0
- -d DEGREE, --degree=DEGREE
- set sounding sequence degree (2-12), default is 12,
- -t, --transmit enable sounding transmitter
- -r, --receive enable sounding receiver
- -l, --loopback enable digital loopback, default is disabled
- -v, --verbose enable verbose output, default is disabled
- -D, --debug enable debugging output, default is disabled
- -F FILENAME, --filename=FILENAME
- log received impulse responses to file
-
-To use with an LFTX board, set the center frequency to 16M:
-
-$ usrp_sounder.py -f 16M -t
-
-The sounder receiver command line is:
-
-$ usrp_sounder.py -f 16M -r -F output.dat
-
-You can vary the m-sequence degree between 2 and 12, which will create
-sequence lengths between 3 and 4095 (128 us). This will affect
-how frequently the receiver can calculate impulse response vectors.
-
-The correlator uses an O(N^2) algorithm, by using an entire PN period
-of the received signal to correlate at each lag value. Thus, using a
-degree 12 PN code of length 4095, it takes 4095*4095/32e6 seconds to
-calculate a single impulse response vector, about a half a second. One
-can reduce this time by a factor of 4 for each decrement in PN code
-degree, but this also reduces the inherent processing gain by 6 dB as
-well.
-
-The impulse response vectors are written to a file in complex float
-format, and consist of the actual impulse response with a noise floor
-dependent on the PN code degree in use.
-
-There is a loopback test mode that causes the sounding waveform to be
-routed back to the receiver inside the USRP:
-
-$ usrp_sounder.py -r -t -l -F output.dat
-
-The resulting impulse response will be a spike followed by a near zero
-value for the rest of the period.
-
-Synchronization at the receiver is not yet implemented, so the actual
-impulse response may be time shifted an arbitrary value within the the
-impulse response vector. If one assumes the first to arrive signal is
-the strongest, then one can circularly rotate the vector until the peak
-is at time zero.
-
-Johnathan Corgan
-Corgan Enterprises LLC
-jcorgan@corganenterprises.com
-5/28/07
diff --git a/gr-sounder/doc/.gitignore b/gr-sounder/doc/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-sounder/doc/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-sounder/src/.gitignore b/gr-sounder/src/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-sounder/src/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-sounder/src/fpga/.gitignore b/gr-sounder/src/fpga/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-sounder/src/fpga/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-sounder/src/fpga/Makefile.am b/gr-sounder/src/fpga/Makefile.am
deleted file mode 100644
index 85256cb5e..000000000
--- a/gr-sounder/src/fpga/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# 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.
-#
-
-include $(top_srcdir)/Makefile.common
-
-SUBDIRS = top lib tb
diff --git a/gr-sounder/src/fpga/lib/.gitignore b/gr-sounder/src/fpga/lib/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-sounder/src/fpga/lib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-sounder/src/fpga/lib/Makefile.am b/gr-sounder/src/fpga/lib/Makefile.am
deleted file mode 100644
index a9586ebcc..000000000
--- a/gr-sounder/src/fpga/lib/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2007,2009,2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- dac_interface.v \
- dacpll.v \
- sounder.v \
- sounder_ctrl.v \
- sounder_rx.v \
- sounder_tx.v
diff --git a/gr-sounder/src/fpga/lib/dac_interface.v b/gr-sounder/src/fpga/lib/dac_interface.v
deleted file mode 100644
index 93c72cca6..000000000
--- a/gr-sounder/src/fpga/lib/dac_interface.v
+++ /dev/null
@@ -1,60 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../top/config.vh"
-
-module dac_interface(clk_i,rst_i,ena_i,strobe_i,tx_i_i,tx_q_i,tx_data_o,tx_sync_o);
- input clk_i;
- input rst_i;
- input ena_i;
- input strobe_i;
-
- input [13:0] tx_i_i;
- input [13:0] tx_q_i;
-
- output [13:0] tx_data_o;
- output tx_sync_o;
-
-`ifdef TX_RATE_MAX
- wire clk128;
- reg clk64_d;
- reg [13:0] tx_data_o;
-
- // Create a 128 MHz clock
- dacpll pll128(.areset(rst_i),.inclk0(clk_i),.c0(clk128));
-
- // Register the clk64 clock in the clk128 domain
- always @(posedge clk128)
- clk64_d <= #1 clk_i;
-
- // Register the tx data in the clk128 domain
- always @(posedge clk128)
- tx_data_o <= #1 clk64_d ? tx_i_i : tx_q_i;
-
- assign tx_sync_o = clk64_d;
-
-
-`else // !`ifdef TX_RATE_MAX
- assign tx_data_o = strobe_i ? tx_q_i : tx_i_i;
- assign tx_sync_o = strobe_i;
-`endif // !`ifdef TX_RATE_MAX
-
-endmodule // dac_interface
diff --git a/gr-sounder/src/fpga/lib/dacpll.v b/gr-sounder/src/fpga/lib/dacpll.v
deleted file mode 100644
index 25f584f4f..000000000
--- a/gr-sounder/src/fpga/lib/dacpll.v
+++ /dev/null
@@ -1,291 +0,0 @@
-// megafunction wizard: %ALTPLL%
-// GENERATION: STANDARD
-// VERSION: WM1.0
-// MODULE: altpll
-
-// ============================================================
-// File Name: dacpll.v
-// Megafunction Name(s):
-// altpll
-//
-// Simulation Library Files(s):
-// altera_mf
-// ============================================================
-// ************************************************************
-// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
-//
-// 7.0 Build 33 02/05/2007 SJ Web Edition
-// ************************************************************
-
-
-//Copyright (C) 1991-2007 Altera Corporation
-//Your use of Altera Corporation's design tools, logic functions
-//and other software and tools, and its AMPP partner logic
-//functions, and any output files from any of the foregoing
-//(including device programming or simulation files), and any
-//associated documentation or information are expressly subject
-//to the terms and conditions of the Altera Program License
-//Subscription Agreement, Altera MegaCore Function License
-//Agreement, or other applicable license agreement, including,
-//without limitation, that your use is for the sole purpose of
-//programming logic devices manufactured by Altera and sold by
-//Altera or its authorized distributors. Please refer to the
-//applicable agreement for further details.
-
-
-// synopsys translate_off
-`timescale 1 ps / 1 ps
-// synopsys translate_on
-module dacpll (
- areset,
- inclk0,
- c0);
-
- input areset;
- input inclk0;
- output c0;
-
- wire [5:0] sub_wire0;
- wire [0:0] sub_wire4 = 1'h0;
- wire [0:0] sub_wire1 = sub_wire0[0:0];
- wire c0 = sub_wire1;
- wire sub_wire2 = inclk0;
- wire [1:0] sub_wire3 = {sub_wire4, sub_wire2};
-
- altpll altpll_component (
- .inclk (sub_wire3),
- .areset (areset),
- .clk (sub_wire0),
- .activeclock (),
- .clkbad (),
- .clkena ({6{1'b1}}),
- .clkloss (),
- .clkswitch (1'b0),
- .configupdate (1'b1),
- .enable0 (),
- .enable1 (),
- .extclk (),
- .extclkena ({4{1'b1}}),
- .fbin (1'b1),
- .fbout (),
- .locked (),
- .pfdena (1'b1),
- .phasecounterselect ({4{1'b1}}),
- .phasedone (),
- .phasestep (1'b1),
- .phaseupdown (1'b1),
- .pllena (1'b1),
- .scanaclr (1'b0),
- .scanclk (1'b0),
- .scanclkena (1'b1),
- .scandata (1'b0),
- .scandataout (),
- .scandone (),
- .scanread (1'b0),
- .scanwrite (1'b0),
- .sclkout0 (),
- .sclkout1 (),
- .vcooverrange (),
- .vcounderrange ());
- defparam
- altpll_component.clk0_divide_by = 1,
- altpll_component.clk0_duty_cycle = 50,
- altpll_component.clk0_multiply_by = 2,
- altpll_component.clk0_phase_shift = "0000",
- altpll_component.compensate_clock = "CLK0",
- altpll_component.inclk0_input_frequency = 15625,
- altpll_component.intended_device_family = "Cyclone",
- altpll_component.lpm_type = "altpll",
- altpll_component.operation_mode = "NORMAL",
- altpll_component.pll_type = "AUTO",
- altpll_component.port_activeclock = "PORT_UNUSED",
- altpll_component.port_areset = "PORT_USED",
- altpll_component.port_clkbad0 = "PORT_UNUSED",
- altpll_component.port_clkbad1 = "PORT_UNUSED",
- altpll_component.port_clkloss = "PORT_UNUSED",
- altpll_component.port_clkswitch = "PORT_UNUSED",
- altpll_component.port_configupdate = "PORT_UNUSED",
- altpll_component.port_fbin = "PORT_UNUSED",
- altpll_component.port_inclk0 = "PORT_USED",
- altpll_component.port_inclk1 = "PORT_UNUSED",
- altpll_component.port_locked = "PORT_UNUSED",
- altpll_component.port_pfdena = "PORT_UNUSED",
- altpll_component.port_phasecounterselect = "PORT_UNUSED",
- altpll_component.port_phasedone = "PORT_UNUSED",
- altpll_component.port_phasestep = "PORT_UNUSED",
- altpll_component.port_phaseupdown = "PORT_UNUSED",
- altpll_component.port_pllena = "PORT_UNUSED",
- altpll_component.port_scanaclr = "PORT_UNUSED",
- altpll_component.port_scanclk = "PORT_UNUSED",
- altpll_component.port_scanclkena = "PORT_UNUSED",
- altpll_component.port_scandata = "PORT_UNUSED",
- altpll_component.port_scandataout = "PORT_UNUSED",
- altpll_component.port_scandone = "PORT_UNUSED",
- altpll_component.port_scanread = "PORT_UNUSED",
- altpll_component.port_scanwrite = "PORT_UNUSED",
- altpll_component.port_clk0 = "PORT_USED",
- altpll_component.port_clk1 = "PORT_UNUSED",
- altpll_component.port_clk3 = "PORT_UNUSED",
- altpll_component.port_clk4 = "PORT_UNUSED",
- altpll_component.port_clk5 = "PORT_UNUSED",
- altpll_component.port_clkena0 = "PORT_UNUSED",
- altpll_component.port_clkena1 = "PORT_UNUSED",
- altpll_component.port_clkena3 = "PORT_UNUSED",
- altpll_component.port_clkena4 = "PORT_UNUSED",
- altpll_component.port_clkena5 = "PORT_UNUSED",
- altpll_component.port_extclk0 = "PORT_UNUSED",
- altpll_component.port_extclk1 = "PORT_UNUSED",
- altpll_component.port_extclk2 = "PORT_UNUSED",
- altpll_component.port_extclk3 = "PORT_UNUSED";
-
-
-endmodule
-
-// ============================================================
-// CNX file retrieval info
-// ============================================================
-// Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
-// Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
-// Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
-// Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
-// Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
-// Retrieval info: PRIVATE: BANDWIDTH_USE_CUSTOM STRING "0"
-// Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
-// Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
-// Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
-// Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
-// Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
-// Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
-// Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
-// Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
-// Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "e0"
-// Retrieval info: PRIVATE: DEVICE_FAMILY NUMERIC "11"
-// Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "8"
-// Retrieval info: PRIVATE: DEV_FAMILY STRING "Cyclone"
-// Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "1"
-// Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
-// Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
-// Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
-// Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
-// Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
-// Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
-// Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "64.000"
-// Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
-// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
-// Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
-// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
-// Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
-// Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
-// Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "0"
-// Retrieval info: PRIVATE: LOCK_LOSS_SWITCHOVER_CHECK STRING "0"
-// Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
-// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "512.000"
-// Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
-// Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
-// Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
-// Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "2"
-// Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
-// Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "100.00000000"
-// Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
-// Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
-// Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
-// Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
-// Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "ns"
-// Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
-// Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
-// Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
-// Retrieval info: PRIVATE: PLL_ENA_CHECK STRING "0"
-// Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
-// Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
-// Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
-// Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
-// Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
-// Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
-// Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
-// Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
-// Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
-// Retrieval info: PRIVATE: SPREAD_USE STRING "0"
-// Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
-// Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
-// Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
-// Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "0"
-// Retrieval info: PRIVATE: USE_CLK0 STRING "1"
-// Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
-// Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
-// Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-// Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "1"
-// Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
-// Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "2"
-// Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
-// Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
-// Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "15625"
-// Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone"
-// Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
-// Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
-// Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
-// Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED"
-// Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
-// Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
-// Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
-// Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
-// Retrieval info: USED_PORT: @clk 0 0 6 0 OUTPUT_CLK_EXT VCC "@clk[5..0]"
-// Retrieval info: USED_PORT: @extclk 0 0 4 0 OUTPUT_CLK_EXT VCC "@extclk[3..0]"
-// Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
-// Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
-// Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
-// Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
-// Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
-// Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
-// Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.v TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.ppf TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.inc FALSE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.cmp FALSE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll.bsf TRUE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_inst.v TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_bb.v TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_waveforms.html TRUE FALSE
-// Retrieval info: GEN_FILE: TYPE_NORMAL dacpll_wave*.jpg FALSE FALSE
-// Retrieval info: LIB_FILE: altera_mf
diff --git a/gr-sounder/src/fpga/lib/lfsr.v b/gr-sounder/src/fpga/lib/lfsr.v
deleted file mode 100644
index bd0743e9c..000000000
--- a/gr-sounder/src/fpga/lib/lfsr.v
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module lfsr(clk_i,rst_i,ena_i,strobe_i,mask_i,pn_o);
- parameter width = 16;
-
- input clk_i;
- input rst_i;
- input ena_i;
- input strobe_i;
- input [width-1:0] mask_i;
-
- output pn_o;
-
- reg [width-1:0] shifter;
-
- wire parity = ^(shifter & mask_i);
-
- always @(posedge clk_i)
- if (rst_i | ~ena_i)
- shifter <= #5 1;
- else
- if (strobe_i)
- shifter <= #5 {shifter[width-2:0],parity};
-
- assign pn_o = shifter[0];
-
-endmodule // lfsr
diff --git a/gr-sounder/src/fpga/lib/lfsr_constants.v b/gr-sounder/src/fpga/lib/lfsr_constants.v
deleted file mode 100644
index e23ed6601..000000000
--- a/gr-sounder/src/fpga/lib/lfsr_constants.v
+++ /dev/null
@@ -1,63 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module lfsr_constants(clk_i,rst_i,degree_i,mask_o,len_o);
- input clk_i;
- input rst_i;
- input [4:0] degree_i;
- output reg [15:0] mask_o;
- output reg [16:0] len_o;
-
- integer len;
-
- always @(posedge clk_i)
- if (rst_i)
- begin
- len_o <= #5 17'b0;
- mask_o <= #5 16'b0;
- end
- else
- begin
- len_o <= #5 ((1 << degree_i) << 1)-3;
-
- case (degree_i)
- 5'd00: mask_o <= #5 16'h0000;
- 5'd01: mask_o <= #5 16'h0001;
- 5'd02: mask_o <= #5 16'h0003;
- 5'd03: mask_o <= #5 16'h0005;
- 5'd04: mask_o <= #5 16'h0009;
- 5'd05: mask_o <= #5 16'h0012;
- 5'd06: mask_o <= #5 16'h0021;
- 5'd07: mask_o <= #5 16'h0041;
- 5'd08: mask_o <= #5 16'h008E;
- 5'd09: mask_o <= #5 16'h0108;
- 5'd10: mask_o <= #5 16'h0204;
- 5'd11: mask_o <= #5 16'h0402;
- 5'd12: mask_o <= #5 16'h0829;
- 5'd13: mask_o <= #5 16'h100D;
- 5'd14: mask_o <= #5 16'h2015;
- 5'd15: mask_o <= #5 16'h4001;
- 5'd16: mask_o <= #5 16'h8016;
- default: mask_o <= #5 16'h0000;
- endcase // case(degree_i)
- end // else: !if(rst_i)
-
-endmodule // lfsr_constants
diff --git a/gr-sounder/src/fpga/lib/sounder.v b/gr-sounder/src/fpga/lib/sounder.v
deleted file mode 100644
index 675be8881..000000000
--- a/gr-sounder/src/fpga/lib/sounder.v
+++ /dev/null
@@ -1,90 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module sounder(clk_i, saddr_i, sdata_i, s_strobe_i,
- tx_strobe_o, tx_dac_i_o, tx_dac_q_o,
- rx_adc_i_i,rx_adc_q_i,
- rx_strobe_o, rx_imp_i_o,rx_imp_q_o);
-
- // System interface
- input clk_i; // Master clock @ 64 MHz
- input [6:0] saddr_i; // Configuration bus address
- input [31:0] sdata_i; // Configuration bus data
- input s_strobe_i; // Configuration bus write
-
- // Transmit subsystem
- output tx_strobe_o; // Generate an transmitter output sample
- output [13:0] tx_dac_i_o; // I channel transmitter output to DAC
- output [13:0] tx_dac_q_o; // Q channel transmitter output to DAC
-
- // Receive subsystem
- output rx_strobe_o; // Indicates output samples ready for Rx FIFO
- input [15:0] rx_adc_i_i; // I channel input from ADC interface module
- input [15:0] rx_adc_q_i; // Q channel input from ADC interface module
- output [15:0] rx_imp_i_o; // I channel impulse response to Rx FIFO
- output [15:0] rx_imp_q_o; // Q channel impulse response to Rx FIFO
-
- // Internal variables
- wire reset;
- wire transmit;
- wire receive;
- wire loopback;
-
- wire [4:0] degree;
- wire [13:0] ampl;
- wire [15:0] mask;
-
- wire ref_strobe;
- wire sum_strobe;
- sounder_ctrl master(.clk_i(clk_i),.rst_i(reset),.saddr_i(saddr_i),
- .sdata_i(sdata_i),.s_strobe_i(s_strobe_i),
- .reset_o(reset),.transmit_o(transmit),.receive_o(receive),.loopback_o(loopback),
- .degree_o(degree),.ampl_o(ampl),.mask_o(mask),.tx_strobe_o(tx_strobe_o),
- .rx_strobe_o(rx_strobe_o),.sum_strobe_o(sum_strobe),.ref_strobe_o(ref_strobe));
-
- // Loopback implementation
- wire [13:0] tx_i, tx_q;
- wire [15:0] tx_i_ext, tx_q_ext;
- wire [15:0] rx_i, rx_q;
-
- sign_extend #(14,16) tx_i_extender(tx_i, tx_i_ext);
- sign_extend #(14,16) tx_q_extender(tx_q, tx_q_ext);
-
- assign tx_dac_i_o = loopback ? 14'b0 : tx_i;
- assign tx_dac_q_o = loopback ? 14'b0 : tx_q;
- assign rx_i = loopback ? tx_i_ext : rx_adc_i_i;
- assign rx_q = loopback ? tx_q_ext : rx_adc_q_i;
-
- sounder_tx transmitter
- ( .clk_i(clk_i),.rst_i(reset),.ena_i(transmit),
- .strobe_i(tx_strobe_o),.mask_i(mask),.ampl_i(ampl),
- .tx_i_o(tx_i),.tx_q_o(tx_q) );
-
- sounder_rx receiver
- ( .clk_i(clk_i),.rst_i(reset),.ena_i(receive),
- .sum_strobe_i(sum_strobe),.ref_strobe_i(ref_strobe),
- .mask_i(mask),.degree_i(degree),
- .rx_in_i_i(rx_i),.rx_in_q_i(rx_q),.rx_i_o(rx_imp_i_o),.rx_q_o(rx_imp_q_o));
-
-endmodule // sounder
diff --git a/gr-sounder/src/fpga/lib/sounder_ctrl.v b/gr-sounder/src/fpga/lib/sounder_ctrl.v
deleted file mode 100644
index 6e967a5ba..000000000
--- a/gr-sounder/src/fpga/lib/sounder_ctrl.v
+++ /dev/null
@@ -1,97 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module sounder_ctrl(clk_i,rst_i,saddr_i,sdata_i,s_strobe_i,
- reset_o,transmit_o,receive_o,loopback_o,
- degree_o,ampl_o,mask_o,
- tx_strobe_o,rx_strobe_o,sum_strobe_o,ref_strobe_o);
-
- input clk_i; // Master clock @ 64 MHz
- input rst_i; // Master synchronous reset
- input [6:0] saddr_i; // Configuration bus address
- input [31:0] sdata_i; // Configuration bus data
- input s_strobe_i; // Configuration bus write
- output reset_o;
- output transmit_o;
- output receive_o;
- output loopback_o;
- output [4:0] degree_o;
- output [13:0] ampl_o;
- output [15:0] mask_o;
- output tx_strobe_o;
- output rx_strobe_o;
- output sum_strobe_o;
- output ref_strobe_o;
-
- setting_reg #(`FR_USER_0) sr_mode
- ( .clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out({loopback_o,receive_o,transmit_o,reset_o}) );
-
- setting_reg #(`FR_USER_1) sr_lfsr_degree
- ( .clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(degree_o) );
-
- setting_reg #(`FR_USER_2) sr_lfsr_ampl
- ( .clock(clk_i),.reset(1'b0),.strobe(s_strobe_i),.addr(saddr_i),.in(sdata_i),
- .out(ampl_o) );
-
- wire [16:0] len;
- lfsr_constants constants
- (.clk_i(clk_i),.rst_i(rst_i),.degree_i(degree_o),.mask_o(mask_o),
- .len_o(len) );
-
- reg [15:0] phase;
- assign tx_strobe_o = ~phase[0];
- assign ref_strobe_o = tx_strobe_o & !(phase>>1 == len>>1);
- assign sum_strobe_o = (phase == len);
-
- reg rx_strobe_o;
- always @(posedge clk_i)
- if (rst_i)
- begin
- phase <= #5 16'hFFFF;
- rx_strobe_o <= #5 0;
- end
- else
- if (sum_strobe_o)
- begin
- phase <= #5 0;
- rx_strobe_o <= #5 1'b1;
- end
- else
- begin
- phase <= #5 phase + 16'b1;
- rx_strobe_o <= #5 0;
- end
-
-
-
-
-
-
-
-
-
-
-endmodule // sounder_ctrl
diff --git a/gr-sounder/src/fpga/lib/sounder_rx.v b/gr-sounder/src/fpga/lib/sounder_rx.v
deleted file mode 100644
index 18038a3a1..000000000
--- a/gr-sounder/src/fpga/lib/sounder_rx.v
+++ /dev/null
@@ -1,83 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-module sounder_rx(clk_i,rst_i,ena_i,sum_strobe_i,ref_strobe_i,
- mask_i,degree_i,rx_in_i_i,rx_in_q_i,rx_i_o,rx_q_o);
-
- input clk_i; // Master clock
- input rst_i; // Subsystem reset
- input ena_i; // Subsystem enable
- input sum_strobe_i; // Strobe on last sample per period
- input ref_strobe_i; // PN code reference retarded one sample per period
-
- input [15:0] mask_i; // PN code LFSR mask
- input [4:0] degree_i; // PN code LFSR sequency degree
-
- input [15:0] rx_in_i_i; // I channel on receive
- input [15:0] rx_in_q_i; // Q channel on receive
-
- output [15:0] rx_i_o; // I channel of impulse response
- output [15:0] rx_q_o; // Q channel of impulse response
-
- reg [31:0] sum_i, sum_q;
- reg [31:0] total_i, total_q;
- wire [31:0] i_ext, q_ext;
-
- sign_extend #(16,32) i_extender(rx_in_i_i, i_ext);
- sign_extend #(16,32) q_extender(rx_in_q_i, q_ext);
-
- wire pn_ref;
- lfsr ref_code
- ( .clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(ref_strobe_i),.mask_i(mask_i),.pn_o(pn_ref) );
-
- wire [31:0] prod_i = pn_ref ? i_ext : -i_ext;
- wire [31:0] prod_q = pn_ref ? q_ext : -q_ext;
-
- always @(posedge clk_i)
- if (rst_i | ~ena_i)
- begin
- sum_i <= #5 0;
- sum_q <= #5 0;
- total_i <= #5 0;
- total_q <= #5 0;
- end
- else
- if (sum_strobe_i)
- begin
- total_i <= #5 sum_i;
- total_q <= #5 sum_q;
- sum_i <= #5 prod_i;
- sum_q <= #5 prod_q;
- end
- else
- begin
- sum_i <= #5 sum_i + prod_i;
- sum_q <= #5 sum_q + prod_q;
- end
-
- wire [5:0] offset = (5'd16-degree_i);
- wire [31:0] scaled_i = total_i << offset;
- wire [31:0] scaled_q = total_q << offset;
- assign rx_i_o = scaled_i[31:16];
- assign rx_q_o = scaled_q[31:16];
-
-endmodule // sounder_rx
-
diff --git a/gr-sounder/src/fpga/lib/sounder_tx.v b/gr-sounder/src/fpga/lib/sounder_tx.v
deleted file mode 100644
index 148b1e500..000000000
--- a/gr-sounder/src/fpga/lib/sounder_tx.v
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`include "../../../../usrp/firmware/include/fpga_regs_common.v"
-`include "../../../../usrp/firmware/include/fpga_regs_standard.v"
-
-module sounder_tx(clk_i,rst_i,ena_i,strobe_i,ampl_i,mask_i,tx_i_o,tx_q_o);
- input clk_i;
- input rst_i;
- input ena_i;
- input strobe_i;
- input [13:0] ampl_i;
- input [15:0] mask_i;
- output [13:0] tx_i_o;
- output [13:0] tx_q_o;
-
- wire pn;
- wire [13:0] min_value = (~ampl_i)+14'b1;
-
- lfsr pn_code
- ( .clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(strobe_i),.mask_i(mask_i),.pn_o(pn) );
-
- assign tx_i_o = ena_i ? (pn ? ampl_i : min_value) : 14'b0; // Bipolar
- assign tx_q_o = 14'b0;
-
-endmodule // sounder_tx
diff --git a/gr-sounder/src/fpga/tb/.gitignore b/gr-sounder/src/fpga/tb/.gitignore
deleted file mode 100644
index b05ab62aa..000000000
--- a/gr-sounder/src/fpga/tb/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/Makefile
-/Makefile.in
-/*.vcd
-/sounder_tb
-/*.out*
diff --git a/gr-sounder/src/fpga/tb/Makefile.am b/gr-sounder/src/fpga/tb/Makefile.am
deleted file mode 100644
index b21cb5f96..000000000
--- a/gr-sounder/src/fpga/tb/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Copyright 2007,2009,2010 Free Software Foundation, Inc.
-#
-# This file is part of GNU Radio
-#
-# GNU Radio is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# GNU Radio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Radio; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 51 Franklin Street,
-# Boston, MA 02110-1301, USA.
-#
-
-include $(top_srcdir)/Makefile.common
-
-EXTRA_DIST += \
- sounder_tb.v \
- sounder_tb.sav \
- sounder_tb.sh \
- sounder_tb_wave.sh
-
-MOSTLYCLEANFILES += *.vcd *.out* sounder_tb
diff --git a/gr-sounder/src/fpga/tb/sounder_tb.sav b/gr-sounder/src/fpga/tb/sounder_tb.sav
deleted file mode 100644
index 25bc512bc..000000000
--- a/gr-sounder/src/fpga/tb/sounder_tb.sav
+++ /dev/null
@@ -1,57 +0,0 @@
-*-29.807737 317080000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-@200
--
-@28
-sounder_tb.s_strobe
-@22
-sounder_tb.saddr[6:0]
-@200
--
-@28
-sounder_tb.uut.reset
-sounder_tb.uut.transmit
-sounder_tb.uut.receive
-sounder_tb.uut.loopback
-@200
--
-@22
-sounder_tb.uut.degree[4:0]
-sounder_tb.uut.mask[15:0]
-sounder_tb.uut.ampl[13:0]
-sounder_tb.uut.receiver.offset[5:0]
-@200
--
-@8420
-sounder_tb.tx_dac_i[13:0]
-@28
-sounder_tb.tx_strobe
-@200
--
-@8420
-sounder_tb.fifo_i[15:0]
-@28
-sounder_tb.fifo_strobe
-@200
--
-@28
-sounder_tb.uut.ref_strobe
-sounder_tb.uut.sum_strobe
-@200
--
-@28
-sounder_tb.clk
-sounder_tb.uut.transmitter.pn
-sounder_tb.uut.receiver.pn_ref
-@8420
-sounder_tb.uut.receiver.prod_i[31:0]
-sounder_tb.uut.receiver.scaled_i[31:0]
-@8421
-sounder_tb.uut.receiver.sum_i[31:0]
-@8420
-sounder_tb.uut.receiver.total_i[31:0]
-@200
--
-@22
-sounder_tb.uut.master.len[16:0]
-@200
--
diff --git a/gr-sounder/src/fpga/tb/sounder_tb.sh b/gr-sounder/src/fpga/tb/sounder_tb.sh
deleted file mode 100755
index 28efc8d31..000000000
--- a/gr-sounder/src/fpga/tb/sounder_tb.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-iverilog -y ../lib/ -y ../../../../usrp/fpga/sdr_lib \
- sounder_tb.v -o sounder_tb && \
-./sounder_tb > sounder_tb.out && \
- grep 'r=0' sounder_tb.out | grep 'c=1' > sounder_tb.out2
-
diff --git a/gr-sounder/src/fpga/tb/sounder_tb.v b/gr-sounder/src/fpga/tb/sounder_tb.v
deleted file mode 100644
index 0e0cb55c2..000000000
--- a/gr-sounder/src/fpga/tb/sounder_tb.v
+++ /dev/null
@@ -1,238 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-`timescale 1ns/100ps
-
-`include "../lib/sounder.v"
-
-`define FR_MODE 7'd64
-`define bmFR_MODE_RESET 32'h0001
-`define bmFR_MODE_TX 32'h0002
-`define bmFR_MODE_RX 32'h0004
-`define bmFR_MODE_LP 32'h0008
-
-`define FR_DEGREE 7'd65
-`define FR_AMPL 7'd66
-
-module sounder_tb;
-
- // System bus
- reg clk;
- reg rst;
- reg ena;
-
- // Configuration bus
- reg [6:0] saddr;
- reg [31:0] sdata;
- reg s_strobe;
-
- // DAC bus
- wire tx_strobe;
- wire [13:0] tx_dac_i;
- wire [13:0] tx_dac_q;
-
- // ADC bus
- reg [15:0] rx_adc_i;
- reg [15:0] rx_adc_q;
-
- // FIFO bus
- wire fifo_strobe;
- wire [15:0] fifo_i;
- wire [15:0] fifo_q;
-
- // Configuration shadow registers
- reg [31:0] mode;
- reg [31:0] degree;
-
- sounder uut
- (.clk_i(clk),.saddr_i(saddr),.sdata_i(sdata),.s_strobe_i(s_strobe),
- .tx_strobe_o(tx_strobe),.tx_dac_i_o(tx_dac_i),.tx_dac_q_o(tx_dac_q),
- .rx_strobe_o(fifo_strobe),.rx_adc_i_i(rx_adc_i),.rx_adc_q_i(rx_adc_q),
- .rx_imp_i_o(fifo_i),.rx_imp_q_o(fifo_q));
-
- // Start up initialization
- initial
- begin
- clk = 0;
- rst = 0;
- ena = 0;
- saddr = 0;
- sdata = 0;
- s_strobe = 0;
- rx_adc_i = 0;
- rx_adc_q = 0;
- mode = 0;
- degree = 0;
-
- @(posedge clk);
- rst = 1;
- @(posedge clk);
- rst = 0;
- @(posedge clk);
- ena = 1;
- end
-
- always
- #5 clk <= ~clk;
-
- initial
- begin
- $monitor($time, " c=%b r=%b phs=%d txs=%b rfs=%b rxs=%b sms=%b pn=%b pnr=%b prd=%x sum=%x tot=%x",
- clk, rst, uut.master.phase, uut.tx_strobe_o, uut.ref_strobe, uut.rx_strobe_o,
- uut.sum_strobe, uut.transmitter.pn, uut.receiver.pn_ref, uut.receiver.prod_i,
- uut.receiver.sum_i, uut.receiver.total_i);
-
- $dumpfile("sounder_tb.vcd");
- $dumpvars(0, sounder_tb);
- end
-
- // Test tasks
- task write_cfg_register;
- input [6:0] regno;
- input [31:0] value;
-
- begin
- @(posedge clk);
- saddr <= #5 regno;
- sdata <= #5 value;
- s_strobe <= #5 1'b1;
- @(posedge clk);
- s_strobe <= #5 0;
- end
- endtask // write_cfg_register
-
- // Application reset line
- task set_reset;
- input reset;
-
- begin
- mode = reset ? (mode | `bmFR_MODE_RESET) : (mode & ~`bmFR_MODE_RESET);
- write_cfg_register(`FR_MODE, mode);
- end
- endtask // reset
-
- // Set the PN code degree
- task set_degree;
- input [5:0] degree;
- begin
- write_cfg_register(`FR_DEGREE, degree);
- end
- endtask // set_degree
-
- // Set the PN amplitude
- task set_amplitude;
- input [13:0] ampl;
- begin
- write_cfg_register(`FR_AMPL, ampl);
- end
- endtask // set_ampl
-
- // Turn on or off the transmitter
- task enable_tx;
- input tx;
-
- begin
- mode = tx ? (mode | `bmFR_MODE_TX) : (mode & ~`bmFR_MODE_TX);
- write_cfg_register(`FR_MODE, mode);
- end
- endtask // enable_tx
-
- // Turn on or off the receiver
- task enable_rx;
- input rx;
-
- begin
- mode = rx ? (mode | `bmFR_MODE_RX) : (mode & ~`bmFR_MODE_RX);
- write_cfg_register(`FR_MODE, mode);
- end
- endtask // enable_rx
-
-
- // Turn on or off digital loopback
- task enable_lp;
- input lp;
-
- begin
- mode = lp ? (mode | `bmFR_MODE_LP) : (mode & ~`bmFR_MODE_LP);
- write_cfg_register(`FR_MODE, mode);
- end
- endtask // enable_lp
-
- // Test transmitter functionality
- task test_tx;
- input [5:0] degree;
- input [31:0] test_len;
-
- begin
- #20 set_reset(1);
- #20 set_degree(degree);
- #20 set_amplitude(14'h1000);
- #20 enable_tx(1);
- #20 enable_rx(0);
- #20 enable_lp(0);
- #20 set_reset(0);
- #(test_len);
- end
- endtask // test_tx
-
- // Test loopback functionality
- task test_lp;
- input [5:0] degree;
- input [31:0] test_len;
-
- begin
- #20 set_reset(1);
- #20 set_degree(degree);
- #20 enable_tx(1);
- #20 enable_rx(1);
- #20 enable_lp(1);
- #20 set_reset(0);
- #(test_len);
- end
- endtask // test_lp
-
- // Test receiver only functionality
- task test_rx;
- input [5:0] degree;
- input [31:0] test_len;
-
- begin
- #20 set_reset(1);
- #20 set_degree(degree);
- #20 enable_tx(0);
- #20 enable_rx(1);
- #20 enable_lp(0);
- #20 set_reset(0);
- #(test_len);
- end
- endtask // test_rx
-
- // Execute tests
- initial
- begin
- #20 test_tx(8,255*20);
- #20 test_lp(8,255*255*20*5);
- //#20 test_rx(8,255*255*20*5);
- #500 $finish;
- end
-
-endmodule
-
diff --git a/gr-sounder/src/fpga/tb/sounder_tb_wave.sh b/gr-sounder/src/fpga/tb/sounder_tb_wave.sh
deleted file mode 100755
index 4551d5c59..000000000
--- a/gr-sounder/src/fpga/tb/sounder_tb_wave.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-gtkwave sounder_tb.vcd sounder_tb.sav
diff --git a/gr-sounder/src/fpga/top/.gitignore b/gr-sounder/src/fpga/top/.gitignore
deleted file mode 100644
index 2c9458cf2..000000000
--- a/gr-sounder/src/fpga/top/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-/Makefile
-/Makefile.in
-/db
-/*.rpt
-/*.summary
-/*.rbf
-/*.qws
-/*.smsg
-/*.done
-/*.pin
-/*.sof
diff --git a/gr-sounder/src/fpga/top/config.vh b/gr-sounder/src/fpga/top/config.vh
deleted file mode 100644
index 06445e9af..000000000
--- a/gr-sounder/src/fpga/top/config.vh
+++ /dev/null
@@ -1,22 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-// Uncomment to enable 64 MHz Tx clock, otherwise 32 MHz
-//`define TX_RATE_MAX
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.csf b/gr-sounder/src/fpga/top/usrp_sounder.csf
deleted file mode 100644
index 544f278e3..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.csf
+++ /dev/null
@@ -1,444 +0,0 @@
-COMPILER_SETTINGS
-{
- IO_PLACEMENT_OPTIMIZATION = OFF;
- ENABLE_DRC_SETTINGS = OFF;
- PHYSICAL_SYNTHESIS_REGISTER_RETIMING = OFF;
- PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION = OFF;
- PHYSICAL_SYNTHESIS_COMBO_LOGIC = OFF;
- DRC_FANOUT_EXCEEDING = 30;
- DRC_REPORT_FANOUT_EXCEEDING = OFF;
- DRC_TOP_FANOUT = 50;
- DRC_REPORT_TOP_FANOUT = OFF;
- RUN_DRC_DURING_COMPILATION = OFF;
- ADV_NETLIST_OPT_RETIME_CORE_AND_IO = ON;
- ADV_NETLIST_OPT_SYNTH_USE_FITTER_INFO = OFF;
- ADV_NETLIST_OPT_SYNTH_GATE_RETIME = OFF;
- ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP = OFF;
- SMART_COMPILE_IGNORES_TDC_FOR_STRATIX_PLL_CHANGES = OFF;
- MERGE_HEX_FILE = OFF;
- TRUE_WYSIWYG_FLOW = OFF;
- SEED = 1;
- FINAL_PLACEMENT_OPTIMIZATION = AUTOMATICALLY;
- FAMILY = Cyclone;
- DPRAM_DUAL_PORT_MODE_OTHER_SIGNALS_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_OUTPUT_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_OUTPUT_EPXA1 = "LOWER TO 1ESB UPPER TO 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_OUTPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_INPUT_EPXA1 = "DPRAM0 TO 1 DPRAM1 TO 2";
- DPRAM_32BIT_SINGLE_PORT_MODE_INPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_8BIT_16BIT_SINGLE_PORT_MODE_INPUT_EPXA1 = "MEGALAB COLUMN 1";
- DPRAM_DUAL_PORT_MODE_OTHER_SIGNALS_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_SINGLE_PORT_MODE_OTHER_SIGNALS_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_WIDE_MODE_OTHER_SIGNALS_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DEEP_MODE_OTHER_SIGNALS_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DUAL_PORT_MODE_OUTPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4ESB";
- DPRAM_SINGLE_PORT_MODE_OUTPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4ESB";
- DPRAM_WIDE_MODE_OUTPUT_EPXA4_10 = "LOWER TO 3 UPPER TO 4ESB";
- DPRAM_DEEP_MODE_OUTPUT_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_DUAL_PORT_MODE_INPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_SINGLE_PORT_MODE_INPUT_EPXA4_10 = "DPRAM0 TO 3 DPRAM1 TO 4";
- DPRAM_WIDE_MODE_INPUT_EPXA4_10 = "LOWER TO 3 UPPER TO 4";
- DPRAM_DEEP_MODE_INPUT_EPXA4_10 = "MEGALAB COLUMN 3";
- DPRAM_OTHER_SIGNALS_EPXA4_10 = "DEFAULT OTHER ROUTING OPTIONS";
- DPRAM_OUTPUT_EPXA4_10 = "DEFAULT OUTPUT ROUTING OPTIONS";
- DPRAM_INPUT_EPXA4_10 = "DEFAULT INPUT ROUTING OPTIONS";
- STRIPE_TO_PLD_INTERRUPTS_EPXA4_10 = "MEGALAB COLUMN 2";
- PLD_TO_STRIPE_INTERRUPTS_EPXA4_10 = "MEGALAB COLUMN 2";
- PROCESSOR_DEBUG_EXTENSIONS_EPXA4_10 = "MEGALAB COLUMN 2";
- STRIPE_TO_PLD_BRIDGE_EPXA4_10 = "MEGALAB COLUMN 1";
- FAST_FIT_COMPILATION = OFF;
- SIGNALPROBE_DURING_NORMAL_COMPILATION = OFF;
- OPTIMIZE_IOC_REGISTER_PLACEMENT_FOR_TIMING = ON;
- OPTIMIZE_TIMING = "NORMAL COMPILATION";
- OPTIMIZE_HOLD_TIMING = OFF;
- COMPILATION_LEVEL = FULL;
- SAVE_DISK_SPACE = OFF;
- SPEED_DISK_USAGE_TRADEOFF = NORMAL;
- LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT = OFF;
- SIGNALPROBE_ALLOW_OVERUSE = OFF;
- FOCUS_ENTITY_NAME = |usrp_sounder;
- ROUTING_BACK_ANNOTATION_MODE = OFF;
- INC_PLC_MODE = OFF;
- FIT_ONLY_ONE_ATTEMPT = OFF;
-}
-DEFAULT_DEVICE_OPTIONS
-{
- GENERATE_CONFIG_HEXOUT_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_JBC_FILE = OFF;
- GENERATE_CONFIG_JAM_FILE = OFF;
- GENERATE_CONFIG_ISC_FILE = OFF;
- GENERATE_CONFIG_SVF_FILE = OFF;
- GENERATE_JBC_FILE_COMPRESSED = ON;
- GENERATE_JBC_FILE = OFF;
- GENERATE_JAM_FILE = OFF;
- GENERATE_ISC_FILE = OFF;
- GENERATE_SVF_FILE = OFF;
- RESERVE_PIN = "AS INPUT TRI-STATED";
- RESERVE_ALL_UNUSED_PINS = "AS OUTPUT DRIVING GROUND";
- HEXOUT_FILE_COUNT_DIRECTION = UP;
- HEXOUT_FILE_START_ADDRESS = 0;
- GENERATE_HEX_FILE = OFF;
- GENERATE_RBF_FILE = OFF;
- GENERATE_TTF_FILE = OFF;
- RESERVE_ASDO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA0_AFTER_CONFIGURATION = "AS INPUT TRI-STATED";
- RESERVE_DATA7_THROUGH_DATA1_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_RDYNBUSY_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_NWS_NRS_NCS_CS_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- DISABLE_NCS_AND_OE_PULLUPS_ON_CONFIG_DEVICE = OFF;
- AUTO_INCREMENT_CONFIG_DEVICE_JTAG_USER_CODE = ON;
- EPROM_USE_CHECKSUM_AS_USERCODE = OFF;
- FLEX10K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIGURATION_DEVICE = AUTO;
- CYCLONE_CONFIGURATION_DEVICE = AUTO;
- FLEX10K_CONFIGURATION_DEVICE = AUTO;
- FLEX6K_CONFIGURATION_DEVICE = AUTO;
- MERCURY_CONFIGURATION_DEVICE = AUTO;
- EXCALIBUR_CONFIGURATION_DEVICE = AUTO;
- APEX20K_CONFIGURATION_DEVICE = AUTO;
- USE_CONFIGURATION_DEVICE = ON;
- ENABLE_INIT_DONE_OUTPUT = OFF;
- FLEX10K_ENABLE_LOCK_OUTPUT = OFF;
- ENABLE_DEVICE_WIDE_OE = OFF;
- ENABLE_DEVICE_WIDE_RESET = OFF;
- RELEASE_CLEARS_BEFORE_TRI_STATES = OFF;
- AUTO_RESTART_CONFIGURATION = OFF;
- ENABLE_VREFB_PIN = OFF;
- ENABLE_VREFA_PIN = OFF;
- SECURITY_BIT = OFF;
- USER_START_UP_CLOCK = OFF;
- APEXII_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX10K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX6K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- MERCURY_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- EXCALIBUR_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- CYCLONE_CONFIGURATION_SCHEME = "ACTIVE SERIAL";
- STRATIX_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- APEX20K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- STRATIX_UPDATE_MODE = STANDARD;
- USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_JTAG_USER_CODE = 7F;
- MERCURY_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_JTAG_USER_CODE = FFFFFFFF;
- MAX7000S_JTAG_USER_CODE = FFFF;
- RESERVE_NCEO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- FLEX10K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- FLEX6K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = OFF;
- ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- MAX7000_ENABLE_JTAG_BST_SUPPORT = ON;
- ENABLE_JTAG_BST_SUPPORT = OFF;
- CONFIGURATION_CLOCK_DIVISOR = 1;
- CONFIGURATION_CLOCK_FREQUENCY = "10 MHZ";
- CLOCK_SOURCE = INTERNAL;
- COMPRESSION_MODE = OFF;
- ON_CHIP_BITSTREAM_DECOMPRESSION = OFF;
-}
-AUTO_SLD_HUB_ENTITY
-{
- AUTO_INSERT_SLD_HUB_ENTITY = ENABLE;
- HUB_INSTANCE_NAME = SLD_HUB_INST;
- HUB_ENTITY_NAME = SLD_HUB;
-}
-SIGNALTAP_LOGIC_ANALYZER_SETTINGS
-{
- ENABLE_SIGNALTAP = Off;
- AUTO_ENABLE_SMART_COMPILE = On;
-}
-CHIP(usrp_sounder)
-{
- DEVICE = EP1C12Q240C8;
- DEVICE_FILTER_PACKAGE = "ANY QFP";
- DEVICE_FILTER_PIN_COUNT = 240;
- DEVICE_FILTER_SPEED_GRADE = ANY;
- AUTO_RESTART_CONFIGURATION = OFF;
- RELEASE_CLEARS_BEFORE_TRI_STATES = OFF;
- USER_START_UP_CLOCK = OFF;
- ENABLE_DEVICE_WIDE_RESET = OFF;
- ENABLE_DEVICE_WIDE_OE = OFF;
- ENABLE_INIT_DONE_OUTPUT = OFF;
- FLEX10K_ENABLE_LOCK_OUTPUT = OFF;
- ENABLE_JTAG_BST_SUPPORT = OFF;
- MAX7000_ENABLE_JTAG_BST_SUPPORT = ON;
- APEX20K_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_JTAG_USER_CODE = 7F;
- MAX7000_JTAG_USER_CODE = FFFFFFFF;
- MAX7000S_JTAG_USER_CODE = FFFF;
- STRATIX_JTAG_USER_CODE = FFFFFFFF;
- APEX20K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- MERCURY_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX6K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- FLEX10K_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- EXCALIBUR_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- APEXII_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- STRATIX_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- CYCLONE_CONFIGURATION_SCHEME = "PASSIVE SERIAL";
- USE_CONFIGURATION_DEVICE = OFF;
- APEX20K_CONFIGURATION_DEVICE = AUTO;
- MERCURY_CONFIGURATION_DEVICE = AUTO;
- FLEX6K_CONFIGURATION_DEVICE = AUTO;
- FLEX10K_CONFIGURATION_DEVICE = AUTO;
- EXCALIBUR_CONFIGURATION_DEVICE = AUTO;
- STRATIX_CONFIGURATION_DEVICE = AUTO;
- CYCLONE_CONFIGURATION_DEVICE = AUTO;
- STRATIX_UPDATE_MODE = STANDARD;
- APEX20K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- MERCURY_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- FLEX10K_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- STRATIX_CONFIG_DEVICE_JTAG_USER_CODE = FFFFFFFF;
- AUTO_INCREMENT_CONFIG_DEVICE_JTAG_USER_CODE = ON;
- DISABLE_NCS_AND_OE_PULLUPS_ON_CONFIG_DEVICE = OFF;
- COMPRESSION_MODE = OFF;
- ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- FLEX6K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = OFF;
- FLEX10K_ENABLE_LOW_VOLTAGE_MODE_ON_CONFIG_DEVICE = ON;
- EPROM_USE_CHECKSUM_AS_USERCODE = OFF;
- USE_CHECKSUM_AS_USERCODE = OFF;
- MAX7000_USE_CHECKSUM_AS_USERCODE = OFF;
- GENERATE_TTF_FILE = OFF;
- GENERATE_RBF_FILE = ON;
- GENERATE_HEX_FILE = OFF;
- SECURITY_BIT = OFF;
- ENABLE_VREFA_PIN = OFF;
- ENABLE_VREFB_PIN = OFF;
- GENERATE_SVF_FILE = OFF;
- GENERATE_ISC_FILE = OFF;
- GENERATE_JAM_FILE = OFF;
- GENERATE_JBC_FILE = OFF;
- GENERATE_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_SVF_FILE = OFF;
- GENERATE_CONFIG_ISC_FILE = OFF;
- GENERATE_CONFIG_JAM_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE = OFF;
- GENERATE_CONFIG_JBC_FILE_COMPRESSED = ON;
- GENERATE_CONFIG_HEXOUT_FILE = OFF;
- ON_CHIP_BITSTREAM_DECOMPRESSION = OFF;
- BASE_PIN_OUT_FILE_ON_SAMEFRAME_DEVICE = OFF;
- HEXOUT_FILE_START_ADDRESS = 0;
- HEXOUT_FILE_COUNT_DIRECTION = UP;
- RESERVE_ALL_UNUSED_PINS = "AS INPUT TRI-STATED";
- STRATIX_DEVICE_IO_STANDARD = LVTTL;
- CLOCK_SOURCE = INTERNAL;
- CONFIGURATION_CLOCK_FREQUENCY = "10 MHZ";
- CONFIGURATION_CLOCK_DIVISOR = 1;
- RESERVE_NWS_NRS_NCS_CS_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_RDYNBUSY_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA7_THROUGH_DATA1_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_DATA0_AFTER_CONFIGURATION = "AS INPUT TRI-STATED";
- RESERVE_NCEO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- RESERVE_ASDO_AFTER_CONFIGURATION = "USE AS REGULAR IO";
- SCLK : LOCATION = Pin_101;
- SDI : LOCATION = Pin_100;
- SEN : LOCATION = Pin_98;
- SLD : LOCATION = Pin_95;
- adc1_data[0] : LOCATION = Pin_5;
- adc1_data[10] : LOCATION = Pin_235;
- adc1_data[11] : LOCATION = Pin_234;
- adc1_data[1] : LOCATION = Pin_4;
- adc1_data[2] : LOCATION = Pin_3;
- adc1_data[3] : LOCATION = Pin_2;
- adc1_data[4] : LOCATION = Pin_1;
- adc1_data[4] : IO_STANDARD = LVTTL;
- adc1_data[5] : LOCATION = Pin_240;
- adc1_data[6] : LOCATION = Pin_239;
- adc1_data[7] : LOCATION = Pin_238;
- adc1_data[8] : LOCATION = Pin_237;
- adc1_data[9] : LOCATION = Pin_236;
- adc2_data[0] : LOCATION = Pin_20;
- adc2_data[10] : LOCATION = Pin_8;
- adc2_data[11] : LOCATION = Pin_7;
- adc2_data[1] : LOCATION = Pin_19;
- adc2_data[2] : LOCATION = Pin_18;
- adc2_data[3] : LOCATION = Pin_17;
- adc2_data[4] : LOCATION = Pin_16;
- adc2_data[5] : LOCATION = Pin_15;
- adc2_data[6] : LOCATION = Pin_14;
- adc2_data[7] : LOCATION = Pin_13;
- adc2_data[8] : LOCATION = Pin_12;
- adc2_data[9] : LOCATION = Pin_11;
- adc3_data[0] : LOCATION = Pin_200;
- adc3_data[10] : LOCATION = Pin_184;
- adc3_data[11] : LOCATION = Pin_183;
- adc3_data[1] : LOCATION = Pin_197;
- adc3_data[2] : LOCATION = Pin_196;
- adc3_data[3] : LOCATION = Pin_195;
- adc3_data[4] : LOCATION = Pin_194;
- adc3_data[5] : LOCATION = Pin_193;
- adc3_data[6] : LOCATION = Pin_188;
- adc3_data[7] : LOCATION = Pin_187;
- adc3_data[8] : LOCATION = Pin_186;
- adc3_data[9] : LOCATION = Pin_185;
- adc4_data[0] : LOCATION = Pin_222;
- adc4_data[10] : LOCATION = Pin_203;
- adc4_data[11] : LOCATION = Pin_202;
- adc4_data[1] : LOCATION = Pin_219;
- adc4_data[2] : LOCATION = Pin_217;
- adc4_data[3] : LOCATION = Pin_216;
- adc4_data[4] : LOCATION = Pin_215;
- adc4_data[5] : LOCATION = Pin_214;
- adc4_data[6] : LOCATION = Pin_213;
- adc4_data[7] : LOCATION = Pin_208;
- adc4_data[8] : LOCATION = Pin_207;
- adc4_data[9] : LOCATION = Pin_206;
- adc_oeb[0] : LOCATION = Pin_228;
- adc_oeb[1] : LOCATION = Pin_21;
- adc_oeb[2] : LOCATION = Pin_181;
- adc_oeb[3] : LOCATION = Pin_218;
- adc_otr[0] : LOCATION = Pin_233;
- adc_otr[1] : LOCATION = Pin_6;
- adc_otr[2] : LOCATION = Pin_182;
- adc_otr[3] : LOCATION = Pin_201;
- adclk0 : LOCATION = Pin_224;
- adclk1 : LOCATION = Pin_226;
- clk0 : LOCATION = Pin_28;
- clk0 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk0 : IO_STANDARD = LVTTL;
- clk1 : LOCATION = Pin_29;
- clk1 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk1 : IO_STANDARD = LVTTL;
- clk3 : LOCATION = Pin_152;
- clk3 : RESERVE_PIN = "AS INPUT TRI-STATED";
- clk3 : IO_STANDARD = LVTTL;
- clk_120mhz : LOCATION = Pin_153;
- clk_120mhz : IO_STANDARD = LVTTL;
- clk_out : LOCATION = Pin_63;
- clk_out : IO_STANDARD = LVTTL;
- dac1_data[0] : LOCATION = Pin_165;
- dac1_data[10] : LOCATION = Pin_177;
- dac1_data[11] : LOCATION = Pin_178;
- dac1_data[12] : LOCATION = Pin_179;
- dac1_data[13] : LOCATION = Pin_180;
- dac1_data[1] : LOCATION = Pin_166;
- dac1_data[2] : LOCATION = Pin_167;
- dac1_data[3] : LOCATION = Pin_168;
- dac1_data[4] : LOCATION = Pin_169;
- dac1_data[5] : LOCATION = Pin_170;
- dac1_data[6] : LOCATION = Pin_173;
- dac1_data[7] : LOCATION = Pin_174;
- dac1_data[8] : LOCATION = Pin_175;
- dac1_data[9] : LOCATION = Pin_176;
- dac2_data[0] : LOCATION = Pin_159;
- dac2_data[10] : LOCATION = Pin_163;
- dac2_data[11] : LOCATION = Pin_139;
- dac2_data[12] : LOCATION = Pin_164;
- dac2_data[13] : LOCATION = Pin_138;
- dac2_data[1] : LOCATION = Pin_158;
- dac2_data[2] : LOCATION = Pin_160;
- dac2_data[3] : LOCATION = Pin_156;
- dac2_data[4] : LOCATION = Pin_161;
- dac2_data[5] : LOCATION = Pin_144;
- dac2_data[6] : LOCATION = Pin_162;
- dac2_data[7] : LOCATION = Pin_141;
- dac2_data[8] : LOCATION = Pin_143;
- dac2_data[9] : LOCATION = Pin_140;
- dac3_data[0] : LOCATION = Pin_122;
- dac3_data[10] : LOCATION = Pin_134;
- dac3_data[11] : LOCATION = Pin_135;
- dac3_data[12] : LOCATION = Pin_136;
- dac3_data[13] : LOCATION = Pin_137;
- dac3_data[1] : LOCATION = Pin_123;
- dac3_data[2] : LOCATION = Pin_124;
- dac3_data[3] : LOCATION = Pin_125;
- dac3_data[4] : LOCATION = Pin_126;
- dac3_data[5] : LOCATION = Pin_127;
- dac3_data[6] : LOCATION = Pin_128;
- dac3_data[7] : LOCATION = Pin_131;
- dac3_data[8] : LOCATION = Pin_132;
- dac3_data[9] : LOCATION = Pin_133;
- dac4_data[0] : LOCATION = Pin_104;
- dac4_data[10] : LOCATION = Pin_118;
- dac4_data[11] : LOCATION = Pin_119;
- dac4_data[12] : LOCATION = Pin_120;
- dac4_data[13] : LOCATION = Pin_121;
- dac4_data[1] : LOCATION = Pin_105;
- dac4_data[2] : LOCATION = Pin_106;
- dac4_data[3] : LOCATION = Pin_107;
- dac4_data[4] : LOCATION = Pin_108;
- dac4_data[5] : LOCATION = Pin_113;
- dac4_data[6] : LOCATION = Pin_114;
- dac4_data[7] : LOCATION = Pin_115;
- dac4_data[8] : LOCATION = Pin_116;
- dac4_data[9] : LOCATION = Pin_117;
- enable_rx : LOCATION = Pin_88;
- enable_tx : LOCATION = Pin_93;
- gndbus[0] : LOCATION = Pin_223;
- gndbus[0] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[0] : IO_STANDARD = LVTTL;
- gndbus[1] : LOCATION = Pin_225;
- gndbus[1] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[1] : IO_STANDARD = LVTTL;
- gndbus[2] : LOCATION = Pin_227;
- gndbus[2] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[2] : IO_STANDARD = LVTTL;
- gndbus[3] : LOCATION = Pin_62;
- gndbus[3] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[3] : IO_STANDARD = LVTTL;
- gndbus[4] : LOCATION = Pin_64;
- gndbus[4] : RESERVE_PIN = "AS INPUT TRI-STATED";
- gndbus[4] : IO_STANDARD = LVTTL;
- misc_pins[0] : LOCATION = Pin_87;
- misc_pins[0] : IO_STANDARD = LVTTL;
- misc_pins[10] : LOCATION = Pin_76;
- misc_pins[10] : IO_STANDARD = LVTTL;
- misc_pins[11] : LOCATION = Pin_74;
- misc_pins[11] : IO_STANDARD = LVTTL;
- misc_pins[1] : LOCATION = Pin_86;
- misc_pins[1] : IO_STANDARD = LVTTL;
- misc_pins[2] : LOCATION = Pin_85;
- misc_pins[2] : IO_STANDARD = LVTTL;
- misc_pins[3] : LOCATION = Pin_84;
- misc_pins[3] : IO_STANDARD = LVTTL;
- misc_pins[4] : LOCATION = Pin_83;
- misc_pins[4] : IO_STANDARD = LVTTL;
- misc_pins[5] : LOCATION = Pin_82;
- misc_pins[5] : IO_STANDARD = LVTTL;
- misc_pins[6] : LOCATION = Pin_79;
- misc_pins[6] : IO_STANDARD = LVTTL;
- misc_pins[7] : LOCATION = Pin_78;
- misc_pins[7] : IO_STANDARD = LVTTL;
- misc_pins[8] : LOCATION = Pin_77;
- misc_pins[8] : IO_STANDARD = LVTTL;
- misc_pins[9] : LOCATION = Pin_75;
- misc_pins[9] : IO_STANDARD = LVTTL;
- reset : LOCATION = Pin_94;
- usbclk : LOCATION = Pin_55;
- usbctl[0] : LOCATION = Pin_56;
- usbctl[1] : LOCATION = Pin_54;
- usbctl[2] : LOCATION = Pin_53;
- usbctl[3] : LOCATION = Pin_58;
- usbctl[4] : LOCATION = Pin_57;
- usbctl[5] : LOCATION = Pin_44;
- usbdata[0] : LOCATION = Pin_73;
- usbdata[10] : LOCATION = Pin_41;
- usbdata[11] : LOCATION = Pin_39;
- usbdata[12] : LOCATION = Pin_38;
- usbdata[12] : IO_STANDARD = LVTTL;
- usbdata[13] : LOCATION = Pin_37;
- usbdata[14] : LOCATION = Pin_24;
- usbdata[15] : LOCATION = Pin_23;
- usbdata[1] : LOCATION = Pin_68;
- usbdata[2] : LOCATION = Pin_67;
- usbdata[3] : LOCATION = Pin_66;
- usbdata[4] : LOCATION = Pin_65;
- usbdata[5] : LOCATION = Pin_61;
- usbdata[6] : LOCATION = Pin_60;
- usbdata[7] : LOCATION = Pin_59;
- usbdata[8] : LOCATION = Pin_43;
- usbdata[9] : LOCATION = Pin_42;
- usbrdy[0] : LOCATION = Pin_45;
- usbrdy[1] : LOCATION = Pin_46;
- usbrdy[2] : LOCATION = Pin_47;
- usbrdy[3] : LOCATION = Pin_48;
- usbrdy[4] : LOCATION = Pin_49;
- usbrdy[5] : LOCATION = Pin_50;
- clear_status : LOCATION = Pin_99;
-}
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.esf b/gr-sounder/src/fpga/top/usrp_sounder.esf
deleted file mode 100644
index c7d828b2b..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.esf
+++ /dev/null
@@ -1,14 +0,0 @@
-SIMULATOR_SETTINGS
-{
- ESTIMATE_POWER_CONSUMPTION = OFF;
- GLITCH_INTERVAL = 1NS;
- GLITCH_DETECTION = OFF;
- SIMULATION_COVERAGE = ON;
- CHECK_OUTPUTS = OFF;
- SETUP_HOLD_DETECTION = OFF;
- POWER_ESTIMATION_START_TIME = "0 NS";
- ADD_DEFAULT_PINS_TO_SIMULATION_OUTPUT_WAVEFORMS = ON;
- SIMULATION_MODE = TIMING;
- START_TIME = 0NS;
- USE_COMPILER_SETTINGS = usrp_sounder;
-}
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.psf b/gr-sounder/src/fpga/top/usrp_sounder.psf
deleted file mode 100644
index 7bd32ff59..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.psf
+++ /dev/null
@@ -1,312 +0,0 @@
-DEFAULT_DESIGN_ASSISTANT_SETTINGS
-{
- HCPY_ALOAD_SIGNALS = OFF;
- HCPY_VREF_PINS = OFF;
- HCPY_CAT = OFF;
- HCPY_ILLEGAL_HC_DEV_PKG = OFF;
- ACLK_RULE_IMSZER_ADOMAIN = OFF;
- ACLK_RULE_SZER_BTW_ACLK_DOMAIN = OFF;
- ACLK_RULE_NO_SZER_ACLK_DOMAIN = OFF;
- ACLK_CAT = OFF;
- SIGNALRACE_RULE_ASYNCHPIN_SYNCH_CLKPIN = OFF;
- SIGNALRACE_CAT = OFF;
- NONSYNCHSTRUCT_RULE_LATCH_UNIDENTIFIED = OFF;
- NONSYNCHSTRUCT_RULE_SRLATCH = OFF;
- NONSYNCHSTRUCT_RULE_DLATCH = OFF;
- NONSYNCHSTRUCT_RULE_MULTI_VIBRATOR = OFF;
- NONSYNCHSTRUCT_RULE_ILLEGAL_PULSE_GEN = OFF;
- NONSYNCHSTRUCT_RULE_RIPPLE_CLK = OFF;
- NONSYNCHSTRUCT_RULE_DELAY_CHAIN = OFF;
- NONSYNCHSTRUCT_RULE_REG_LOOP = OFF;
- NONSYNCHSTRUCT_RULE_COMBLOOP = OFF;
- NONSYNCHSTRUCT_CAT = OFF;
- NONSYNCHSTRUCT_RULE_COMB_DRIVES_RAM_WE = OFF;
- TIMING_RULE_COIN_CLKEDGE = OFF;
- TIMING_RULE_SHIFT_REG = OFF;
- TIMING_RULE_HIGH_FANOUTS = OFF;
- TIMING_CAT = OFF;
- RESET_RULE_ALL = OFF;
- RESET_RULE_IMSYNCH_ASYNCH_DOMAIN = OFF;
- RESET_RULE_UNSYNCH_ASYNCH_DOMAIN = OFF;
- RESET_RULE_REG_ASNYCH = OFF;
- RESET_RULE_COMB_ASYNCH_RESET = OFF;
- RESET_RULE_IMSYNCH_EXRESET = OFF;
- RESET_RULE_UNSYNCH_EXRESET = OFF;
- RESET_RULE_INPINS_RESETNET = OFF;
- RESET_CAT = OFF;
- CLK_RULE_ALL = OFF;
- CLK_RULE_MIX_EDGES = OFF;
- CLK_RULE_CLKNET_CLKSPINES = OFF;
- CLK_RULE_INPINS_CLKNET = OFF;
- CLK_RULE_GATING_SCHEME = OFF;
- CLK_RULE_INV_CLOCK = OFF;
- CLK_RULE_COMB_CLOCK = OFF;
- CLK_CAT = OFF;
- HCPY_EXCEED_USER_IO_USAGE = OFF;
- HCPY_EXCEED_RAM_USAGE = OFF;
- NONSYNCHSTRUCT_RULE_ASYN_RAM = OFF;
- SIGNALRACE_RULE_TRISTATE = OFF;
- ASSG_RULE_MISSING_TIMING = OFF;
- ASSG_RULE_MISSING_FMAX = OFF;
- ASSG_CAT = OFF;
-}
-SYNTHESIS_FITTING_SETTINGS
-{
- AUTO_SHIFT_REGISTER_RECOGNITION = ON;
- AUTO_DSP_RECOGNITION = ON;
- AUTO_RAM_RECOGNITION = ON;
- REMOVE_DUPLICATE_LOGIC = ON;
- AUTO_TURBO_BIT = ON;
- AUTO_MERGE_PLLS = ON;
- AUTO_OPEN_DRAIN_PINS = ON;
- AUTO_PARALLEL_EXPANDERS = ON;
- AUTO_FAST_OUTPUT_ENABLE_REGISTERS = OFF;
- AUTO_FAST_OUTPUT_REGISTERS = OFF;
- AUTO_FAST_INPUT_REGISTERS = OFF;
- AUTO_CASCADE_CHAINS = ON;
- AUTO_CARRY_CHAINS = ON;
- AUTO_DELAY_CHAINS = ON;
- MAX7000_PARALLEL_EXPANDER_CHAIN_LENGTH = 4;
- PARALLEL_EXPANDER_CHAIN_LENGTH = 16;
- CASCADE_CHAIN_LENGTH = 2;
- STRATIX_CARRY_CHAIN_LENGTH = 70;
- MERCURY_CARRY_CHAIN_LENGTH = 48;
- FLEX10K_CARRY_CHAIN_LENGTH = 32;
- FLEX6K_CARRY_CHAIN_LENGTH = 32;
- CARRY_CHAIN_LENGTH = 48;
- CARRY_OUT_PINS_LCELL_INSERT = ON;
- NORMAL_LCELL_INSERT = ON;
- AUTO_LCELL_INSERTION = ON;
- ALLOW_XOR_GATE_USAGE = ON;
- AUTO_PACKED_REGISTERS_STRATIX = NORMAL;
- AUTO_PACKED_REGISTERS = OFF;
- AUTO_PACKED_REG_CYCLONE = NORMAL;
- FLEX10K_OPTIMIZATION_TECHNIQUE = AREA;
- FLEX6K_OPTIMIZATION_TECHNIQUE = AREA;
- MERCURY_OPTIMIZATION_TECHNIQUE = AREA;
- APEX20K_OPTIMIZATION_TECHNIQUE = SPEED;
- MAX7000_OPTIMIZATION_TECHNIQUE = SPEED;
- STRATIX_OPTIMIZATION_TECHNIQUE = SPEED;
- CYCLONE_OPTIMIZATION_TECHNIQUE = AREA;
- FLEX10K_TECHNOLOGY_MAPPER = LUT;
- FLEX6K_TECHNOLOGY_MAPPER = LUT;
- MERCURY_TECHNOLOGY_MAPPER = LUT;
- APEX20K_TECHNOLOGY_MAPPER = LUT;
- MAX7000_TECHNOLOGY_MAPPER = "PRODUCT TERM";
- STRATIX_TECHNOLOGY_MAPPER = LUT;
- AUTO_IMPLEMENT_IN_ROM = OFF;
- AUTO_GLOBAL_MEMORY_CONTROLS = OFF;
- AUTO_GLOBAL_REGISTER_CONTROLS = ON;
- AUTO_GLOBAL_OE = ON;
- AUTO_GLOBAL_CLOCK = ON;
- USE_LPM_FOR_AHDL_OPERATORS = ON;
- LIMIT_AHDL_INTEGERS_TO_32_BITS = OFF;
- ENABLE_BUS_HOLD_CIRCUITRY = OFF;
- WEAK_PULL_UP_RESISTOR = OFF;
- TURBO_BIT = ON;
- MAX7000_IGNORE_SOFT_BUFFERS = OFF;
- IGNORE_SOFT_BUFFERS = ON;
- MAX7000_IGNORE_LCELL_BUFFERS = AUTO;
- IGNORE_LCELL_BUFFERS = OFF;
- IGNORE_ROW_GLOBAL_BUFFERS = OFF;
- IGNORE_GLOBAL_BUFFERS = OFF;
- IGNORE_CASCADE_BUFFERS = OFF;
- IGNORE_CARRY_BUFFERS = OFF;
- REMOVE_DUPLICATE_REGISTERS = ON;
- REMOVE_REDUNDANT_LOGIC_CELLS = OFF;
- ALLOW_POWER_UP_DONT_CARE = ON;
- PCI_IO = OFF;
- NOT_GATE_PUSH_BACK = ON;
- SLOW_SLEW_RATE = OFF;
- DSP_BLOCK_BALANCING = AUTO;
- STATE_MACHINE_PROCESSING = AUTO;
-}
-DEFAULT_HARDCOPY_SETTINGS
-{
- HARDCOPY_EXTERNAL_CLOCK_JITTER = "0.0 NS";
-}
-DEFAULT_TIMING_REQUIREMENTS
-{
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- RUN_ALL_TIMING_ANALYSES = ON;
- IGNORE_CLOCK_SETTINGS = OFF;
- DEFAULT_HOLD_MULTICYCLE = "SAME AS MULTICYCLE";
- CUT_OFF_IO_PIN_FEEDBACK = ON;
- CUT_OFF_CLEAR_AND_PRESET_PATHS = ON;
- CUT_OFF_READ_DURING_WRITE_PATHS = ON;
- CUT_OFF_PATHS_BETWEEN_CLOCK_DOMAINS = ON;
- DO_MIN_ANALYSIS = ON;
- DO_MIN_TIMING = OFF;
- NUMBER_OF_PATHS_TO_REPORT = 200;
- NUMBER_OF_DESTINATION_TO_REPORT = 10;
- NUMBER_OF_SOURCES_PER_DESTINATION_TO_REPORT = 10;
- MAX_SCC_SIZE = 50;
-}
-HDL_SETTINGS
-{
- VERILOG_INPUT_VERSION = VERILOG_2001;
- ENABLE_IP_DEBUG = OFF;
- VHDL_INPUT_VERSION = VHDL93;
- VHDL_SHOW_LMF_MAPPING_MESSAGES = OFF;
-}
-PROJECT_INFO(usrp_sounder)
-{
- ORIGINAL_QUARTUS_VERSION = 3.0;
- PROJECT_CREATION_TIME_DATE = "00:14:04 JULY 13, 2003";
- LAST_QUARTUS_VERSION = 3.0;
- SHOW_REGISTRATION_MESSAGE = ON;
- USER_LIBRARIES = "h:\\gnuradio\\trunk\\usrp\\fpga\\megacells";
-}
-THIRD_PARTY_EDA_TOOLS(usrp_sounder)
-{
- EDA_DESIGN_ENTRY_SYNTHESIS_TOOL = "<NONE>";
- EDA_SIMULATION_TOOL = "<NONE>";
- EDA_TIMING_ANALYSIS_TOOL = "<NONE>";
- EDA_BOARD_DESIGN_TOOL = "<NONE>";
- EDA_FORMAL_VERIFICATION_TOOL = "<NONE>";
- EDA_RESYNTHESIS_TOOL = "<NONE>";
-}
-EDA_TOOL_SETTINGS(eda_design_synthesis)
-{
- EDA_INPUT_GND_NAME = GND;
- EDA_INPUT_VCC_NAME = VCC;
- EDA_SHOW_LMF_MAPPING_MESSAGES = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_INPUT_DATA_FORMAT = EDIF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_simulation)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_timing_analysis)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- EDA_LAUNCH_CMD_LINE_TOOL = OFF;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_board_design)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_formal_verification)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- RESYNTHESIS_RETIMING = FULL;
-}
-EDA_TOOL_SETTINGS(eda_palace)
-{
- EDA_INCLUDE_VHDL_CONFIGURATION_DECLARATION = OFF;
- EDA_TRUNCATE_LONG_HIERARCHY_PATHS = OFF;
- EDA_MAINTAIN_DESIGN_HIERARCHY = OFF;
- EDA_WRITE_DEVICE_CONTROL_PORTS = OFF;
- EDA_GENERATE_FUNCTIONAL_NETLIST = OFF;
- EDA_FLATTEN_BUSES = OFF;
- EDA_MAP_ILLEGAL_CHARACTERS = OFF;
- EDA_EXCALIBUR_ATOMS_AS_SINGLE_STRIPE = OFF;
- EDA_RUN_TOOL_AUTOMATICALLY = OFF;
- EDA_OUTPUT_DATA_FORMAT = NONE;
- RESYNTHESIS_RETIMING = FULL;
- RESYNTHESIS_PHYSICAL_SYNTHESIS = NORMAL;
- RESYNTHESIS_OPTIMIZATION_EFFORT = NORMAL;
- USE_GENERATED_PHYSICAL_CONSTRAINTS = ON;
-}
-CLOCK(clk_120mhz)
-{
- FMAX_REQUIREMENT = "120.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(usbclk)
-{
- FMAX_REQUIREMENT = "48.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(SCLK)
-{
- FMAX_REQUIREMENT = "1.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(adclk0)
-{
- FMAX_REQUIREMENT = "60.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
-CLOCK(adclk1)
-{
- FMAX_REQUIREMENT = "60.0 MHz";
- INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS = OFF;
- DUTY_CYCLE = 50;
- DIVIDE_BASE_CLOCK_PERIOD_BY = 1;
- MULTIPLY_BASE_CLOCK_PERIOD_BY = 1;
- INVERT_BASE_CLOCK = OFF;
-}
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.qpf b/gr-sounder/src/fpga/top/usrp_sounder.qpf
deleted file mode 100644
index aa75e962b..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.qpf
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 1991-2004 Altera Corporation
-# Any megafunction design, and related netlist (encrypted or decrypted),
-# support information, device programming or simulation file, and any other
-# associated documentation or information provided by Altera or a partner
-# under Altera's Megafunction Partnership Program may be used only
-# to program PLD devices (but not masked PLD devices) from Altera. Any
-# other use of such megafunction design, netlist, support information,
-# device programming or simulation file, or any other related documentation
-# or information is prohibited for any other purpose, including, but not
-# limited to modification, reverse engineering, de-compiling, or use with
-# any other silicon devices, unless such use is explicitly licensed under
-# a separate agreement with Altera or a megafunction partner. Title to the
-# intellectual property, including patents, copyrights, trademarks, trade
-# secrets, or maskworks, embodied in any such megafunction design, netlist,
-# support information, device programming or simulation file, or any other
-# related documentation or information provided by Altera or a megafunction
-# partner, remains with Altera, the megafunction partner, or their respective
-# licensors. No other licenses, including any licenses needed under any third
-# party's intellectual property, are provided herein.
-
-
-
-QUARTUS_VERSION = "7.0"
-DATE = "09:00:00 April 17, 2007"
-
-
-# Active Revisions
-
-PROJECT_REVISION = "usrp_sounder"
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.qsf b/gr-sounder/src/fpga/top/usrp_sounder.qsf
deleted file mode 100644
index 4d60f5f13..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.qsf
+++ /dev/null
@@ -1,396 +0,0 @@
-# Copyright (C) 1991-2005 Altera Corporation
-# Your use of Altera Corporation's design tools, logic functions
-# and other software and tools, and its AMPP partner logic
-# functions, and any output files any of the foregoing
-# (including device programming or simulation files), and any
-# associated documentation or information are expressly subject
-# to the terms and conditions of the Altera Program License
-# Subscription Agreement, Altera MegaCore Function License
-# Agreement, or other applicable license agreement, including,
-# without limitation, that your use is for the sole purpose of
-# programming logic devices manufactured by Altera and sold by
-# Altera or its authorized distributors. Please refer to the
-# applicable agreement for further details.
-
-
-# The default values for assignments are stored in the file
-# usrp_sounder_assignment_defaults.qdf
-# If this file doesn't exist, and for assignments not listed, see file
-# assignment_defaults.qdf
-
-# Altera recommends that you do not modify this file. This
-# file is updated automatically by the Quartus II software
-# and any changes you make may be lost or overwritten.
-
-
-# Project-Wide Assignments
-# ========================
-set_global_assignment -name ORIGINAL_QUARTUS_VERSION 3.0
-set_global_assignment -name PROJECT_CREATION_TIME_DATE "00:14:04 JULY 13, 2003"
-set_global_assignment -name LAST_QUARTUS_VERSION 7.0
-
-# Pin & Location Assignments
-# ==========================
-set_global_assignment -name RESERVE_PIN "AS INPUT TRI-STATED"
-set_location_assignment PIN_29 -to SCLK
-set_location_assignment PIN_117 -to SDI
-set_location_assignment PIN_28 -to usbclk
-set_location_assignment PIN_107 -to usbctl[0]
-set_location_assignment PIN_106 -to usbctl[1]
-set_location_assignment PIN_105 -to usbctl[2]
-set_location_assignment PIN_100 -to usbdata[0]
-set_location_assignment PIN_84 -to usbdata[10]
-set_location_assignment PIN_83 -to usbdata[11]
-set_location_assignment PIN_82 -to usbdata[12]
-set_location_assignment PIN_79 -to usbdata[13]
-set_location_assignment PIN_78 -to usbdata[14]
-set_location_assignment PIN_77 -to usbdata[15]
-set_location_assignment PIN_99 -to usbdata[1]
-set_location_assignment PIN_98 -to usbdata[2]
-set_location_assignment PIN_95 -to usbdata[3]
-set_location_assignment PIN_94 -to usbdata[4]
-set_location_assignment PIN_93 -to usbdata[5]
-set_location_assignment PIN_88 -to usbdata[6]
-set_location_assignment PIN_87 -to usbdata[7]
-set_location_assignment PIN_86 -to usbdata[8]
-set_location_assignment PIN_85 -to usbdata[9]
-set_location_assignment PIN_104 -to usbrdy[0]
-set_location_assignment PIN_101 -to usbrdy[1]
-set_location_assignment PIN_76 -to FX2_1
-set_location_assignment PIN_75 -to FX2_2
-set_location_assignment PIN_74 -to FX2_3
-set_location_assignment PIN_116 -to io_rx_a[0]
-set_location_assignment PIN_115 -to io_rx_a[1]
-set_location_assignment PIN_114 -to io_rx_a[2]
-set_location_assignment PIN_113 -to io_rx_a[3]
-set_location_assignment PIN_108 -to io_rx_a[4]
-set_location_assignment PIN_195 -to io_rx_a[5]
-set_location_assignment PIN_196 -to io_rx_a[6]
-set_location_assignment PIN_197 -to io_rx_a[7]
-set_location_assignment PIN_200 -to io_rx_a[8]
-set_location_assignment PIN_201 -to io_rx_a[9]
-set_location_assignment PIN_202 -to io_rx_a[10]
-set_location_assignment PIN_203 -to io_rx_a[11]
-set_location_assignment PIN_206 -to io_rx_a[12]
-set_location_assignment PIN_207 -to io_rx_a[13]
-set_location_assignment PIN_208 -to io_rx_a[14]
-set_location_assignment PIN_214 -to io_rx_b[0]
-set_location_assignment PIN_215 -to io_rx_b[1]
-set_location_assignment PIN_216 -to io_rx_b[2]
-set_location_assignment PIN_217 -to io_rx_b[3]
-set_location_assignment PIN_218 -to io_rx_b[4]
-set_location_assignment PIN_219 -to io_rx_b[5]
-set_location_assignment PIN_222 -to io_rx_b[6]
-set_location_assignment PIN_223 -to io_rx_b[7]
-set_location_assignment PIN_224 -to io_rx_b[8]
-set_location_assignment PIN_225 -to io_rx_b[9]
-set_location_assignment PIN_226 -to io_rx_b[10]
-set_location_assignment PIN_227 -to io_rx_b[11]
-set_location_assignment PIN_228 -to io_rx_b[12]
-set_location_assignment PIN_233 -to io_rx_b[13]
-set_location_assignment PIN_234 -to io_rx_b[14]
-set_location_assignment PIN_175 -to io_tx_a[0]
-set_location_assignment PIN_176 -to io_tx_a[1]
-set_location_assignment PIN_177 -to io_tx_a[2]
-set_location_assignment PIN_178 -to io_tx_a[3]
-set_location_assignment PIN_179 -to io_tx_a[4]
-set_location_assignment PIN_180 -to io_tx_a[5]
-set_location_assignment PIN_181 -to io_tx_a[6]
-set_location_assignment PIN_182 -to io_tx_a[7]
-set_location_assignment PIN_183 -to io_tx_a[8]
-set_location_assignment PIN_184 -to io_tx_a[9]
-set_location_assignment PIN_185 -to io_tx_a[10]
-set_location_assignment PIN_186 -to io_tx_a[11]
-set_location_assignment PIN_187 -to io_tx_a[12]
-set_location_assignment PIN_188 -to io_tx_a[13]
-set_location_assignment PIN_193 -to io_tx_a[14]
-set_location_assignment PIN_73 -to io_tx_b[0]
-set_location_assignment PIN_68 -to io_tx_b[1]
-set_location_assignment PIN_67 -to io_tx_b[2]
-set_location_assignment PIN_66 -to io_tx_b[3]
-set_location_assignment PIN_65 -to io_tx_b[4]
-set_location_assignment PIN_64 -to io_tx_b[5]
-set_location_assignment PIN_63 -to io_tx_b[6]
-set_location_assignment PIN_62 -to io_tx_b[7]
-set_location_assignment PIN_61 -to io_tx_b[8]
-set_location_assignment PIN_60 -to io_tx_b[9]
-set_location_assignment PIN_59 -to io_tx_b[10]
-set_location_assignment PIN_58 -to io_tx_b[11]
-set_location_assignment PIN_57 -to io_tx_b[12]
-set_location_assignment PIN_56 -to io_tx_b[13]
-set_location_assignment PIN_55 -to io_tx_b[14]
-set_location_assignment PIN_152 -to master_clk
-set_location_assignment PIN_144 -to rx_a_a[0]
-set_location_assignment PIN_143 -to rx_a_a[1]
-set_location_assignment PIN_141 -to rx_a_a[2]
-set_location_assignment PIN_140 -to rx_a_a[3]
-set_location_assignment PIN_139 -to rx_a_a[4]
-set_location_assignment PIN_138 -to rx_a_a[5]
-set_location_assignment PIN_137 -to rx_a_a[6]
-set_location_assignment PIN_136 -to rx_a_a[7]
-set_location_assignment PIN_135 -to rx_a_a[8]
-set_location_assignment PIN_134 -to rx_a_a[9]
-set_location_assignment PIN_133 -to rx_a_a[10]
-set_location_assignment PIN_132 -to rx_a_a[11]
-set_location_assignment PIN_23 -to rx_a_b[0]
-set_location_assignment PIN_21 -to rx_a_b[1]
-set_location_assignment PIN_20 -to rx_a_b[2]
-set_location_assignment PIN_19 -to rx_a_b[3]
-set_location_assignment PIN_18 -to rx_a_b[4]
-set_location_assignment PIN_17 -to rx_a_b[5]
-set_location_assignment PIN_16 -to rx_a_b[6]
-set_location_assignment PIN_15 -to rx_a_b[7]
-set_location_assignment PIN_14 -to rx_a_b[8]
-set_location_assignment PIN_13 -to rx_a_b[9]
-set_location_assignment PIN_12 -to rx_a_b[10]
-set_location_assignment PIN_11 -to rx_a_b[11]
-set_location_assignment PIN_131 -to rx_b_a[0]
-set_location_assignment PIN_128 -to rx_b_a[1]
-set_location_assignment PIN_127 -to rx_b_a[2]
-set_location_assignment PIN_126 -to rx_b_a[3]
-set_location_assignment PIN_125 -to rx_b_a[4]
-set_location_assignment PIN_124 -to rx_b_a[5]
-set_location_assignment PIN_123 -to rx_b_a[6]
-set_location_assignment PIN_122 -to rx_b_a[7]
-set_location_assignment PIN_121 -to rx_b_a[8]
-set_location_assignment PIN_120 -to rx_b_a[9]
-set_location_assignment PIN_119 -to rx_b_a[10]
-set_location_assignment PIN_118 -to rx_b_a[11]
-set_location_assignment PIN_8 -to rx_b_b[0]
-set_location_assignment PIN_7 -to rx_b_b[1]
-set_location_assignment PIN_6 -to rx_b_b[2]
-set_location_assignment PIN_5 -to rx_b_b[3]
-set_location_assignment PIN_4 -to rx_b_b[4]
-set_location_assignment PIN_3 -to rx_b_b[5]
-set_location_assignment PIN_2 -to rx_b_b[6]
-set_location_assignment PIN_240 -to rx_b_b[7]
-set_location_assignment PIN_239 -to rx_b_b[8]
-set_location_assignment PIN_238 -to rx_b_b[9]
-set_location_assignment PIN_237 -to rx_b_b[10]
-set_location_assignment PIN_236 -to rx_b_b[11]
-set_location_assignment PIN_156 -to SDO
-set_location_assignment PIN_153 -to SEN_FPGA
-set_location_assignment PIN_159 -to tx_a[0]
-set_location_assignment PIN_160 -to tx_a[1]
-set_location_assignment PIN_161 -to tx_a[2]
-set_location_assignment PIN_162 -to tx_a[3]
-set_location_assignment PIN_163 -to tx_a[4]
-set_location_assignment PIN_164 -to tx_a[5]
-set_location_assignment PIN_165 -to tx_a[6]
-set_location_assignment PIN_166 -to tx_a[7]
-set_location_assignment PIN_167 -to tx_a[8]
-set_location_assignment PIN_168 -to tx_a[9]
-set_location_assignment PIN_169 -to tx_a[10]
-set_location_assignment PIN_170 -to tx_a[11]
-set_location_assignment PIN_173 -to tx_a[12]
-set_location_assignment PIN_174 -to tx_a[13]
-set_location_assignment PIN_38 -to tx_b[0]
-set_location_assignment PIN_39 -to tx_b[1]
-set_location_assignment PIN_41 -to tx_b[2]
-set_location_assignment PIN_42 -to tx_b[3]
-set_location_assignment PIN_43 -to tx_b[4]
-set_location_assignment PIN_44 -to tx_b[5]
-set_location_assignment PIN_45 -to tx_b[6]
-set_location_assignment PIN_46 -to tx_b[7]
-set_location_assignment PIN_47 -to tx_b[8]
-set_location_assignment PIN_48 -to tx_b[9]
-set_location_assignment PIN_49 -to tx_b[10]
-set_location_assignment PIN_50 -to tx_b[11]
-set_location_assignment PIN_53 -to tx_b[12]
-set_location_assignment PIN_54 -to tx_b[13]
-set_location_assignment PIN_158 -to TXSYNC_A
-set_location_assignment PIN_37 -to TXSYNC_B
-set_location_assignment PIN_235 -to io_rx_b[15]
-set_location_assignment PIN_24 -to io_tx_b[15]
-set_location_assignment PIN_213 -to io_rx_a[15]
-set_location_assignment PIN_194 -to io_tx_a[15]
-set_location_assignment PIN_1 -to MYSTERY_SIGNAL
-
-# Timing Assignments
-# ==================
-set_global_assignment -name INCLUDE_EXTERNAL_PIN_DELAYS_IN_FMAX_CALCULATIONS OFF
-
-# Analysis & Synthesis Assignments
-# ================================
-set_global_assignment -name SAVE_DISK_SPACE OFF
-set_global_assignment -name DEVICE_FILTER_PACKAGE "ANY QFP"
-set_global_assignment -name DEVICE_FILTER_PIN_COUNT 240
-set_global_assignment -name EDA_DESIGN_ENTRY_SYNTHESIS_TOOL "<None>"
-set_global_assignment -name FAMILY Cyclone
-set_global_assignment -name CYCLONE_OPTIMIZATION_TECHNIQUE BALANCED
-set_global_assignment -name STRATIX_OPTIMIZATION_TECHNIQUE SPEED
-set_global_assignment -name APEX20K_OPTIMIZATION_TECHNIQUE SPEED
-set_global_assignment -name TOP_LEVEL_ENTITY usrp_sounder
-set_global_assignment -name VHDL_SHOW_LMF_MAPPING_MESSAGES OFF
-set_global_assignment -name USER_LIBRARIES "h:\\gnuradio\\trunk\\usrp\\fpga\\megacells"
-set_global_assignment -name AUTO_ENABLE_SMART_COMPILE ON
-
-# Fitter Assignments
-# ==================
-set_global_assignment -name DEVICE EP1C12Q240C8
-set_global_assignment -name CYCLONE_CONFIGURATION_SCHEME "PASSIVE SERIAL"
-set_global_assignment -name RESERVE_ALL_UNUSED_PINS "AS INPUT TRI-STATED"
-set_global_assignment -name OPTIMIZE_HOLD_TIMING OFF
-set_global_assignment -name OPTIMIZE_TIMING "NORMAL COMPILATION"
-set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF
-set_global_assignment -name IO_PLACEMENT_OPTIMIZATION OFF
-set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT EXTRA
-set_global_assignment -name INC_PLC_MODE OFF
-set_global_assignment -name ROUTING_BACK_ANNOTATION_MODE OFF
-set_instance_assignment -name IO_STANDARD LVTTL -to usbdata[12]
-set_global_assignment -name STRATIX_DEVICE_IO_STANDARD LVTTL
-set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1
-
-# Timing Analysis Assignments
-# ===========================
-set_global_assignment -name MAX_SCC_SIZE 50
-
-# EDA Netlist Writer Assignments
-# ==============================
-set_global_assignment -name EDA_SIMULATION_TOOL "<None>"
-set_global_assignment -name EDA_TIMING_ANALYSIS_TOOL "<NONE>"
-set_global_assignment -name EDA_BOARD_DESIGN_TOOL "<NONE>"
-set_global_assignment -name EDA_FORMAL_VERIFICATION_TOOL "<NONE>"
-set_global_assignment -name EDA_RESYNTHESIS_TOOL "<NONE>"
-
-# Assembler Assignments
-# =====================
-set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
-set_global_assignment -name GENERATE_RBF_FILE ON
-set_global_assignment -name RESERVE_ALL_UNUSED_PINS_NO_OUTPUT_GND "AS INPUT TRI-STATED"
-set_global_assignment -name AUTO_RESTART_CONFIGURATION OFF
-
-# Simulator Assignments
-# =====================
-set_global_assignment -name START_TIME "0 ns"
-set_global_assignment -name GLITCH_INTERVAL "1 ns"
-
-# Design Assistant Assignments
-# ============================
-set_global_assignment -name DRC_REPORT_TOP_FANOUT OFF
-set_global_assignment -name DRC_REPORT_FANOUT_EXCEEDING OFF
-set_global_assignment -name ASSG_CAT OFF
-set_global_assignment -name ASSG_RULE_MISSING_FMAX OFF
-set_global_assignment -name ASSG_RULE_MISSING_TIMING OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_ASYN_RAM OFF
-set_global_assignment -name CLK_CAT OFF
-set_global_assignment -name CLK_RULE_COMB_CLOCK OFF
-set_global_assignment -name CLK_RULE_INV_CLOCK OFF
-set_global_assignment -name CLK_RULE_GATING_SCHEME OFF
-set_global_assignment -name CLK_RULE_INPINS_CLKNET OFF
-set_global_assignment -name CLK_RULE_CLKNET_CLKSPINES OFF
-set_global_assignment -name CLK_RULE_MIX_EDGES OFF
-set_global_assignment -name RESET_CAT OFF
-set_global_assignment -name RESET_RULE_INPINS_RESETNET OFF
-set_global_assignment -name RESET_RULE_UNSYNCH_EXRESET OFF
-set_global_assignment -name RESET_RULE_IMSYNCH_EXRESET OFF
-set_global_assignment -name RESET_RULE_COMB_ASYNCH_RESET OFF
-set_global_assignment -name RESET_RULE_UNSYNCH_ASYNCH_DOMAIN OFF
-set_global_assignment -name RESET_RULE_IMSYNCH_ASYNCH_DOMAIN OFF
-set_global_assignment -name TIMING_CAT OFF
-set_global_assignment -name TIMING_RULE_SHIFT_REG OFF
-set_global_assignment -name TIMING_RULE_COIN_CLKEDGE OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_COMB_DRIVES_RAM_WE OFF
-set_global_assignment -name NONSYNCHSTRUCT_CAT OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_COMBLOOP OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_REG_LOOP OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_DELAY_CHAIN OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_RIPPLE_CLK OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_ILLEGAL_PULSE_GEN OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_MULTI_VIBRATOR OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_SRLATCH OFF
-set_global_assignment -name NONSYNCHSTRUCT_RULE_LATCH_UNIDENTIFIED OFF
-set_global_assignment -name SIGNALRACE_CAT OFF
-set_global_assignment -name ACLK_CAT OFF
-set_global_assignment -name ACLK_RULE_NO_SZER_ACLK_DOMAIN OFF
-set_global_assignment -name ACLK_RULE_SZER_BTW_ACLK_DOMAIN OFF
-set_global_assignment -name ACLK_RULE_IMSZER_ADOMAIN OFF
-set_global_assignment -name HCPY_CAT OFF
-set_global_assignment -name HCPY_VREF_PINS OFF
-
-# SignalTap II Assignments
-# ========================
-set_global_assignment -name HUB_ENTITY_NAME SLD_HUB
-set_global_assignment -name HUB_INSTANCE_NAME SLD_HUB_INST
-set_global_assignment -name ENABLE_SIGNALTAP OFF
-
-# LogicLock Region Assignments
-# ============================
-set_global_assignment -name LOGICLOCK_INCREMENTAL_COMPILE_ASSIGNMENT OFF
-
-# -----------------
-# start CLOCK(SCLK)
-
- # Timing Assignments
- # ==================
-set_global_assignment -name DUTY_CYCLE 50 -section_id SCLK
-set_global_assignment -name FMAX_REQUIREMENT "1 MHz" -section_id SCLK
-
-# end CLOCK(SCLK)
-# ---------------
-
-# -----------------------
-# start CLOCK(master_clk)
-
- # Timing Assignments
- # ==================
-set_global_assignment -name DUTY_CYCLE 50 -section_id master_clk
-set_global_assignment -name FMAX_REQUIREMENT "64 MHz" -section_id master_clk
-
-# end CLOCK(master_clk)
-# ---------------------
-
-# -------------------
-# start CLOCK(usbclk)
-
- # Timing Assignments
- # ==================
-set_global_assignment -name DUTY_CYCLE 50 -section_id usbclk
-set_global_assignment -name FMAX_REQUIREMENT "48 MHz" -section_id usbclk
-
-# end CLOCK(usbclk)
-# -----------------
-
-# ----------------------
-# start ENTITY(usrp_sounder)
-
- # Timing Assignments
- # ==================
-set_instance_assignment -name CLOCK_SETTINGS SCLK -to SCLK
-set_instance_assignment -name CLOCK_SETTINGS usbclk -to usbclk
-set_instance_assignment -name CLOCK_SETTINGS master_clk -to master_clk
-
-# end ENTITY(usrp_sounder)
-# --------------------
-
-set_instance_assignment -name PARTITION_HIERARCHY no_file_for_top_partition -to | -section_id Top
-set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
-
-set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING OFF
-set_global_assignment -name FITTER_EARLY_TIMING_ESTIMATE_MODE REALISTIC
-set_global_assignment -name VERILOG_FILE ../lib/lfsr_constants.v
-set_global_assignment -name VERILOG_FILE ../lib/lfsr.v
-set_global_assignment -name VERILOG_FILE ../lib/dac_interface.v
-set_global_assignment -name VERILOG_FILE ../lib/dacpll.v
-set_global_assignment -name VERILOG_FILE ../lib/sounder_rx.v
-set_global_assignment -name VERILOG_FILE ../lib/sounder_tx.v
-set_global_assignment -name VERILOG_FILE ../lib/sounder_ctrl.v
-set_global_assignment -name VERILOG_FILE ../lib/sounder.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/atr_delay.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/sign_extend.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rx_buffer.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/setting_reg.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/strobe_gen.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/clk_divider.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/bidir_reg.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/adc_interface.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/gen_sync.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/io_pins.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/master_control.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rssi.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/rx_dcoffset.v
-set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/serial_io.v
-set_global_assignment -name VERILOG_FILE usrp_sounder.v
-set_global_assignment -name FITTER_EFFORT "STANDARD FIT" \ No newline at end of file
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.rbf b/gr-sounder/src/fpga/top/usrp_sounder.rbf
deleted file mode 100755
index e2c9db6c4..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.rbf
+++ /dev/null
Binary files differ
diff --git a/gr-sounder/src/fpga/top/usrp_sounder.v b/gr-sounder/src/fpga/top/usrp_sounder.v
deleted file mode 100644
index a88b2388e..000000000
--- a/gr-sounder/src/fpga/top/usrp_sounder.v
+++ /dev/null
@@ -1,198 +0,0 @@
-// -*- verilog -*-
-//
-// USRP - Universal Software Radio Peripheral
-//
-// Copyright (C) 2003,2004 Matt Ettus
-// Copyright (C) 2007 Corgan Enterprises LLC
-//
-// This program 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.
-//
-// This program 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, Boston, MA 02110-1301 USA
-//
-
-// Top level module for a full setup with DUCs and DDCs
-
-// Define DEBUG_OWNS_IO_PINS if we're using the daughterboard i/o pins
-// for debugging info. NB, This can kill the m'board and/or d'board if you
-// have anything except basic d'boards installed.
-
-// Uncomment the following to include optional circuitry
-
-module usrp_sounder
-(output MYSTERY_SIGNAL,
- input master_clk,
- input SCLK,
- input SDI,
- inout SDO,
- input SEN_FPGA,
-
- input FX2_1,
- output FX2_2,
- output FX2_3,
-
- input wire [11:0] rx_a_a,
- input wire [11:0] rx_b_a,
- input wire [11:0] rx_a_b,
- input wire [11:0] rx_b_b,
-
- output wire [13:0] tx_a,
- output wire [13:0] tx_b,
-
- output wire TXSYNC_A,
- output wire TXSYNC_B,
-
- // USB interface
- input usbclk,
- input wire [2:0] usbctl,
- output wire [1:0] usbrdy,
- inout [15:0] usbdata, // NB Careful, inout
-
- // These are the general purpose i/o's that go to the daughterboard slots
- inout wire [15:0] io_tx_a,
- inout wire [15:0] io_tx_b,
- inout wire [15:0] io_rx_a,
- inout wire [15:0] io_rx_b
- );
- wire [15:0] debugdata,debugctrl;
- assign MYSTERY_SIGNAL = 1'b0;
-
- wire clk64;
-
- // wire WR = usbctl[0];
- wire RD = usbctl[1];
- wire OE = usbctl[2];
-
- wire have_pkt_rdy;
- assign usbrdy[0] = 1'b0; // have_space;
- assign usbrdy[1] = have_pkt_rdy;
-
- wire tx_underrun, rx_overrun;
- wire clear_status = FX2_1;
- assign FX2_2 = rx_overrun;
- assign FX2_3 = 1'b0; // tx_underrun;
-
- wire [15:0] usbdata_out;
-
- wire [3:0] rx_numchan;
- wire enable_tx, enable_rx;
- wire tx_dsp_reset, rx_dsp_reset, tx_bus_reset, rx_bus_reset;
-
- // Tri-state bus macro
- bustri bustri( .data(usbdata_out),.enabledt(OE),.tridata(usbdata) );
-
- assign clk64 = master_clk;
-
- // TX
- wire tx_sample_strobe;
- wire tx_empty;
-
- wire serial_strobe;
- wire [6:0] serial_addr;
- wire [31:0] serial_data;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Transmit Side
-
- wire [13:0] tx_i, tx_q;
- wire [13:0] tx_dac;
-
- dac_interface dac(.clk_i(clk64),.rst_i(tx_dsp_reset),.ena_i(enable_tx),
- .strobe_i(tx_sample_strobe),.tx_i_i(tx_i),.tx_q_i(tx_q),
- .tx_data_o(tx_dac),.tx_sync_o(TXSYNC_A));
-
- assign tx_a = tx_dac;
-
- // Wedge DAC #2 at zero
- assign TXSYNC_B = 1'b0;
- assign tx_b = 14'b0;
-
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Receive Side
- wire rx_sample_strobe, rx_strobe;
- wire [15:0] rx_adc0_i, rx_adc0_q;
- wire [15:0] rx_buf_i, rx_buf_q;
-
- adc_interface adc_interface(.clock(clk64),.reset(rx_dsp_reset),.enable(enable_rx),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .rx_a_a(rx_a_a),.rx_b_a(rx_b_a),.rx_a_b(),.rx_b_b(),
- .rssi_0(),.rssi_1(),.rssi_2(),.rssi_3(),
- .ddc0_in_i(rx_adc0_i),.ddc0_in_q(rx_adc0_q),
- .ddc1_in_i(),.ddc1_in_q(),
- .ddc2_in_i(),.ddc2_in_q(),
- .ddc3_in_i(),.ddc3_in_q(),.rx_numchan(rx_numchan) );
-
- rx_buffer rx_buffer
- ( .usbclk(usbclk),.bus_reset(rx_bus_reset),.reset(rx_dsp_reset),
- .reset_regs(rx_dsp_reset),
- .usbdata(usbdata_out),.RD(RD),.have_pkt_rdy(have_pkt_rdy),.rx_overrun(rx_overrun),
- .channels(rx_numchan),
- .ch_0(rx_buf_i),.ch_1(rx_buf_q),
- .ch_2(),.ch_3(),
- .ch_4(),.ch_5(),
- .ch_6(),.ch_7(),
- .rxclk(clk64),.rxstrobe(rx_strobe),
- .clear_status(clear_status),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .debugbus() );
-
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Top level application
-
- sounder sounder
- ( .clk_i(clk64),.saddr_i(serial_addr),.sdata_i(serial_data),.s_strobe_i(serial_strobe),
- .tx_strobe_o(tx_sample_strobe),.tx_dac_i_o(tx_i),.tx_dac_q_o(tx_q),
- .rx_adc_i_i(rx_adc0_i),.rx_adc_q_i(rx_adc0_q),
- .rx_strobe_o(rx_strobe),.rx_imp_i_o(rx_buf_i),.rx_imp_q_o(rx_buf_q)
- );
-
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Control Functions
-
- wire [31:0] capabilities;
- assign capabilities[7] = 0; // `TX_CAP_HB;
- assign capabilities[6:4] = 2; // `TX_CAP_NCHAN;
- assign capabilities[3] = 0; // `RX_CAP_HB;
- assign capabilities[2:0] = 2; // `RX_CAP_NCHAN;
-
- serial_io serial_io
- ( .master_clk(clk64),.serial_clock(SCLK),.serial_data_in(SDI),
- .enable(SEN_FPGA),.reset(1'b0),.serial_data_out(SDO),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .readback_0({io_rx_a,io_tx_a}),.readback_1({io_rx_b,io_tx_b}),.readback_2(capabilities),.readback_3(32'hf0f0931a),
- .readback_4(),.readback_5(),.readback_6(),.readback_7()
- );
-
- wire [15:0] reg_0,reg_1,reg_2,reg_3;
- master_control master_control
- ( .master_clk(clk64),.usbclk(usbclk),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
- .tx_bus_reset(tx_bus_reset),.rx_bus_reset(rx_bus_reset),
- .tx_dsp_reset(tx_dsp_reset),.rx_dsp_reset(rx_dsp_reset),
- .enable_tx(enable_tx),.enable_rx(enable_rx),
- .interp_rate(),.decim_rate(),
- .tx_sample_strobe(),.strobe_interp(),
- .rx_sample_strobe(rx_sample_strobe),.strobe_decim(),
- .tx_empty(tx_empty),
- .debug_0(),.debug_1(),
- .debug_2(),.debug_3(),
- .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3) );
-
- io_pins io_pins
- (.io_0(io_tx_a),.io_1(io_rx_a),.io_2(io_tx_b),.io_3(io_rx_b),
- .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3),
- .clock(clk64),.rx_reset(rx_dsp_reset),.tx_reset(tx_dsp_reset),
- .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe));
-
-endmodule // usrp_sounder
diff --git a/gr-sounder/src/lib/.gitignore b/gr-sounder/src/lib/.gitignore
deleted file mode 100644
index b336cc7ce..000000000
--- a/gr-sounder/src/lib/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Makefile
-/Makefile.in
diff --git a/gr-sounder/src/lib/Makefile.am b/gr-sounder/src/lib/Makefile.am
deleted file mode 100644
index 4f35e3aef..000000000
--- a/gr-sounder/src/lib/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# 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.
-#
-
-include $(top_srcdir)/Makefile.common
diff --git a/gr-sounder/src/python/.gitignore b/gr-sounder/src/python/.gitignore
deleted file mode 100644
index 8ac573ba1..000000000
--- a/gr-sounder/src/python/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/Makefile
-/Makefile.in
-/run_tests
-/*.pyc
-/loopback.dat
diff --git a/gr-sounder/src/python/qa_nothing.py b/gr-sounder/src/python/qa_nothing.py
deleted file mode 100644
index e69de29bb..000000000
--- a/gr-sounder/src/python/qa_nothing.py
+++ /dev/null
diff --git a/gr-sounder/src/python/sounder.py b/gr-sounder/src/python/sounder.py
deleted file mode 100644
index 85c03b0e1..000000000
--- a/gr-sounder/src/python/sounder.py
+++ /dev/null
@@ -1,271 +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.
-#
-
-from gnuradio import gr, usrp
-from gnuradio import eng_notation
-
-n2s = eng_notation.num_to_str
-
-FR_MODE = usrp.FR_USER_0
-bmFR_MODE_RESET = 1 << 0 # bit 0: active high reset
-bmFR_MODE_TX = 1 << 1 # bit 1: enable transmitter
-bmFR_MODE_RX = 1 << 2 # bit 2: enable receiver
-bmFR_MODE_LP = 1 << 3 # bit 3: enable digital loopback
-
-FR_DEGREE = usrp.FR_USER_1
-FR_AMPL = usrp.FR_USER_2
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db[0][0].dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- if u.db[1][0].dbid() >= 0:
- return (1, 0)
- return (0, 0)
-
-class sounder_tx:
- def __init__(self, loopback=False,ampl=4096,verbose=False,debug=False):
- self._loopback=loopback
- self._amplitude = ampl
- self._verbose = verbose
- self._debug = debug
- self._u = usrp.sink_s(fpga_filename='usrp_sounder.rbf')
- if not self._loopback:
- self._subdev_spec = usrp.pick_tx_subdevice(self._u)
- self._subdev = usrp.selected_subdev(self._u, self._subdev_spec)
- if self._verbose:
- print "Using", self._subdev.name(), "for sounder transmitter."
- self.set_amplitude(ampl)
- if not self._loopback:
- self._subdev.set_lo_offset(0.0)
- self._u.start()
- if not self._loopback:
- self._subdev.set_enable(True)
-
- def tune(self, frequency):
- if self._verbose:
- print "Setting transmitter frequency to", n2s(frequency)
- result = self._u.tune(0, self._subdev, frequency)
- if result == False:
- raise RuntimeError("Failed to set transmitter frequency.")
-
- def set_amplitude(self, ampl):
- self._amplitude = ampl
- if self._debug:
- print "Writing amplitude register with:", hex(self._mode)
- self._u._write_fpga_reg(FR_AMPL, self._amplitude)
-
-class sounder_rx:
- def __init__(self,subdev_spec=None,gain=None,length=1,alpha=1.0,msgq=None,loopback=False,verbose=False,debug=False):
- self._subdev_spec = subdev_spec
- self._gain = gain
- self._length = length
- self._alpha = alpha
- self._msgq = msgq
- self._loopback = loopback
- self._verbose = verbose
- self._debug = debug
-
- self._tb = gr.top_block()
- self._u = usrp.source_c(fpga_filename='usrp_sounder.rbf')
- if not self._loopback:
- if self._subdev_spec == None:
- self._subdev_spec = pick_subdevice(self._u)
- self._u.set_mux(usrp.determine_rx_mux_value(self._u, self._subdev_spec))
- self._subdev = usrp.selected_subdev(self._u, self._subdev_spec)
- if self._verbose:
- print "Using", self._subdev.name(), "for sounder receiver."
-
- self.set_gain(self._gain)
- self._vblen = gr.sizeof_gr_complex*self._length
- if self._debug:
- print "Generating impulse vectors of length", self._length, "byte length", self._vblen
-
- self._s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self._length)
- if self._verbose:
- print "Using smoothing alpha of", self._alpha
- self._lpf = gr.single_pole_iir_filter_cc(self._alpha, self._length)
- self._sink = gr.message_sink(self._vblen, self._msgq, True)
- self._tb.connect(self._u, self._s2v, self._lpf, self._sink)
-
- def tune(self, frequency):
- if self._verbose:
- print "Setting receiver frequency to", n2s(frequency)
- result = self._u.tune(0, self._subdev, frequency)
- if result == False:
- raise RuntimeError("Failed to set receiver frequency.")
-
- def set_gain(self, gain):
- self._gain = gain
- if self._loopback:
- return
-
- if self._gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self._subdev.gain_range()
- self._gain = float(g[0]+g[1])/2
- if self._verbose:
- print "Setting receiver gain to", gain
- self._subdev.set_gain(self._gain)
-
- def start(self):
- if self._debug:
- print "Starting receiver flow graph."
- self._tb.start()
-
- def wait(self):
- if self._debug:
- print "Waiting for threads..."
- self._tb.wait()
-
- def stop(self):
- if self._debug:
- print "Stopping receiver flow graph."
- self._tb.stop()
- self.wait()
- if self._debug:
- print "Receiver flow graph stopped."
-
-
-class sounder:
- def __init__(self,transmit=False,receive=False,loopback=False,rx_subdev_spec=None,ampl=0x1FFF,
- frequency=0.0,rx_gain=None,degree=12,length=1,alpha=1.0,msgq=None,verbose=False,debug=False):
- self._transmit = transmit
- self._receive = receive
- self._loopback = loopback
- self._rx_subdev_spec = rx_subdev_spec
- self._frequency = frequency
- self._amplitude = ampl
- self._rx_gain = rx_gain
- self._degree = degree
- self._length = length
- self._alpha = alpha
- self._msgq = msgq
- self._verbose = verbose
- self._debug = debug
- self._mode = 0
- self._u = None
- self._trans = None
- self._rcvr = None
- self._transmitting = False
- self._receiving = False
-
- if self._transmit:
- self._trans = sounder_tx(loopback=self._loopback,ampl=self._amplitude,
- verbose=self._verbose)
- self._u = self._trans._u
-
- if self._receive:
- self._rcvr = sounder_rx(subdev_spec=self._rx_subdev_spec,length=self._length,
- gain=self._rx_gain,alpha=self._alpha,msgq=self._msgq,
- loopback=self._loopback,verbose=self._verbose,
- debug=self._debug)
- self._u = self._rcvr._u # either receiver or transmitter object will do
-
- self.set_reset(True)
- if self._loopback == False:
- self.tune(self._frequency)
- self.set_degree(self._degree)
- self.set_loopback(self._loopback)
- self.set_reset(False)
-
- def tune(self, frequency):
- self._frequency = frequency
- if self._rcvr:
- self._rcvr.tune(frequency)
- if self._trans:
- self._trans.tune(frequency)
-
- def set_degree(self, degree):
- if self._verbose:
- print "Setting PN code degree to", degree
- self._u._write_fpga_reg(FR_DEGREE, degree);
-
- def _write_mode(self):
- if self._debug:
- print "Writing mode register with:", hex(self._mode)
- self._u._write_fpga_reg(FR_MODE, self._mode)
-
- def enable_tx(self, value):
- if value:
- if self._verbose:
- print "Enabling transmitter."
- self._mode |= bmFR_MODE_TX
- self._transmitting = True
- else:
- if self._verbose:
- print "Disabling transmitter."
- self._mode &= ~bmFR_MODE_TX
- self._write_mode()
-
- def enable_rx(self, value):
- if value:
- self._mode |= bmFR_MODE_RX
- self._write_mode()
- self._rcvr.start()
- self._receiving = True
- else:
- self._rcvr.stop()
- self._mode &= ~bmFR_MODE_RX
- self._write_mode()
- self._receiving = False
-
- def set_loopback(self, value):
- if value:
- if self._verbose:
- print "Enabling digital loopback."
- self._mode |= bmFR_MODE_LP
- else:
- if self._verbose:
- print "Disabling digital loopback."
- self._mode &= ~bmFR_MODE_LP
- self._write_mode()
-
- def set_reset(self, value):
- if value:
- if self._debug:
- print "Asserting reset."
- self._mode |= bmFR_MODE_RESET
- else:
- if self._debug:
- print "De-asserting reset."
- self._mode &= ~bmFR_MODE_RESET
- self._write_mode()
-
- def start(self):
- if self._transmit:
- self.enable_tx(True)
- if self._receive:
- self.enable_rx(True)
-
- def __del__(self):
- if self._transmitting:
- self.enable_tx(False)
-
- if self._receiving:
- self.enable_rx(False)
-
diff --git a/gr-sounder/src/python/sounder_loopback.sh b/gr-sounder/src/python/sounder_loopback.sh
deleted file mode 100755
index a97a8fdcf..000000000
--- a/gr-sounder/src/python/sounder_loopback.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# Note this runs the installed script, not the one in the tree
-usrp_sounder.py -r -l -t -d12 -v -F loopback.dat -D
diff --git a/gr-sounder/src/python/usrp_sounder.py b/gr-sounder/src/python/usrp_sounder.py
deleted file mode 100755
index c183ee85a..000000000
--- a/gr-sounder/src/python/usrp_sounder.py
+++ /dev/null
@@ -1,112 +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.
-#
-
-from gnuradio import gr
-from gnuradio.sounder import sounder
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from optparse import OptionParser
-import numpy
-import sys
-
-n2s = eng_notation.num_to_str
-
-def main():
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=(0, 0),
- help="select USRP Rx side A or B")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-f", "--frequency", type="eng_float", default=0.0,
- help="set frequency to FREQ in Hz, default is %default", metavar="FREQ")
- parser.add_option("-d", "--degree", type="int", default=12,
- help="set sounding sequence degree (2-12), default is %default,")
- parser.add_option("-a", "--amplitude", type="int", default=4096,
- help="set waveform amplitude, default is %default,")
- parser.add_option("-t", "--transmit", action="store_true", default=False,
- help="enable sounding transmitter")
- parser.add_option("-r", "--receive", action="store_true", default=False,
- help="enable sounding receiver")
- parser.add_option("-l", "--loopback", action="store_true", default=False,
- help="enable digital loopback, default is disabled")
- parser.add_option("-v", "--verbose", action="store_true", default=False,
- help="enable verbose output, default is disabled")
- parser.add_option("-D", "--debug", action="store_true", default=False,
- help="enable debugging output, default is disabled")
- parser.add_option("-F", "--filename", default=None,
- help="log received impulse responses to file")
- parser.add_option("", "--alpha", type="eng_float", default=1.0,
- help="smoothing factor (0.0-1.0), default is %default (none)")
-
- (options, args) = parser.parse_args()
-
- if len(args) != 0 or not (options.transmit | options.receive):
- parser.print_help()
- sys.exit(1)
-
- if options.receive and (options.filename == None):
- print "Must supply filename when receiving."
- sys.exit(1)
-
- if options.degree > 12 or options.degree < 2:
- print "PN code degree must be between 2 and 12"
- sys.exit(1)
-
- length = int(2**options.degree-1)
- if options.verbose:
- print "Using PN code degree of", options.degree, "length", length
- if options.loopback == False:
- print "Sounding frequency range is", n2s(options.frequency-16e6), "to", n2s(options.frequency+16e6)
- if options.filename != None:
- print "Logging impulse records to file: ", options.filename
-
- msgq = gr.msg_queue()
- s = sounder(transmit=options.transmit,receive=options.receive,
- loopback=options.loopback,rx_subdev_spec=options.rx_subdev_spec,
- frequency=options.frequency,rx_gain=options.gain,
- degree=options.degree,length=length,alpha=options.alpha,
- msgq=msgq,verbose=options.verbose,ampl=options.amplitude,
- debug=options.debug)
- s.start()
-
- if options.receive:
- f = open(options.filename, "wb")
- print "Enter CTRL-C to stop."
- try:
- while (1):
- msg = msgq.delete_head()
- if msg.type() == 1:
- break
- rec = msg.to_string()[:length*gr.sizeof_gr_complex]
- if options.debug:
- print "Received impulse vector of length", len(rec)
-
- f.write(rec)
-
- except KeyboardInterrupt:
- pass
- else:
- if options.transmit:
- raw_input("Press return to exit.")
-
-if __name__ == "__main__":
- main()
diff --git a/gr-trellis/src/lib/Makefile.am b/gr-trellis/src/lib/Makefile.am
index 8f703c92a..e0b254756 100644
--- a/gr-trellis/src/lib/Makefile.am
+++ b/gr-trellis/src/lib/Makefile.am
@@ -29,7 +29,9 @@ EXTRA_DIST += \
trellis.test
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
+ $(GR_DIGITAL_INCLUDES) \
+ $(WITH_INCLUDES)
# ----------------------------------------------------------------
# these scripts generate trellis codes from template files
@@ -84,13 +86,13 @@ grinclude_HEADERS = \
quicksort_index.h \
base.h \
interleaver.h \
- metric_type.h \
calc_metric.h \
core_algorithms.h \
trellis_permutation.h \
siso_type.h \
trellis_siso_f.h \
trellis_siso_combined_f.h \
+ trellis_constellation_metrics_cf.h \
$(GENERATED_H)
lib_LTLIBRARIES = libgnuradio-trellis.la
@@ -105,6 +107,7 @@ libgnuradio_trellis_la_SOURCES = \
trellis_permutation.cc \
trellis_siso_f.cc \
trellis_siso_combined_f.cc \
+ trellis_constellation_metrics_cf.cc \
$(GENERATED_CC)
libgnuradio_trellis_la_LIBADD = \
@@ -139,6 +142,7 @@ trellis_swiginclude_headers = \
trellis_permutation.i \
trellis_siso_f.i \
trellis_siso_combined_f.i \
+ trellis_constellation_metrics_cf.i \
trellis_generated.i
# Do creation and inclusion of other Makefiles last
@@ -160,6 +164,10 @@ include $(top_srcdir)/Makefile.par.gen
BUILT_SOURCES += $(python_built_sources)
+# Location of non-standard SWIG interface files
+trellis_swig_args = \
+ $(GR_DIGITAL_INCLUDES)
+
if GUILE
TESTS += run_guile_tests
endif
diff --git a/gr-trellis/src/lib/Makefile.swig.gen b/gr-trellis/src/lib/Makefile.swig.gen
index 784c146cf..2d014b946 100644
--- a/gr-trellis/src/lib/Makefile.swig.gen
+++ b/gr-trellis/src/lib/Makefile.swig.gen
@@ -105,7 +105,7 @@ _trellis_la_CXXFLAGS = \
$(trellis_la_swig_cxxflags)
python/trellis.cc: trellis.py
-trellis.py: trellis.i
+trellis.py: trellis.i
# Include the python dependencies for this file
-include python/trellis.d
diff --git a/gr-trellis/src/lib/calc_metric.h b/gr-trellis/src/lib/calc_metric.h
index d628f44e0..fd20f8d36 100644
--- a/gr-trellis/src/lib/calc_metric.h
+++ b/gr-trellis/src/lib/calc_metric.h
@@ -25,7 +25,7 @@
#include <vector>
#include <gr_complex.h>
-#include <metric_type.h>
+#include <digital_metric_type.h>
template <class T>
diff --git a/gr-trellis/src/lib/core_algorithms.h b/gr-trellis/src/lib/core_algorithms.h
index 0ce4f3f4e..cab7086ba 100644
--- a/gr-trellis/src/lib/core_algorithms.h
+++ b/gr-trellis/src/lib/core_algorithms.h
@@ -26,7 +26,7 @@
#include <cmath>
#include <vector>
//#include <gr_complex.h>
-#include "metric_type.h"
+#include "digital_metric_type.h"
#include "fsm.h"
#include "interleaver.h"
diff --git a/gr-trellis/src/lib/fsm.cc b/gr-trellis/src/lib/fsm.cc
index 5950b56b9..71e54b05a 100644
--- a/gr-trellis/src/lib/fsm.cc
+++ b/gr-trellis/src/lib/fsm.cc
@@ -132,7 +132,7 @@ fsm::fsm(int k, int n, const std::vector<int> &G)
for(int j=0;j<n;j++) {
int mem = -1;
if(G[i*n+j]!=0)
- mem=(int)(log(G[i*n+j])/log(2.0));
+ mem=(int)(log(double(G[i*n+j]))/log(2.0));
if(mem>max_mem_x[i])
max_mem_x[i]=mem;
if(mem>max_mem)
@@ -417,7 +417,7 @@ void fsm::generate_TM()
done = find_es(s);
attempts ++;
}
- if (done == false) {
+ if (done == false && d_S > 1) {
//throw std::runtime_error ("fsm::generate_TM(): FSM appears to be disconnected\n");
printf("fsm::generate_TM(): FSM appears to be disconnected\n");
printf("state %d cannot be reached from all other states\n",s);
diff --git a/gr-trellis/src/lib/fsm.h b/gr-trellis/src/lib/fsm.h
index 0a90b2cd3..134bbf26e 100644
--- a/gr-trellis/src/lib/fsm.h
+++ b/gr-trellis/src/lib/fsm.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -27,31 +27,114 @@
#include <iosfwd>
/*!
- * \brief FSM class
+ * \brief Finite State Machine Specification class.
+ *
+ * An instance of this class represents a finite state machine specification (FSMS)
+ * rather than the FSM itself. It particular the state of the FSM
+ * is not stored within an instance of this class.
*/
class fsm {
private:
+ // Input alphabet cardinality.
int d_I;
+ // Number of states.
int d_S;
+ // Output alphabet cardinality.
int d_O;
+ // NS means Next State.
+ // next_state = d_NS[current_state * d_I + input_symbol]
std::vector<int> d_NS;
+ // OS means Output Symbol.
+ // output_symbol = d_OS[current_state * d_I + input_symbol]
std::vector<int> d_OS;
+ // PS means Previous State.
std::vector< std::vector<int> > d_PS;
+ // PI means Previous Input Symbol.
+ // d_PS[current_state][k] and d_PI[current_state][k], is a pair of the form
+ // (previous_state, previous_input_symbol) that could have produced the
+ // current state.
std::vector< std::vector<int> > d_PI;
- std::vector<int> d_TMi;
+ // TM means Termination matrix.
+ // d_TMl[s*d_S+es] is the shortest number of steps to get from state s to
+ // state es.
std::vector<int> d_TMl;
+ // d_TMi[s*d_S+es] is the input symbol required to set off on the shortest
+ // path from state s to es.
+ std::vector<int> d_TMi;
void generate_PS_PI ();
void generate_TM ();
bool find_es(int es);
public:
+ /*!
+ * \brief Constructor to create an uninitialized FSMS.
+ */
fsm();
+ /*!
+ * \brief Constructor to copy an FSMS.
+ */
fsm(const fsm &FSM);
+ /*!
+ * \brief Constructor to to create an FSMS.
+ *
+ * \param I The number of possible input symbols.
+ * \param S The number of possible FSM states.
+ * \param O The number of possible output symbols.
+ * \param NS A mapping from (current state, input symbol) to next state.
+ * next_state = NS[current_state * I + input_symbol]
+ * \param OS A mapping from (current state, input symbol) to output symbol.
+ * output_symbol = OS[current_state * I + input_symbol]
+ *
+ */
fsm(int I, int S, int O, const std::vector<int> &NS, const std::vector<int> &OS);
+ /*!
+ * \brief Constructor to create an FSMS from file contents.
+ *
+ * \param name filename
+ *
+ */
fsm(const char *name);
+ /*!
+ * \brief Creates an FSMS from the generator matrix of a (n, k) binary convolutional code.
+ *
+ * \param k ???
+ * \param n ???
+ * \param G ???
+ *
+ */
fsm(int k, int n, const std::vector<int> &G);
+ /*!
+ * \brief Creates an FSMS describing ISI.
+ *
+ * \param mod_size modulation size
+ * \param ch_length channel length
+ *
+ */
fsm(int mod_size, int ch_length);
+ /*!
+ * \brief Creates an FSMS describing the trellis for a CPM.
+ *
+ * \param P ???? h=K/P (relatively prime)
+ * \param M alphabet size
+ * \param L pulse duration
+ *
+ * This FSM is based on the paper by B. Rimoldi
+ * "A decomposition approach to CPM", IEEE Trans. Info Theory, March 1988
+ * See also my own notes at http://www.eecs.umich.edu/~anastas/docs/cpm.pdf
+ */
fsm(int P, int M, int L);
+ /*!
+ * \brief Creates an FSMS describing the joint trellis of two FSMs.
+ *
+ * \param FSM1 first FSMS
+ * \param FSM2 second FSMS
+ */
fsm(const fsm &FSM1, const fsm &FSM2);
+ /*!
+ * \brief Creates an FSMS representing n stages through the originial FSM (AKA radix-n FSM).
+ *
+ * \param FSM Original FSMs
+ * \param n Number of stages.
+ */
fsm(const fsm &FSM, int n);
int I () const { return d_I; }
int S () const { return d_S; }
@@ -62,7 +145,20 @@ public:
const std::vector< std::vector<int> > & PI () const { return d_PI; }
const std::vector<int> & TMi () const { return d_TMi; }
const std::vector<int> & TMl () const { return d_TMl; }
+ /*!
+ * \brief Creates an svg image of the trellis representation.
+ *
+ * \param filename filename
+ * \param number_stages ????
+ *
+ */
void write_trellis_svg(std::string filename ,int number_stages);
+ /*!
+ * \brief Write the FSMS to a file.
+ *
+ * \param filename filename
+ *
+ */
void write_fsm_txt(std::string filename);
};
diff --git a/gr-trellis/src/lib/trellis.i b/gr-trellis/src/lib/trellis.i
index 8d1118436..d01ab529a 100644
--- a/gr-trellis/src/lib/trellis.i
+++ b/gr-trellis/src/lib/trellis.i
@@ -28,8 +28,11 @@
#include "trellis_permutation.h"
#include "trellis_siso_f.h"
#include "trellis_siso_combined_f.h"
+#include "trellis_constellation_metrics_cf.h"
+#include "digital_constellation.h"
%}
+
// ----------------------------------------------------------------
%include "fsm.i"
@@ -38,12 +41,19 @@
%include "trellis_siso_f.i"
%include "trellis_siso_combined_f.i"
-%include "metric_type.h"
%include "siso_type.h"
+%include "trellis_constellation_metrics_cf.i"
%include "trellis_generated.i"
+%import "digital_metric_type.h"
+%import "digital_constellation.i"
+
+ //%pythoncode %{
+ // from gnuradio.gr import TRELLIS_EUCLIDEAN, TRELLIS_HARD_SYMBOL, TRELLIS_HARD_BIT
+ // %}
+
#if SWIGGUILE
%scheme %{
(load-extension-global "libguile-gnuradio-trellis" "scm_init_gnuradio_trellis_module")
diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc b/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc
new file mode 100644
index 000000000..91520e4ce
--- /dev/null
+++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.cc
@@ -0,0 +1,90 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <trellis_constellation_metrics_cf.h>
+#include <gr_io_signature.h>
+#include <assert.h>
+#include <stdexcept>
+#include <iostream>
+
+
+
+trellis_constellation_metrics_cf_sptr
+trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE)
+{
+ return gnuradio::get_initial_sptr (new trellis_constellation_metrics_cf (constellation, TYPE));
+}
+
+
+
+trellis_constellation_metrics_cf::trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE)
+ : gr_block ("constellation_metrics_cf",
+ gr_make_io_signature (1, -1, sizeof (gr_complex)),
+ gr_make_io_signature (1, -1, sizeof (float))),
+ d_constellation (constellation),
+ d_TYPE (TYPE),
+ d_O (constellation->arity()),
+ d_D (constellation->dimensionality())
+{
+ set_relative_rate (1.0 * d_O / ((double) d_D));
+ set_output_multiple ((int)d_O);
+}
+
+void
+trellis_constellation_metrics_cf::forecast (int noutput_items, gr_vector_int &ninput_items_required)
+{
+ assert (noutput_items % d_O == 0);
+ unsigned int input_required = d_D * noutput_items / d_O;
+ unsigned int ninputs = ninput_items_required.size();
+ for (unsigned int i = 0; i < ninputs; i++)
+ ninput_items_required[i] = input_required;
+}
+
+
+
+int
+trellis_constellation_metrics_cf::general_work (int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+
+ assert (noutput_items % d_O == 0);
+ assert (input_items.size() == output_items.size());
+ unsigned int nstreams = input_items.size();
+
+for (unsigned int m=0;m<nstreams;m++) {
+ const gr_complex *in = (gr_complex *) input_items[m];
+ float *out = (float *) output_items[m];
+
+ for (unsigned int i = 0; i < noutput_items / d_O ; i++){
+ d_constellation->calc_metric(&(in[i*d_D]), &(out[i*d_O]), d_TYPE);
+ }
+}
+
+ consume_each (d_D * noutput_items / d_O);
+ return noutput_items;
+}
diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.h b/gr-trellis/src/lib/trellis_constellation_metrics_cf.h
new file mode 100644
index 000000000..a34c335ec
--- /dev/null
+++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.h
@@ -0,0 +1,61 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,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,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef INCLUDED_TRELLIS_CONSTELLATION_METRICS_CF_H
+#define INCLUDED_TRELLIS_CONSTELLATION_METRICS_CF_H
+
+#include <gr_block.h>
+#include <digital_constellation.h>
+#include <digital_metric_type.h>
+
+class trellis_constellation_metrics_cf;
+typedef boost::shared_ptr<trellis_constellation_metrics_cf> trellis_constellation_metrics_cf_sptr;
+
+trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE);
+
+/*!
+ * \brief Evaluate metrics for use by the Viterbi algorithm.
+ * \ingroup coding_blk
+ */
+class trellis_constellation_metrics_cf : public gr_block
+{
+ public:
+ 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);
+ protected:
+ trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE);
+
+ private:
+ digital_constellation_sptr d_constellation;
+ trellis_metric_type_t d_TYPE;
+ unsigned int d_O;
+ unsigned int d_D;
+ friend trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE);
+
+};
+
+
+#endif
diff --git a/gr-trellis/src/lib/trellis_constellation_metrics_cf.i b/gr-trellis/src/lib/trellis_constellation_metrics_cf.i
new file mode 100644
index 000000000..c17522b11
--- /dev/null
+++ b/gr-trellis/src/lib/trellis_constellation_metrics_cf.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2004,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.
+ */
+
+// WARNING: this file is machine generated. Edits will be over written
+
+GR_SWIG_BLOCK_MAGIC(trellis,constellation_metrics_cf);
+
+trellis_constellation_metrics_cf_sptr trellis_make_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE);
+
+class trellis_constellation_metrics_cf : public gr_block
+{
+private:
+ trellis_constellation_metrics_cf (digital_constellation_sptr constellation, trellis_metric_type_t TYPE);
+};
diff --git a/gr-trellis/src/python/qa_trellis.py b/gr-trellis/src/python/qa_trellis.py
index cfeefea06..b50679f27 100755
--- a/gr-trellis/src/python/qa_trellis.py
+++ b/gr-trellis/src/python/qa_trellis.py
@@ -20,46 +20,50 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gr_unittest
+import math
+
+
+from gnuradio import gr, gr_unittest, blks2
+# It's pretty ugly that we can't import trellis from gnuradio in this test
+# but because it runs on the non-installed python code it's all a mess.
import trellis
-class test_trellis (gr_unittest.TestCase):
+import os
+import digital_swig
- def setUp (self):
- self.tb = gr.top_block ()
+fsm_args = {"awgn1o2_4": (2, 4, 4,
+ (0, 2, 0, 2, 1, 3, 1, 3),
+ (0, 3, 3, 0, 1, 2, 2, 1),
+ ),
+ "rep2": (2, 1, 4, (0, 0), (0, 3)),
+ "nothing": (2, 1, 2, (0, 0), (0, 1)),
+ }
- def tearDown (self):
- self.tb = None
+constells = {2: digital_swig.constellation_bpsk(),
+ 4: digital_swig.constellation_qpsk(),
+ }
+
+class test_trellis (gr_unittest.TestCase):
def test_001_fsm (self):
- I = 2
- S = 4
- O = 4
- NS = (0, 2, 0, 2, 1, 3, 1, 3)
- OS = (0, 3, 3, 0, 1, 2, 2, 1)
- f = trellis.fsm(I,S,O,NS,OS)
- self.assertEqual((I,S,O,NS,OS),(f.I(),f.S(),f.O(),f.NS(),f.OS()))
+ f = trellis.fsm(*fsm_args["awgn1o2_4"])
+ self.assertEqual(fsm_args["awgn1o2_4"],(f.I(),f.S(),f.O(),f.NS(),f.OS()))
def test_002_fsm (self):
- I = 2
- S = 4
- O = 4
- NS = (0, 2, 0, 2, 1, 3, 1, 3)
- OS = (0, 3, 3, 0, 1, 2, 2, 1)
- f = trellis.fsm(I,S,O,NS,OS)
+ f = trellis.fsm(*fsm_args["awgn1o2_4"])
g = trellis.fsm(f)
self.assertEqual((g.I(),g.S(),g.O(),g.NS(),g.OS()),(f.I(),f.S(),f.O(),f.NS(),f.OS()))
def test_003_fsm (self):
- I = 2
- S = 4
- O = 4
- NS = (0, 2, 0, 2, 1, 3, 1, 3)
- OS = (0, 3, 3, 0, 1, 2, 2, 1)
+ # FIXME: no file "awgn1o2_4.fsm"
#f = trellis.fsm("awgn1o2_4.fsm")
- #self.assertEqual((I,S,O,NS,OS),(f.I(),f.S(),f.O(),f.NS(),f.OS()))
- # temporary fix so that make distcheck does not fail on this
- self.assertEqual(0,0)
+ #self.assertEqual(fsm_args["awgn1o2_4"],(f.I(),f.S(),f.O(),f.NS(),f.OS()))
+ pass
+
+ def test_004_fsm(self):
+ """ Test to make sure fsm works with a single state fsm."""
+ # Just checking that it initializes properly.
+ f = trellis.fsm(*fsm_args["rep2"])
def test_001_interleaver (self):
K = 5
@@ -68,5 +72,69 @@ class test_trellis (gr_unittest.TestCase):
i = trellis.interleaver(K,IN)
self.assertEqual((K,IN,DIN),(i.K(),i.INTER(),i.DEINTER()))
+ def test_001_viterbi(self):
+ """
+ Runs some coding/decoding tests with a few different FSM
+ specs.
+ """
+ for name, args in fsm_args.items():
+ constellation = constells[args[2]]
+ fsms = trellis.fsm(*args)
+ noise = 0.1
+ tb = trellis_tb(constellation, fsms, noise)
+ tb.run()
+ # Make sure all packets succesfully transmitted.
+ self.assertEqual(tb.dst.ntotal(), tb.dst.nright())
+
+
+class trellis_tb(gr.top_block):
+ """
+ A simple top block for use testing gr-trellis.
+ """
+ def __init__(self, constellation, f, N0=0.25, seed=-666L):
+ """
+ constellation - a constellation object used for modulation.
+ f - a finite state machine specification used for coding.
+ N0 - noise level
+ seed - random seed
+ """
+ super(trellis_tb, self).__init__()
+ # packet size in bits (make it multiple of 16 so it can be packed in a short)
+ packet_size = 1024*16
+ # bits per FSM input symbol
+ bitspersymbol = int(round(math.log(f.I())/math.log(2))) # bits per FSM input symbol
+ # packet size in trellis steps
+ K = packet_size/bitspersymbol
+
+ # TX
+ src = gr.lfsr_32k_source_s()
+ # packet size in shorts
+ src_head = gr.head (gr.sizeof_short, packet_size/16)
+ # unpack shorts to symbols compatible with the FSM input cardinality
+ s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol, gr.GR_MSB_FIRST)
+ # initial FSM state = 0
+ enc = trellis.encoder_ss(f, 0)
+ mod = gr.chunks_to_symbols_sc(constellation.points(), 1)
+
+ # CHANNEL
+ add = gr.add_cc()
+ noise = gr.noise_source_c(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)
+
+ # RX
+ # data preprocessing to generate metrics for Viterbi
+ metrics = trellis.constellation_metrics_cf(constellation.base(), digital_swig.TRELLIS_EUCLIDEAN)
+ # Put -1 if the Initial/Final states are not set.
+ va = trellis.viterbi_s(f, K, 0, -1)
+ # pack FSM input symbols to shorts
+ fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol, gr.GR_MSB_FIRST)
+ # check the output
+ self.dst = gr.check_lfsr_32k_s()
+
+ self.connect (src, src_head, s2fsmi, enc, mod)
+ self.connect (mod, (add, 0))
+ self.connect (noise, (add, 1))
+ self.connect (add, metrics, va, fsmi2s, self.dst)
+
+
if __name__ == '__main__':
gr_unittest.run(test_trellis, "test_trellis.xml")
diff --git a/gr-trellis/src/python/run_tests.in b/gr-trellis/src/python/run_tests.in
index 0da3fc1f1..fcb078663 100644
--- a/gr-trellis/src/python/run_tests.in
+++ b/gr-trellis/src/python/run_tests.in
@@ -4,6 +4,8 @@
# 2nd parameter is absolute path to component build directory
# 3rd parameter is path to Python QA directory
+PYTHONPATH=@top_builddir@/gr-digital/swig:@top_builddir@/gr-digital/swig/.libs:@top_srcdir@/gr-digital/swig:$PYTHONPATH
+
@top_builddir@/run_tests.sh \
@abs_top_srcdir@/gr-trellis \
@abs_top_builddir@/gr-trellis \
diff --git a/gr-uhd/Makefile.am b/gr-uhd/Makefile.am
index ea16c863c..56829e9c4 100644
--- a/gr-uhd/Makefile.am
+++ b/gr-uhd/Makefile.am
@@ -21,7 +21,7 @@
include $(top_srcdir)/Makefile.common
-SUBDIRS = include lib apps
+SUBDIRS = include lib apps examples doc
if PYTHON
SUBDIRS += swig grc
diff --git a/gr-uhd/apps/Makefile.am b/gr-uhd/apps/Makefile.am
index 9bb9b6cdd..c30a143c2 100644
--- a/gr-uhd/apps/Makefile.am
+++ b/gr-uhd/apps/Makefile.am
@@ -24,9 +24,13 @@ include $(top_srcdir)/Makefile.common
EXTRA_DIST += \
$(bin_SCRIPTS)
+SUBDIRS = hf_explorer hf_radio
+
ourpythondir = $(grpythondir)
bin_SCRIPTS = \
- uhd_fft.py \
- uhd_rx_cfile.py
-
+ uhd_fft.py \
+ uhd_rx_cfile.py \
+ uhd_siggen.py \
+ uhd_siggen_gui.py \
+ uhd_rx_nogui.py
diff --git a/gnuradio-examples/python/apps/hf_explorer/.gitignore b/gr-uhd/apps/hf_explorer/.gitignore
index b6950912c..b6950912c 100644
--- a/gnuradio-examples/python/apps/hf_explorer/.gitignore
+++ b/gr-uhd/apps/hf_explorer/.gitignore
diff --git a/gnuradio-examples/python/apps/hf_explorer/Makefile.am b/gr-uhd/apps/hf_explorer/Makefile.am
index 88ad52128..c8e7ecb25 100644
--- a/gnuradio-examples/python/apps/hf_explorer/Makefile.am
+++ b/gr-uhd/apps/hf_explorer/Makefile.am
@@ -28,4 +28,4 @@ dist_ourdata_DATA = \
hfx_help
dist_ourdata_SCRIPTS = \
- hfx2.py
+ hfx.py
diff --git a/gr-uhd/apps/hf_explorer/README b/gr-uhd/apps/hf_explorer/README
new file mode 100644
index 000000000..57f45ceba
--- /dev/null
+++ b/gr-uhd/apps/hf_explorer/README
@@ -0,0 +1,42 @@
+hfx.py is meant to be a full-featured Long Wave / Medium Wave
+and Short Wave (250kHz to 30Mhz) AM and Single Sideband receiver.
+It uses the USRP with a Basic RX board, and will need an
+antenna and some preamps, about 30db gain will work. See the
+'Help' menu or hfx_help for more info.
+
+----------------------------------------------------------
+
+Powermate knob supported but not required, tooltip frequency display,
+single click tuning, AGC, record to disk, play from disk and record
+audio. Ability to tailor the audio passband with two sliders over the
+spectrum display. The sliders almost align with the actual
+frequency. Preset filter settings for LSB (-3000 to 0kHz), USB (0 to
++3000kHz), CW (-400 to -800Hz) and AM (-5kHz from carrier to +5kHz).
+
+AM now switches in a synchronous PLL detector with the carriers at
+7.5kHz. The PLL carrier is displayed in the bottom display and helps
+show where on the upper spectrum the demodulated signal
+lies. Everything gets shifted up 7.5kHz in AM, center frequency,
+tooltips, etc. The target AM carrier needs to be closely tuned in, it
+will have a hollow sound untill it is locked, and then the PLL carrier
+in the bottom display will jump up and remain relatively
+constant. There is a slider "AM sync carrier" to play with different
+levels to mix with the signal for demodulation. The filter in AM is
+preset to 2500/12500 (7.5kHz +/- 5kHz) and is handy for removing
+adjacent channel interference. Change AM_SYNC_DISPLAY in script for
+whether to show AM Sync carrier or not.
+
+Run with "-h" for command line help with setting USRP ddc center
+frequency, decimation, rf data record, playback and audio data
+recording.
+
+There are some controls for controlling a varactor and tuning an
+antenna - just ignore them unless you want to build a voltage tuned
+antenna to track frequency.
+
+There is also code for Web based control of frequency and volume - so
+I can tune the radio with an Ipaq from bed. Disabled by default - it
+takes a web server, some directories and scripts to use.
+
+
+
diff --git a/gnuradio-examples/python/apps/hf_explorer/hfx2.py b/gr-uhd/apps/hf_explorer/hfx.py
index 00a3b9047..687adf82b 100755
--- a/gnuradio-examples/python/apps/hf_explorer/hfx2.py
+++ b/gr-uhd/apps/hf_explorer/hfx.py
@@ -1,8 +1,7 @@
#!/usr/bin/env python
-# -*- coding: ANSI_X3.4-1968 -*-
# generated by wxGlade 0.4 on Tue Mar 14 10:16:06 2006
#
-# Copyright 2006 Free Software Foundation, Inc.
+# Copyright 2006,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -81,10 +80,13 @@ AM_SYNC_DISPLAY = False
import os, wx, sys, math
import wx.lib.evtmgr as em
from gnuradio.wxgui import powermate, fftsink2
-from gnuradio import gr, audio, eng_notation, usrp, gru
+from gnuradio import gr, audio, eng_notation
from gnuradio.eng_option import eng_option
+from gnuradio import uhd
from optparse import OptionParser
+n2s = eng_notation.num_to_str
+
ID_BUTTON_1 = wx.NewId() # LSB button
ID_BUTTON_2 = wx.NewId() # USB
ID_BUTTON_3 = wx.NewId() # AM
@@ -111,20 +113,6 @@ ID_SLIDER_7 = wx.NewId() # AT control voltage output
ID_EXIT = wx.NewId() # Menu Exit
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db(0, 0).dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- if u.db(1, 0).dbid() >= 0:
- return (1, 0)
- return (0, 0)
-
-
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
@@ -135,7 +123,8 @@ class MyFrame(wx.Frame):
self.frame_1_menubar = wx.MenuBar()
self.SetMenuBar(self.frame_1_menubar)
wxglade_tmp_menu = wx.Menu()
- self.Exit = wx.MenuItem(wxglade_tmp_menu, ID_EXIT, "Exit", "Exit", wx.ITEM_NORMAL)
+ self.Exit = wx.MenuItem(wxglade_tmp_menu, ID_EXIT, "Exit",
+ "Exit", wx.ITEM_NORMAL)
wxglade_tmp_menu.AppendItem(self.Exit)
self.frame_1_menubar.Append(wxglade_tmp_menu, "File")
# Menu Bar end
@@ -145,9 +134,11 @@ class MyFrame(wx.Frame):
self.button_3 = wx.Button(self, ID_BUTTON_3, "AM")
self.button_4 = wx.Button(self, ID_BUTTON_4, "CW")
self.button_5 = wx.ToggleButton(self, ID_BUTTON_5, "Upper")
- self.slider_1 = wx.Slider(self, ID_SLIDER_1, 0, -15799, 15799, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
+ self.slider_fcutoff_hi = wx.Slider(self, ID_SLIDER_1, 0, -15798, 15799,
+ style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.button_6 = wx.ToggleButton(self, ID_BUTTON_6, "Lower")
- self.slider_2 = wx.Slider(self, ID_SLIDER_2, 0, -15799, 15799, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
+ self.slider_fcutoff_lo = wx.Slider(self, ID_SLIDER_2, 0, -15799, 15798,
+ style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.panel_5 = wx.Panel(self, -1)
self.label_1 = wx.StaticText(self, -1, " Band\nCenter")
self.text_ctrl_1 = wx.TextCtrl(self, ID_TEXT_1, "")
@@ -169,9 +160,11 @@ class MyFrame(wx.Frame):
self.panel_8 = wx.Panel(self, -1)
self.panel_9 = wx.Panel(self, -1)
self.label_3 = wx.StaticText(self, -1, "AM Sync\nCarrier")
- self.slider_6 = wx.Slider(self, ID_SLIDER_6, 50, 0, 200, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
+ self.slider_6 = wx.Slider(self, ID_SLIDER_6, 50, 0, 200,
+ style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.label_4 = wx.StaticText(self, -1, "Antenna Tune")
- self.slider_7 = wx.Slider(self, ID_SLIDER_7, 1575, 950, 2200, style=wx.SL_HORIZONTAL|wx.SL_LABELS)
+ self.slider_7 = wx.Slider(self, ID_SLIDER_7, 1575, 950, 2200,
+ style=wx.SL_HORIZONTAL|wx.SL_LABELS)
self.panel_10 = wx.Panel(self, -1)
self.button_12 = wx.ToggleButton(self, ID_BUTTON_12, "Auto Tune")
self.button_13 = wx.Button(self, ID_BUTTON_13, "Calibrate")
@@ -184,26 +177,30 @@ class MyFrame(wx.Frame):
# end wxGlade
parser = OptionParser (option_class=eng_option)
+ parser.add_option("", "--address", type="string", default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
parser.add_option ("-c", "--ddc-freq", type="eng_float", default=3.9e6,
help="set Rx DDC frequency to FREQ", metavar="FREQ")
+ parser.add_option ("-s", "--samp-rate", type="eng_float", default=256e3,
+ help="set sample rate (bandwidth) [default=%default]")
parser.add_option ("-a", "--audio_file", default="",
help="audio output file", metavar="FILE")
parser.add_option ("-r", "--radio_file", default="",
help="radio output file", metavar="FILE")
parser.add_option ("-i", "--input_file", default="",
help="radio input file", metavar="FILE")
- parser.add_option ("-d", "--decim", type="int", default=250,
- help="USRP decimation")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None, help="select USRP Rx side A or B (default=first one with a daughterboard)")
+ parser.add_option ("-O", "--audio-output", type="string", default="",
+ help="audio output device name. E.g., hw:0,0, /dev/dsp, or pulse")
+
(options, args) = parser.parse_args ()
self.usrp_center = options.ddc_freq
- usb_rate = 64e6 / options.decim
- self.slider_range = usb_rate * 0.9375
+ input_rate = options.samp_rate
+ self.slider_range = input_rate * 0.9375
self.f_lo = self.usrp_center - (self.slider_range/2)
self.f_hi = self.usrp_center + (self.slider_range/2)
self.af_sample_rate = 32000
- fir_decim = long (usb_rate / self.af_sample_rate)
+ fir_decim = long (input_rate / self.af_sample_rate)
# data point arrays for antenna tuner
self.xdata = []
@@ -215,7 +212,7 @@ class MyFrame(wx.Frame):
self.frequency = self.usrp_center
# these map the frequency slider (0-6000) to the actual range
self.f_slider_offset = self.f_lo
- self.f_slider_scale = 10000/options.decim
+ self.f_slider_scale = 10000
self.spin_ctrl_1.SetRange(self.f_lo,self.f_hi)
self.text_ctrl_1.SetValue(str(int(self.usrp_center)))
self.slider_5.SetValue(0)
@@ -245,40 +242,40 @@ class MyFrame(wx.Frame):
else: self.PLAY_FROM_USRP = False
if self.PLAY_FROM_USRP:
- self.src = usrp.source_s(decim_rate=options.decim)
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.src)
- self.src.set_mux(usrp.determine_rx_mux_value(self.src, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.src, options.rx_subdev_spec)
- self.src.tune(0, self.subdev, self.usrp_center)
- self.tune_offset = 0 # -self.usrp_center - self.src.rx_freq(0)
+ self.src = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+ self.src.set_samp_rate(input_rate)
+ input_rate = self.src.get_samp_rate()
+
+ self.src.set_center_freq(self.usrp_center, 0)
+ self.tune_offset = 0
else:
self.src = gr.file_source (gr.sizeof_short,options.input_file)
self.tune_offset = 2200 # 2200 works for 3.5-4Mhz band
+ # convert rf data in interleaved short int form to complex
+ s2ss = gr.stream_to_streams(gr.sizeof_short,2)
+ s2f1 = gr.short_to_float()
+ s2f2 = gr.short_to_float()
+ src_f2c = gr.float_to_complex()
+ self.tb.connect(self.src,s2ss)
+ self.tb.connect((s2ss,0),s2f1)
+ self.tb.connect((s2ss,1),s2f2)
+ self.tb.connect(s2f1,(src_f2c,0))
+ self.tb.connect(s2f2,(src_f2c,1))
+
# save radio data to a file
if SAVE_RADIO_TO_FILE:
- file = gr.file_sink(gr.sizeof_short, options.radio_file)
- self.tb.connect (self.src, file)
+ radio_file = gr.file_sink(gr.sizeof_short, options.radio_file)
+ self.tb.connect (self.src, radio_file)
# 2nd DDC
xlate_taps = gr.firdes.low_pass ( \
- 1.0, usb_rate, 16e3, 4e3, gr.firdes.WIN_HAMMING )
+ 1.0, input_rate, 16e3, 4e3, gr.firdes.WIN_HAMMING )
self.xlate = gr.freq_xlating_fir_filter_ccf ( \
- fir_decim, xlate_taps, self.tune_offset, usb_rate )
-
- # convert rf data in interleaved short int form to complex
- s2ss = gr.stream_to_streams(gr.sizeof_short,2)
- s2f1 = gr.short_to_float()
- s2f2 = gr.short_to_float()
- src_f2c = gr.float_to_complex()
- self.tb.connect(self.src,s2ss)
- self.tb.connect((s2ss,0),s2f1)
- self.tb.connect((s2ss,1),s2f2)
- self.tb.connect(s2f1,(src_f2c,0))
- self.tb.connect(s2f2,(src_f2c,1))
-
+ fir_decim, xlate_taps, self.tune_offset, input_rate )
# Complex Audio filter
audio_coeffs = gr.firdes.complex_band_pass (
@@ -288,17 +285,22 @@ class MyFrame(wx.Frame):
0, # high cutoff
100, # transition
gr.firdes.WIN_HAMMING) # window
- self.slider_1.SetValue(0)
- self.slider_2.SetValue(-3000)
+ self.slider_fcutoff_hi.SetValue(0)
+ self.slider_fcutoff_lo.SetValue(-3000)
- self.audio_filter = gr.fir_filter_ccc ( 1, audio_coeffs)
+ self.audio_filter = gr.fir_filter_ccc(1, audio_coeffs)
# Main +/- 16Khz spectrum display
- self.fft = fftsink2.fft_sink_c (self.panel_2, fft_size=512, sample_rate=self.af_sample_rate, average=True, size=(640,240))
+ self.fft = fftsink2.fft_sink_c(self.panel_2, fft_size=512,
+ sample_rate=self.af_sample_rate,
+ average=True, size=(640,240))
# AM Sync carrier
if AM_SYNC_DISPLAY:
- self.fft2 = fftsink.fft_sink_c (self.tb, self.panel_9, y_per_div=20, fft_size=512, sample_rate=self.af_sample_rate, average=True, size=(640,240))
+ self.fft2 = fftsink.fft_sink_c(self.tb, self.panel_9,
+ y_per_div=20, fft_size=512,
+ sample_rate=self.af_sample_rate,
+ average=True, size=(640,240))
c2f = gr.complex_to_float()
@@ -307,7 +309,8 @@ class MyFrame(wx.Frame):
# the following frequencies turn out to be in radians/sample
# gr.pll_refout_cc(alpha,beta,min_freq,max_freq)
# suggested alpha = X, beta = .25 * X * X
- pll = gr.pll_refout_cc(.5,.0625,(2.*math.pi*7.5e3/self.af_sample_rate),(2.*math.pi*6.5e3/self.af_sample_rate))
+ pll = gr.pll_refout_cc(.5,.0625,(2.*math.pi*7.5e3/self.af_sample_rate),
+ (2.*math.pi*6.5e3/self.af_sample_rate))
self.pll_carrier_scale = gr.multiply_const_cc(complex(10,0))
am_det = gr.multiply_cc()
# these are for converting +7.5kHz to -7.5kHz
@@ -327,7 +330,7 @@ class MyFrame(wx.Frame):
100, # transition
gr.firdes.WIN_HAMMING) # window
- self.pll_carrier_filter = gr.fir_filter_ccc ( 1, pll_carrier_coeffs)
+ self.pll_carrier_filter = gr.fir_filter_ccc (1, pll_carrier_coeffs)
self.sel_sb = gr.multiply_const_ff(1)
combine = gr.add_ff()
@@ -338,20 +341,29 @@ class MyFrame(wx.Frame):
offset = gr.add_const_ff(1)
agc = gr.divide_ff()
-
self.scale = gr.multiply_const_ff(0.00001)
- dst = audio.sink(long(self.af_sample_rate))
+ dst = audio.sink(long(self.af_sample_rate),
+ options.audio_output)
+
+
+ if self.PLAY_FROM_USRP:
+ self.tb.connect(self.src, self.xlate, self.fft)
+ else:
+ self.tb.connect(src_f2c, self.xlate, self.fft)
- self.tb.connect(src_f2c,self.xlate,self.fft)
self.tb.connect(self.xlate,self.audio_filter,self.sel_am,(am_det,0))
- self.tb.connect(self.sel_am,pll,self.pll_carrier_scale,self.pll_carrier_filter,c2f3)
+ self.tb.connect(self.sel_am,pll,self.pll_carrier_scale,
+ self.pll_carrier_filter,c2f3)
self.tb.connect((c2f3,0),phaser1,(f2c,0))
self.tb.connect((c2f3,1),phaser2,(f2c,1))
self.tb.connect(f2c,(am_det,1))
self.tb.connect(am_det,c2f2,(combine,0))
- self.tb.connect(self.audio_filter,c2f,self.sel_sb,(combine,1))
+ self.tb.connect(self.audio_filter,c2f,
+ self.sel_sb,(combine,1))
+
if AM_SYNC_DISPLAY:
self.tb.connect(self.pll_carrier_filter,self.fft2)
+
self.tb.connect(combine,self.scale)
self.tb.connect(self.scale,(sqr1,0))
self.tb.connect(self.scale,(sqr1,1))
@@ -368,9 +380,9 @@ class MyFrame(wx.Frame):
self.tb.start()
# for mouse position reporting on fft display
- em.eventManager.Register(self.Mouse, wx.EVT_MOTION, self.fft.win)
+ self.fft.win.Bind(wx.EVT_LEFT_UP, self.Mouse)
# and left click to re-tune
- em.eventManager.Register(self.Click, wx.EVT_LEFT_DOWN, self.fft.win)
+ self.fft.win.Bind(wx.EVT_LEFT_DOWN, self.Click)
# start a timer to check for web commands
if WEB_CONTROL:
@@ -403,9 +415,9 @@ class MyFrame(wx.Frame):
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
- self.SetTitle("HF Explorer 2")
- self.slider_1.SetMinSize((450, 38))
- self.slider_2.SetMinSize((450, 38))
+ self.SetTitle("HF Explorer")
+ self.slider_fcutoff_hi.SetMinSize((450, 38))
+ self.slider_fcutoff_lo.SetMinSize((450, 38))
self.panel_2.SetMinSize((640, 240))
self.button_7.SetValue(1)
self.slider_3.SetMinSize((450, 19))
@@ -434,11 +446,14 @@ class MyFrame(wx.Frame):
sizer_2.Add(self.button_4, 0, wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
grid_sizer_1.Add(self.button_5, 0, wx.ADJUST_MINSIZE, 0)
- grid_sizer_1.Add(self.slider_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
+ grid_sizer_1.Add(self.slider_fcutoff_hi, 0,
+ wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(self.button_6, 0, wx.ADJUST_MINSIZE, 0)
- grid_sizer_1.Add(self.slider_2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
+ grid_sizer_1.Add(self.slider_fcutoff_lo, 0,
+ wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
sizer_6.Add(self.panel_5, 1, wx.EXPAND, 0)
- sizer_6.Add(self.label_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
+ sizer_6.Add(self.label_1, 0,
+ wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
sizer_6.Add(self.text_ctrl_1, 0, wx.ADJUST_MINSIZE, 0)
sizer_6.Add(self.panel_6, 1, wx.EXPAND, 0)
sizer_6.Add(self.panel_7, 1, wx.EXPAND, 0)
@@ -461,9 +476,11 @@ class MyFrame(wx.Frame):
grid_sizer_1.Add(sizer_5, 1, wx.EXPAND, 0)
grid_sizer_1.Add(self.panel_8, 1, wx.EXPAND, 0)
grid_sizer_1.Add(self.panel_9, 1, wx.EXPAND, 0)
- grid_sizer_1.Add(self.label_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
+ grid_sizer_1.Add(self.label_3, 0,
+ wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(self.slider_6, 0, wx.ADJUST_MINSIZE, 0)
- grid_sizer_1.Add(self.label_4, 0, wx.ALIGN_BOTTOM|wx.ADJUST_MINSIZE, 0)
+ grid_sizer_1.Add(self.label_4, 0,
+ wx.ALIGN_BOTTOM|wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(self.slider_7, 0, wx.ADJUST_MINSIZE, 0)
grid_sizer_1.Add(self.panel_10, 1, wx.EXPAND, 0)
sizer_7.Add(self.button_12, 0, wx.ADJUST_MINSIZE, 0)
@@ -488,14 +505,14 @@ class MyFrame(wx.Frame):
# Powermate being turned
def on_rotate(self, event):
if self.active_button == 5:
- self.slider_1.SetValue(self.slider_1.GetValue()+event.delta)
- if self.slider_2.GetValue() > (self.slider_1.GetValue() - 200) :
- self.slider_2.SetValue(self.slider_1.GetValue() - 200)
+ self.slider_fcutoff_hi.SetValue(self.slider_fcutoff_hi.GetValue()+event.delta)
+ if self.slider_fcutoff_lo.GetValue() > (self.slider_fcutoff_hi.GetValue() - 200) :
+ self.slider_fcutoff_lo.SetValue(self.slider_fcutoff_hi.GetValue() - 200)
self.filter()
if self.active_button == 6:
- self.slider_2.SetValue(self.slider_2.GetValue()+event.delta)
- if self.slider_1.GetValue() < (self.slider_2.GetValue() + 200) :
- self.slider_1.SetValue(self.slider_2.GetValue() + 200)
+ self.slider_fcutoff_lo.SetValue(self.slider_fcutoff_lo.GetValue()+event.delta)
+ if self.slider_fcutoff_hi.GetValue() < (self.slider_fcutoff_lo.GetValue() + 200) :
+ self.slider_fcutoff_hi.SetValue(self.slider_fcutoff_lo.GetValue() + 200)
self.filter()
if self.active_button == 7:
new = max(0, min(6000, self.slider_3.GetValue() + event.delta))
@@ -581,14 +598,14 @@ class MyFrame(wx.Frame):
# Make sure filter settings are legal
def set_filter(self, event):
slider = event.GetId()
- slider1 = self.slider_1.GetValue()
- slider2 = self.slider_2.GetValue()
+ slider1 = self.slider_fcutoff_hi.GetValue()
+ slider2 = self.slider_fcutoff_lo.GetValue()
if slider == ID_SLIDER_1:
- if slider2 > (self.slider_1.GetValue() - 200) :
- self.slider_2.SetValue(slider1 - 200)
+ if slider2 > (self.slider_fcutoff_hi.GetValue() - 200) :
+ self.slider_fcutoff_lo.SetValue(slider1 - 200)
elif slider == ID_SLIDER_2:
- if slider1 < (self.slider_2.GetValue() + 200) :
- self.slider_1.SetValue(slider2 + 200)
+ if slider1 < (self.slider_fcutoff_lo.GetValue() + 200) :
+ self.slider_fcutoff_hi.SetValue(slider2 + 200)
self.filter()
# Calculate taps and apply
@@ -596,8 +613,8 @@ class MyFrame(wx.Frame):
audio_coeffs = gr.firdes.complex_band_pass (
1.0, # gain
self.af_sample_rate, # sample rate
- self.slider_2.GetValue(), # low cutoff
- self.slider_1.GetValue(), # high cutoff
+ self.slider_fcutoff_lo.GetValue(), # low cutoff
+ self.slider_fcutoff_hi.GetValue(), # high cutoff
100, # transition
gr.firdes.WIN_HAMMING) # window
self.audio_filter.set_taps(audio_coeffs)
@@ -607,8 +624,8 @@ class MyFrame(wx.Frame):
self.xlate.set_center_freq( self.usrp_center - (self.frequency - self.tune_offset))
self.sel_sb.set_k(1)
self.sel_am.set_k(0)
- self.slider_1.SetValue(0)
- self.slider_2.SetValue(-3000)
+ self.slider_fcutoff_hi.SetValue(0)
+ self.slider_fcutoff_lo.SetValue(-3000)
self.filter()
def set_usb(self, event):
@@ -616,8 +633,8 @@ class MyFrame(wx.Frame):
self.xlate.set_center_freq( self.usrp_center - (self.frequency - self.tune_offset))
self.sel_sb.set_k(1)
self.sel_am.set_k(0)
- self.slider_1.SetValue(3000)
- self.slider_2.SetValue(0)
+ self.slider_fcutoff_hi.SetValue(3000)
+ self.slider_fcutoff_lo.SetValue(0)
self.filter()
def set_am(self, event):
@@ -625,8 +642,8 @@ class MyFrame(wx.Frame):
self.xlate.set_center_freq( self.usrp_center - (self.frequency - self.tune_offset - 7.5e3))
self.sel_sb.set_k(0)
self.sel_am.set_k(1)
- self.slider_1.SetValue(12500)
- self.slider_2.SetValue(2500)
+ self.slider_fcutoff_hi.SetValue(12500)
+ self.slider_fcutoff_lo.SetValue(2500)
self.filter()
def set_cw(self, event):
@@ -635,8 +652,8 @@ class MyFrame(wx.Frame):
self.AM_mode = False
self.sel_sb.set_k(1)
self.sel_am.set_k(0)
- self.slider_1.SetValue(-400)
- self.slider_2.SetValue(-800)
+ self.slider_fcutoff_hi.SetValue(-400)
+ self.slider_fcutoff_lo.SetValue(-800)
self.filter()
def set_volume(self, event):
@@ -644,7 +661,7 @@ class MyFrame(wx.Frame):
def set_pga(self,event):
if self.PLAY_FROM_USRP:
- self.subdev.set_gain(self.slider_5.GetValue())
+ self.src.set_gain(self.slider_5.GetValue())
def slide_tune(self, event):
self.frequency = (self.f_slider_scale * self.slider_3.GetValue()) + self.f_slider_offset
@@ -731,8 +748,11 @@ class MyFrame(wx.Frame):
# Slider to set loop antenna capacitance
def antenna_tune(self, evt):
if self.PLAY_FROM_USRP:
- self.src.write_aux_dac(0,3,self.slider_7.GetValue())
-
+ dev = self.src.get_dboard_iface()
+ dev.write_aux_dac(uhd.dboard_iface.UNIT_RX,
+ uhd.dboard_iface.AUX_DAC_C,
+ float(self.slider_7.GetValue()))
+
# Timer events - check for web commands
def OnUpdate(self):
cmds = os.listdir("/var/www/cgi-bin/commands/")
@@ -791,11 +811,13 @@ class UpdateTimer(wx.Timer):
class MyApp(wx.App):
def OnInit(self):
- frame = MyFrame(None, -1, "HF Explorer 2")
+ frame = MyFrame(None, -1, "HF Explorer")
frame.Show(True)
self.SetTopWindow(frame)
return True
-app = MyApp(0)
-app.MainLoop()
+
+if __name__ == "__main__":
+ app = MyApp(0)
+ app.MainLoop()
diff --git a/gnuradio-examples/python/apps/hf_explorer/hfx_help b/gr-uhd/apps/hf_explorer/hfx_help
index 9a52dd2bb..9a52dd2bb 100644
--- a/gnuradio-examples/python/apps/hf_explorer/hfx_help
+++ b/gr-uhd/apps/hf_explorer/hfx_help
diff --git a/gnuradio-examples/python/apps/hf_radio/.gitignore b/gr-uhd/apps/hf_radio/.gitignore
index b6950912c..b6950912c 100644
--- a/gnuradio-examples/python/apps/hf_radio/.gitignore
+++ b/gr-uhd/apps/hf_radio/.gitignore
diff --git a/gnuradio-examples/python/apps/hf_radio/Makefile.am b/gr-uhd/apps/hf_radio/Makefile.am
index e514076f6..e514076f6 100644
--- a/gnuradio-examples/python/apps/hf_radio/Makefile.am
+++ b/gr-uhd/apps/hf_radio/Makefile.am
diff --git a/gnuradio-examples/python/apps/hf_radio/README.TXT b/gr-uhd/apps/hf_radio/README.TXT
index 7c7edf5e0..7c7edf5e0 100644
--- a/gnuradio-examples/python/apps/hf_radio/README.TXT
+++ b/gr-uhd/apps/hf_radio/README.TXT
diff --git a/gnuradio-examples/python/apps/hf_radio/hfir.sci b/gr-uhd/apps/hf_radio/hfir.sci
index a2d5e2a62..a2d5e2a62 100644
--- a/gnuradio-examples/python/apps/hf_radio/hfir.sci
+++ b/gr-uhd/apps/hf_radio/hfir.sci
diff --git a/gr-uhd/apps/hf_radio/input.py b/gr-uhd/apps/hf_radio/input.py
new file mode 100644
index 000000000..2626ddfb5
--- /dev/null
+++ b/gr-uhd/apps/hf_radio/input.py
@@ -0,0 +1,78 @@
+# 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.
+#
+
+# Basic USRP setup and control.
+# It's only ever been tried with a basic rx daughter card.
+#
+# Imagine that the gnuradio boilerplate is here.
+#
+# M. Revnell 2005-Dec
+
+from gnuradio import gr
+from gnuradio import uhd
+
+class uhd_input(gr.hier_block2):
+ def __init__( self, address, samp_rate):
+ gr.hier_block2.__init__(self, "uhd_input",
+ gr.io_signature(0,0,0),
+ gr.io_signature(1,1,gr.sizeof_gr_complex))
+
+ self.src = uhd.usrp_source(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self.src.set_samp_rate(samp_rate)
+ self.usrp_rate = self.src.get_samp_rate()
+
+ self.connect(self.src, self)
+
+ def set_freq(self, target_freq):
+ """
+ Set the center frequency.
+
+ @param target_freq: frequency in Hz
+ @type: bool
+ """
+ r = self.src.set_center_freq(target_freq, 0)
+
+ if r:
+ self.freq = target_freq
+ return True
+ else:
+ return False
+
+ def get_freq(self):
+ return self.src.get_center_freq(0)
+
+ def set_gain(self, gain):
+ self.gain = gain
+ self.src.set_gain(gain, 0)
+
+ def add_options(parser):
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-f", "--freq", type="eng_float", default=None,
+ help="set frequency to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
+ add_options = staticmethod(add_options)
diff --git a/gr-radar-mono/src/fpga/top/Makefile.am b/gr-uhd/apps/hf_radio/output.py
index 51f73ebfe..8ee7dc54c 100644
--- a/gr-radar-mono/src/fpga/top/Makefile.am
+++ b/gr-uhd/apps/hf_radio/output.py
@@ -1,5 +1,4 @@
-#
-# Copyright 2007,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,30 +18,25 @@
# Boston, MA 02110-1301, USA.
#
-include $(top_srcdir)/Makefile.common
-RBFS = usrp_radar_mono.rbf
+# Audio output with a volume control.
+#
+# M. Revnell 2005-Dec
-rbf2datadir = $(prefix)/share/usrp/rev2
-dist_rbf2data_DATA = $(RBFS)
+from gnuradio import gr, gru
+from gnuradio import audio
-rbf4datadir = $(prefix)/share/usrp/rev4
-dist_rbf4data_DATA = $(RBFS)
+class output( gr.hier_block2 ):
+ def __init__( self, rate, device ):
+ gr.hier_block2.__init__(self, "output",
+ gr.io_signature(1,1,gr.sizeof_float),
+ gr.io_signature(0,0,0))
+
+ self.vol = gr.multiply_const_ff( 0.1 )
+ self.out = audio.sink( int(rate), device )
-EXTRA_DIST += \
- usrp_radar_mono.csf \
- usrp_radar_mono.esf \
- usrp_radar_mono.psf \
- usrp_radar_mono.qpf \
- usrp_radar_mono.qsf \
- usrp_radar_mono.v
+ self.connect( self, self.vol, self.out )
-MOSTLYCLEANFILES += \
- db/* \
- *.rpt \
- *.summary \
- *.qws \
- *.smsg \
- *.done \
- *.pin \
- *.sof
+ def set( self, val ):
+ self.vol.set_k( val )
+
diff --git a/gnuradio-examples/python/apps/hf_radio/radio.py b/gr-uhd/apps/hf_radio/radio.py
index 9f444b916..32e26c7eb 100755
--- a/gnuradio-examples/python/apps/hf_radio/radio.py
+++ b/gr-uhd/apps/hf_radio/radio.py
@@ -1,11 +1,29 @@
#!/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.
+#
# GUI interactions and high level connections handled here.
#
# Interacts with classes defined by wxGlade in ui.py.
#
-# The usual gnuradio copyright boilerplate incorperated here by reference.
-#
# M. Revnell 2006-Jan
from threading import *
@@ -15,11 +33,11 @@ import time
from gnuradio import gr, gru, eng_notation, optfir
from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks
-from gnuradio.wxgui import fftsink
-from gnuradio.wxgui import waterfallsink
-from gnuradio.wxgui import scopesink
+from gnuradio import uhd
+from gnuradio import blks2
+from gnuradio.wxgui import fftsink2
+from gnuradio.wxgui import waterfallsink2
+from gnuradio.wxgui import scopesink2
from input import *
from output import *
@@ -28,35 +46,36 @@ from ssbagc import *
from ui import *
from math import log10
-class graph( gr.hier_block ):
- def __init__( self, fg ):
- self.graph = fg
- self.fe_decim = 250
- self.src = input( self.fe_decim )
- self.adc_rate = self.src.adc_rate
- self.fe_rate = self.adc_rate / self.fe_decim
+class radio_top_block( gr.top_block ):
+ def __init__( self ):
+ gr.top_block.__init__(self, "radio_top_block")
+
+ self.address = "addr=192.168.11.2"
+ self.samp_rate = 256e3
+ self.freq = -2.5e6
+ self.gain = 0
+ self.src = uhd_input( self.address,
+ self.samp_rate)
+ self.src.set_freq(self.freq)
+ self.src.set_gain(self.gain)
+
+ self.fe_rate = self.src.usrp_rate
self.filter_decim = 1
self.audio_decim = 16
self.demod_rate = self.fe_rate / self.filter_decim
self.audio_rate = self.demod_rate / self.audio_decim
+ self.audio_dev = "pulse"
- self.demod = ssb_demod( fg, self.demod_rate, self.audio_rate )
- self.agc = agc( fg )
- #self.agc = gr.agc_ff()
- self.out = output( fg, self.audio_rate )
+ self.demod = ssb_demod( self.demod_rate, self.audio_rate )
+ self.agc = agc()
+ self.out = output( self.audio_rate, self.audio_dev )
- fg.connect( self.src.src,
- self.demod,
- self.agc,
- self.out )
-
- gr.hier_block.__init__( self, fg, None, None )
+ self.connect( self.src, self.demod, self.agc, self.out )
def tune( self, freq ):
fe_target = -freq
self.src.set_freq( fe_target )
- fe_freq = self.src.src.rx_freq( 0 )
- demod_cf = fe_target - fe_freq
+ demod_cf = fe_target - self.src.get_freq()
self.demod.tune( demod_cf )
class radio_frame( ui_frame ):
@@ -88,35 +107,30 @@ class radio_frame( ui_frame ):
agc_ref = self.block.agc.offs.k()
self.agc_ref.SetValue( str( agc_ref ) )
self.agc_ref_s.SetValue( 5 )
-
- self.fespectrum = fftsink.fft_sink_c(
- self.block.graph,
+
+ self.fespectrum = fftsink2.fft_sink_c(
self.fe_panel,
fft_size=512,
sample_rate = block.fe_rate,
- baseband_freq = 0,
- average = False,
- size = ( 680, 140 ) )
+ ref_scale = 1.0,
+ ref_level = 20.0,
+ y_divs = 12,
+ avg_alpha = 0.1)
- self.ifspectrum = fftsink.fft_sink_c(
- self.block.graph,
+ self.ifspectrum = fftsink2.fft_sink_c(
self.if_panel,
fft_size=512,
sample_rate = block.audio_rate,
- baseband_freq = 0,
- average = False,
- size = ( 680, 140 ) )
-
- em.eventManager.Register( self.fe_mouse,
- wx.EVT_MOTION,
- self.fespectrum.win )
+ ref_scale = 1.0,
+ ref_level = 20.0,
+ y_divs = 12,
+ avg_alpha = 0.1)
- em.eventManager.Register( self.fe_click,
- wx.EVT_LEFT_DOWN,
- self.fespectrum.win )
+ self.fespectrum.win.Bind( wx.EVT_MOTION, self.fe_mouse)
+ self.fespectrum.win.Bind( wx.EVT_LEFT_DOWN, self.fe_click)
- block.graph.connect( block.src.src, self.fespectrum )
- block.graph.connect( block.demod.xlate, self.ifspectrum )
+ block.connect( block.src.src, self.fespectrum )
+ block.connect( block.demod.xlate, self.ifspectrum )
def agc_ref_up( self, event ):
self.agc_ref_s.SetValue( 5 )
@@ -232,7 +246,7 @@ class radio_frame( ui_frame ):
self.tune( self.freq_disp.GetValue() - 1e6 )
def event_pga( self, event ):
- self.block.src.src.set_pga( 0, self.pga.GetValue())
+ self.block.src.set_gain(self.pga.GetValue())
def event_vol( self, event ):
self.block.out.set( self.volume.GetValue()/20.0 )
@@ -267,38 +281,39 @@ class radio_frame( ui_frame ):
class radio( wx.App ):
def OnInit( self ):
- self.graph = gr.flow_graph()
- self.block = graph( self.graph )
- self.frame = radio_frame( self.block, None, -1, "Title" )
+ self.block = radio_top_block()
+ self.frame = radio_frame( self.block, None, -1, "HF Receiver" )
self.frame.Show( True )
self.SetTopWindow( self.frame )
+ self.block.start()
return True
-a=radio( 0 )
-
-l=gr.probe_signal_f()
-#l=gr.probe_avg_mag_sqrd_f(1,.001)
-a.graph.connect(a.block.agc.offs,l )
-#a.graph.connect(a.block.demod,l)
-
-def main_function():
- global a
- a.MainLoop()
-
-
def rssi_function():
- global a
- global l
- while 1:
- level = l.level()
- wx.CallAfter( a.frame.setrssi, level )
- time.sleep( .1 )
-
-thread1 = Thread( target = main_function )
-thread2 = Thread( target = rssi_function )
-
-thread1.start()
-thread2.start()
-
-a.graph.start()
+ global radio_obj
+ global sig_probe
+
+ go = True
+ while go:
+ try:
+ level = sig_probe.level()
+ wx.CallAfter( radio_obj.frame.setrssi, level )
+ time.sleep( .1 )
+ except:
+ go = False
+
+def main():
+ global radio_obj, sig_probe
+
+ radio_obj = radio( 0 )
+ sig_probe = gr.probe_signal_f()
+ radio_obj.block.connect(radio_obj.block.agc.offs, sig_probe)
+
+ thread2 = Thread( target = rssi_function )
+ thread2.start()
+
+ radio_obj.MainLoop()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/gnuradio-examples/python/apps/hf_radio/radio.xml b/gr-uhd/apps/hf_radio/radio.xml
index 81daa19b0..81daa19b0 100644
--- a/gnuradio-examples/python/apps/hf_radio/radio.xml
+++ b/gr-uhd/apps/hf_radio/radio.xml
diff --git a/gnuradio-examples/python/apps/hf_radio/ssb_taps b/gr-uhd/apps/hf_radio/ssb_taps
index 0ef3bbf26..0ef3bbf26 100644
--- a/gnuradio-examples/python/apps/hf_radio/ssb_taps
+++ b/gr-uhd/apps/hf_radio/ssb_taps
diff --git a/gr-uhd/apps/hf_radio/ssbagc.py b/gr-uhd/apps/hf_radio/ssbagc.py
new file mode 100644
index 000000000..494712863
--- /dev/null
+++ b/gr-uhd/apps/hf_radio/ssbagc.py
@@ -0,0 +1,70 @@
+# 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.
+
+
+# post detection agc processing
+#
+# This agc strategy is copied more or less verbatim from
+# weaver_isb_am1_usrp3.py by cswiger.
+#
+# Thanks.
+#
+# Then modified in a variety of ways.
+#
+# There doesn't appear to be a way to hook multiple blocks to the
+# input port when building a hier block like this. Thus the
+# split below.
+#
+# Basic operation.
+# Power is estimated by squaring the input.
+# Low pass filter using a 1 pole iir.
+# The time constant can be tweaked by changing the taps.
+# Currently there is no implementation to change this while operating
+# a potentially useful addition.
+# The log block turns this into dB
+# gain adjusts the agc authority.
+#
+# M. Revnell 2006-Jan
+
+from gnuradio import gr
+
+class agc( gr.hier_block2 ):
+ def __init__( self ):
+ gr.hier_block2.__init__(self, "agc",
+ gr.io_signature(1,1,gr.sizeof_float),
+ gr.io_signature(1,1,gr.sizeof_float))
+
+ self.split = gr.multiply_const_ff( 1 )
+ self.sqr = gr.multiply_ff( )
+ self.int0 = gr.iir_filter_ffd( [.004, 0], [0, .999] )
+ self.offs = gr.add_const_ff( -30 )
+ self.gain = gr.multiply_const_ff( 70 )
+ self.log = gr.nlog10_ff( 10, 1 )
+ self.agc = gr.divide_ff( )
+
+ self.connect(self, self.split)
+ self.connect(self.split, (self.agc, 0))
+ self.connect(self.split, (self.sqr, 0))
+ self.connect(self.split, (self.sqr, 1))
+ self.connect(self.sqr, self.int0)
+ self.connect(self.int0, self.log)
+ self.connect(self.log, self.offs)
+ self.connect(self.offs, self.gain)
+ self.connect(self.gain, (self.agc, 1))
+ self.connect(self.agc, self)
diff --git a/gnuradio-examples/python/apps/hf_radio/ssbdemod.py b/gr-uhd/apps/hf_radio/ssbdemod.py
index c73567b66..072d317a2 100644
--- a/gnuradio-examples/python/apps/hf_radio/ssbdemod.py
+++ b/gr-uhd/apps/hf_radio/ssbdemod.py
@@ -1,8 +1,26 @@
+# 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.
+#
+
# This tries to push the hilbert transform for ssb demod back into the
# freq. xlating filter.
#
-# The usual gnuradio copyright notice is hereby included by reference.
-#
# The starting point for this was weaver_isb_am1_usrp3.py.
#
# The tap coefficients for freq_xlating_fir_filter_ccf were generated
@@ -13,16 +31,17 @@
# They were generated using Scilab which I am already familiar with.
# M. Revnell Jan 06
-from gnuradio import gr, gru
-from gnuradio import audio
-from gnuradio import usrp
+from gnuradio import gr
-class ssb_demod( gr.hier_block ):
- def __init__( self, fg, if_rate, af_rate ):
+class ssb_demod( gr.hier_block2 ):
+ def __init__( self, if_rate, af_rate ):
+ gr.hier_block2.__init__(self, "ssb_demod",
+ gr.io_signature(1,1,gr.sizeof_gr_complex),
+ gr.io_signature(1,1,gr.sizeof_float))
- self.if_rate = if_rate
- self.af_rate = af_rate
- self.if_decim = if_rate / af_rate
+ self.if_rate = int(if_rate)
+ self.af_rate = int(af_rate)
+ self.if_decim = int(if_rate / af_rate)
self.sideband = 1
self.xlate_taps = ([complex(v) for v in file('ssb_taps').readlines()])
@@ -51,17 +70,17 @@ class ssb_demod( gr.hier_block ):
self.mixer = gr.add_ff()
self.am_det = gr.complex_to_mag()
- fg.connect( self.xlate, self.split )
- fg.connect( ( self.split,0 ), ( self.sum,0 ) )
- fg.connect( ( self.split,1 ), ( self.sum,1 ) )
- fg.connect( self.sum, self.sb_sel )
- fg.connect( self.xlate, self.am_det )
- fg.connect( self.sb_sel, ( self.mixer, 0 ) )
- fg.connect( self.am_det, self.am_sel )
- fg.connect( self.am_sel, ( self.mixer, 1 ) )
- fg.connect( self.mixer, self.lpf )
-
- gr.hier_block.__init__( self, fg, self.xlate, self.lpf )
+ self.connect(self, self.xlate)
+ self.connect(self.xlate, self.split)
+ self.connect((self.split, 0), (self.sum, 0))
+ self.connect((self.split, 1), (self.sum, 1))
+ self.connect(self.sum, self.sb_sel)
+ self.connect(self.xlate, self.am_det)
+ self.connect(self.sb_sel, (self.mixer, 0))
+ self.connect(self.am_det, self.am_sel)
+ self.connect(self.am_sel, (self.mixer, 1))
+ self.connect(self.mixer, self.lpf)
+ self.connect(self.lpf, self)
def upper_sb( self ):
self.xlate.set_taps([v.conjugate() for v in self.xlate_taps])
diff --git a/gnuradio-examples/python/apps/hf_radio/startup.py b/gr-uhd/apps/hf_radio/startup.py
index 093369b57..093369b57 100644
--- a/gnuradio-examples/python/apps/hf_radio/startup.py
+++ b/gr-uhd/apps/hf_radio/startup.py
diff --git a/gnuradio-examples/python/apps/hf_radio/ui.py b/gr-uhd/apps/hf_radio/ui.py
index 71b73c128..551a30415 100755
--- a/gnuradio-examples/python/apps/hf_radio/ui.py
+++ b/gr-uhd/apps/hf_radio/ui.py
@@ -1,4 +1,25 @@
#!/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.
+#
+
# -*- coding: UTF-8 -*-
# generated by wxGlade 0.4 on Mon Jan 2 19:02:03 2006
diff --git a/gr-uhd/apps/uhd_fft.py b/gr-uhd/apps/uhd_fft.py
index 87952ef3a..0f0c274e8 100755
--- a/gr-uhd/apps/uhd_fft.py
+++ b/gr-uhd/apps/uhd_fft.py
@@ -20,16 +20,23 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru
+from gnuradio import gr
from gnuradio import uhd
from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
from optparse import OptionParser
-import wx
+
import sys
import numpy
+try:
+ from gnuradio.wxgui import stdgui2, form, slider
+ from gnuradio.wxgui import fftsink2, waterfallsink2, scopesink2
+ import wx
+except ImportError:
+ sys.stderr.write("Error importing GNU Radio's wxgui. Please make sure gr-wxgui is installed.\n")
+ sys.exit(1)
+
class app_top_block(stdgui2.std_top_block):
def __init__(self, frame, panel, vbox, argv):
stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
@@ -38,7 +45,8 @@ class app_top_block(stdgui2.std_top_block):
self.panel = panel
parser = OptionParser(option_class=eng_option)
- parser.add_option("-a", "--address", type="string", default="addr=192.168.10.2",
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
help="Address of UHD device, [default=%default]")
parser.add_option("-A", "--antenna", type="string", default=None,
help="select Rx Antenna where appropriate")
@@ -74,7 +82,8 @@ class app_top_block(stdgui2.std_top_block):
if options.waterfall:
self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=1024, sample_rate=input_rate)
+ waterfallsink2.waterfall_sink_c (panel, fft_size=1024,
+ sample_rate=input_rate)
self.frame.SetMinSize((800, 420))
elif options.oscilloscope:
self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
@@ -114,9 +123,8 @@ class app_top_block(stdgui2.std_top_block):
if self.show_debug_info:
self.myform['samprate'].set_value(self.u.get_samp_rate())
- self.myform['fs@gbe'].set_value(input_rate)
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
+ self.myform['rffreq'].set_value(0)
+ self.myform['dspfreq'].set_value(0)
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
@@ -137,14 +145,16 @@ class app_top_block(stdgui2.std_top_block):
hbox.Add((5,0), 0, 0)
myform['freq'] = form.float_field(
parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
+ callback=myform.check_input_and_call(_form_set_freq,
+ self._set_status_msg))
hbox.Add((5,0), 0, 0)
g = self.u.get_gain_range()
# some configurations don't have gain control
if g.stop() > g.start():
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
+ myform['gain'] = form.slider_field(parent=self.panel,
+ sizer=hbox, label="Gain",
weight=3,
min=int(g.start()), max=int(g.stop()),
callback=self.set_gain)
@@ -175,19 +185,16 @@ class app_top_block(stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['samprate'] = form.float_field(
parent=panel, sizer=hbox, label="Sample Rate",
- callback=myform.check_input_and_call(_form_set_samp_rate, self._set_status_msg))
+ callback=myform.check_input_and_call(_form_set_samp_rate,
+ self._set_status_msg))
hbox.Add((5,0), 1)
- myform['fs@gbe'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@GbE")
+ myform['rffreq'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="RF Freq.")
hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
+ myform['dspfreq'] = form.static_float_field(
+ parent=panel, sizer=hbox, label="DSP Freq.")
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -198,19 +205,13 @@ class app_top_block(stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
r = self.u.set_center_freq(target_freq, 0)
if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
- if self.show_debug_info:
- self.myform['baseband'].set_value(r.actual_rf_freq)
- self.myform['ddc'].set_value(r.actual_dsp_freq)
+ self.myform['freq'].set_value(self.u.get_center_freq())
+ self.myform['rffreq'].set_value(r.actual_rf_freq)
+ self.myform['dspfreq'].set_value(r.actual_dsp_freq)
if not self.options.oscilloscope:
self.scope.set_baseband_freq(target_freq)
return True
@@ -228,7 +229,6 @@ class app_top_block(stdgui2.std_top_block):
self.scope.set_sample_rate(input_rate)
if self.show_debug_info: # update displayed values
self.myform['samprate'].set_value(self.u.get_samp_rate())
- self.myform['fs@gbe'].set_value(input_rate)
# uhd set_samp_rate never fails; always falls back to closest requested.
return True
diff --git a/gr-utils/src/python/usrp_rx_nogui.py b/gr-uhd/apps/uhd_rx_nogui.py
index a5d792c8b..6f860b820 100755
--- a/gr-utils/src/python/usrp_rx_nogui.py
+++ b/gr-uhd/apps/uhd_rx_nogui.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,7 +20,8 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, usrp, optfir, audio, eng_notation, blks2
+from gnuradio import gr, gru, uhd, optfir, audio, blks2
+from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import sys
@@ -66,75 +67,79 @@ Please see fm_demod.py and am_demod.py for details of the demodulation
blocks.
"""
-# (usrp_decim, channel_decim, audio_decim, channel_pass, channel_stop, demod)
+# (device_rate, channel_rate, audio_rate, channel_pass, channel_stop, demod)
demod_params = {
- 'AM' : (250, 16, 1, 5000, 8000, blks2.demod_10k0a3e_cf),
- 'FM' : (250, 8, 4, 8000, 9000, blks2.demod_20k0f3e_cf),
- 'WFM' : (250, 1, 8, 90000, 100000, blks2.demod_200kf3e_cf)
+ 'AM' : (256e3, 16e3, 16e3, 5000, 8000, blks2.demod_10k0a3e_cf),
+ 'FM' : (256e3, 32e3, 8e3, 8000, 9000, blks2.demod_20k0f3e_cf),
+ 'WFM' : (320e3, 320e3, 32e3, 80000, 115000, blks2.demod_200kf3e_cf)
}
-class usrp_src(gr.hier_block2):
+class uhd_src(gr.hier_block2):
"""
- Create a USRP source object supplying complex floats.
+ Create a UHD source object supplying complex floats.
Selects user supplied subdevice or chooses first available one.
Calibration value is the offset from the tuned frequency to
the actual frequency.
"""
- def __init__(self, subdev_spec, decim, gain=None, calibration=0.0):
- gr.hier_block2.__init__(self, "usrp_src",
+ def __init__(self, address, samp_rate, gain=None, calibration=0.0):
+ gr.hier_block2.__init__(self, "uhd_src",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
- self._decim = decim
- self._src = usrp.source_c()
- if subdev_spec is None:
- subdev_spec = usrp.pick_rx_subdevice(self._src)
- self._subdev = usrp.selected_subdev(self._src, subdev_spec)
- self._src.set_mux(usrp.determine_rx_mux_value(self._src, subdev_spec))
- self._src.set_decim_rate(self._decim)
-
+ self._src = uhd.usrp_source(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self._src.set_samp_rate(samp_rate)
+ dev_rate = self._src.get_samp_rate()
+ self._samp_rate = samp_rate
+
+ # Resampler to get to exactly samp_rate no matter what dev_rate is
+ self._rrate = samp_rate / dev_rate
+ self._resamp = blks2.pfb_arb_resampler_ccf(self._rrate)
+
# If no gain specified, set to midrange
if gain is None:
- g = self._subdev.gain_range()
- gain = (g[0]+g[1])/2.0
-
- self._subdev.set_gain(gain)
+ g = self._src.get_gain_range()
+ gain = (g.start()+g.stop())/2.0
+ print "Using gain: ", gain
+ self._src.set_gain(gain)
+
self._cal = calibration
- self.connect(self._src, self)
+ self.connect(self._src, self._resamp, self)
def tune(self, freq):
- result = usrp.tune(self._src, 0, self._subdev, freq+self._cal)
- # TODO: deal with residual
+ r = self._src.set_center_freq(freq+self._cal, 0)
def rate(self):
- return self._src.adc_rate()/self._decim
-
+ return self._samp_rate
+
class app_top_block(gr.top_block):
def __init__(self, options):
gr.top_block.__init__(self)
self.options = options
- (usrp_decim, channel_decim, audio_decim,
+ (dev_rate, channel_rate, audio_rate,
channel_pass, channel_stop, demod) = demod_params[options.modulation]
- USRP = usrp_src(options.rx_subdev_spec, # Daugherboard spec
- usrp_decim, # IF decimation ratio
- options.gain, # Receiver gain
- options.calibration) # Frequency offset
- USRP.tune(options.frequency)
+ DEV = uhd_src(options.address, # UHD device address
+ dev_rate, # device sample rate
+ options.gain, # Receiver gain
+ options.calibration) # Frequency offset
+ DEV.tune(options.frequency)
- if_rate = USRP.rate()
- channel_rate = if_rate // channel_decim
- audio_rate = channel_rate // audio_decim
+ if_rate = DEV.rate()
+ channel_decim = int(if_rate // channel_rate)
+ audio_decim = int(channel_rate // audio_rate)
- CHAN_taps = optfir.low_pass(1.0, # Filter gain
- if_rate, # Sample rate
- channel_pass, # One sided modulation bandwidth
- channel_stop, # One sided channel bandwidth
- 0.1, # Passband ripple
- 60) # Stopband attenuation
+ CHAN_taps = optfir.low_pass(1.0, # Filter gain
+ if_rate, # Sample rate
+ channel_pass, # One sided modulation bandwidth
+ channel_stop, # One sided channel bandwidth
+ 0.1, # Passband ripple
+ 60) # Stopband attenuation
CHAN = gr.freq_xlating_fir_filter_ccf(channel_decim, # Decimation rate
CHAN_taps, # Filter taps
@@ -143,7 +148,7 @@ class app_top_block(gr.top_block):
RFSQL = gr.pwr_squelch_cc(options.rf_squelch, # Power threshold
125.0/channel_rate, # Time constant
- channel_rate/20, # 50ms rise/fall
+ int(channel_rate/20), # 50ms rise/fall
False) # Zero, not gate output
AGC = gr.agc_cc(1.0/channel_rate, # Time constant
@@ -154,7 +159,8 @@ class app_top_block(gr.top_block):
DEMOD = demod(channel_rate, audio_decim)
# From RF to audio
- self.connect(USRP, CHAN, RFSQL, AGC, DEMOD)
+ #self.connect(DEV, CHAN, RFSQL, AGC, DEMOD)
+ self.connect(DEV, CHAN, DEMOD)
# Optionally add CTCSS and RSAMP if needed
tail = DEMOD
@@ -172,37 +178,51 @@ class app_top_block(gr.top_block):
self.connect(tail, RSAMP)
tail = RSAMP
- # Send to default audio output
- AUDIO = audio.sink(options.output_rate, "")
+ # Send to audio output device
+ AUDIO = audio.sink(int(options.output_rate),
+ options.audio_output)
self.connect(tail, AUDIO)
def main():
parser = OptionParser(option_class=eng_option)
- parser.add_option("-f", "--frequency", type="eng_float", default=None,
- help="set receive frequency to Hz", metavar="Hz")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev",
- help="select USRP Rx side A or B", metavar="SUBDEV")
- parser.add_option("-c", "--calibration", type="eng_float", default=0.0,
- help="set frequency offset to Hz", metavar="Hz")
- parser.add_option("-g", "--gain", type="int", default=None,
- help="set RF gain", metavar="dB")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate [default=%default]")
+ parser.add_option("-f", "--frequency", type="eng_float",
+ default=None, metavar="Hz",
+ help="set receive frequency to Hz [default=%default]")
+ parser.add_option("-c", "--calibration", type="eng_float",
+ default=0.0, metavar="Hz",
+ help="set frequency offset to Hz [default=%default]")
+ parser.add_option("-g", "--gain", type="int",
+ metavar="dB", default=None,
+ help="set RF gain [default is midpoint]")
parser.add_option("-m", "--modulation", type="choice", choices=('AM','FM','WFM'),
- help="set modulation type (AM,FM)", metavar="TYPE")
- parser.add_option("-o", "--output-rate", type="int", default=32000,
- help="set audio output rate to RATE", metavar="RATE")
- parser.add_option("-r", "--rf-squelch", type="eng_float", default=-50.0,
- help="set RF squelch to dB", metavar="dB")
+ metavar="TYPE", default=None,
+ help="set modulation type (AM,FM) [default=%default]")
+ parser.add_option("-o", "--output-rate", type="eng_float",
+ default=32000, metavar="RATE",
+ help="set audio output rate to RATE [default=%default]")
+ parser.add_option("-r", "--rf-squelch", type="eng_float",
+ default=-50.0, metavar="dB",
+ help="set RF squelch to dB [default=%default]")
parser.add_option("-p", "--ctcss", type="float",
- help="set CTCSS squelch to FREQ", metavar="FREQ")
+ default=None, metavar="FREQ",
+ help="set CTCSS squelch to FREQ [default=%default]")
+ parser.add_option("-O", "--audio-output", type="string", default="",
+ help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
(options, args) = parser.parse_args()
if options.frequency is None:
- print "Must supply receive frequency with -f"
+ sys.stderr.write("Must supply receive frequency with -f.\n")
sys.exit(1)
- if options.frequency < 1e6:
- options.frequency *= 1e6
-
+ if options.modulation is None:
+ sys.stderr.write("Must supply a modulation type (AM, FM, WFM).\n")
+ sys.exit(1)
+
tb = app_top_block(options)
try:
tb.run()
diff --git a/gr-utils/src/python/usrp_siggen.py b/gr-uhd/apps/uhd_siggen.py
index da83da770..921ba44b5 100755
--- a/gr-utils/src/python/usrp_siggen.py
+++ b/gr-uhd/apps/uhd_siggen.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2008,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -23,12 +23,10 @@
DESC_KEY = 'desc'
SAMP_RATE_KEY = 'samp_rate'
LINK_RATE_KEY = 'link_rate'
-DAC_RATE_KEY = 'dac_rate'
-INTERP_KEY = 'interp'
GAIN_KEY = 'gain'
TX_FREQ_KEY = 'tx_freq'
-DDC_FREQ_KEY = 'ddc_freq'
-BB_FREQ_KEY = 'bb_freq'
+DSP_FREQ_KEY = 'dsp_freq'
+RF_FREQ_KEY = 'rf_freq'
AMPLITUDE_KEY = 'amplitude'
AMPL_RANGE_KEY = 'ampl_range'
WAVEFORM_FREQ_KEY = 'waveform_freq'
@@ -40,10 +38,9 @@ TYPE_KEY = 'type'
def setter(ps, key, val): ps[key] = val
-from gnuradio import gr, eng_notation
+from gnuradio import gr, uhd, eng_notation
from gnuradio.gr.pubsub import pubsub
from gnuradio.eng_option import eng_option
-from gnuradio import usrp_options
from optparse import OptionParser
import sys
import math
@@ -66,40 +63,48 @@ class top_block(gr.top_block, pubsub):
gr.top_block.__init__(self)
pubsub.__init__(self)
self._verbose = options.verbose
+
#initialize values from options
self._setup_usrpx(options)
- self.subscribe(INTERP_KEY, lambda i: setter(self, SAMP_RATE_KEY, self[DAC_RATE_KEY]/i))
- self.subscribe(SAMP_RATE_KEY, lambda e: setter(self, LINK_RATE_KEY, e*32))
- self[INTERP_KEY] = options.interp or 16
+ self[SAMP_RATE_KEY] = options.samp_rate
self[TX_FREQ_KEY] = options.tx_freq
self[AMPLITUDE_KEY] = options.amplitude
self[WAVEFORM_FREQ_KEY] = options.waveform_freq
self[WAVEFORM_OFFSET_KEY] = options.offset
self[WAVEFORM2_FREQ_KEY] = options.waveform2_freq
- self[BB_FREQ_KEY] = 0
- self[DDC_FREQ_KEY] = 0
+ self[DSP_FREQ_KEY] = 0
+ self[RF_FREQ_KEY] = 0
+
#subscribe set methods
- self.subscribe(INTERP_KEY, self.set_interp)
+ self.subscribe(SAMP_RATE_KEY, self.set_samp_rate)
self.subscribe(GAIN_KEY, self.set_gain)
self.subscribe(TX_FREQ_KEY, self.set_freq)
self.subscribe(AMPLITUDE_KEY, self.set_amplitude)
self.subscribe(WAVEFORM_FREQ_KEY, self.set_waveform_freq)
self.subscribe(WAVEFORM2_FREQ_KEY, self.set_waveform2_freq)
self.subscribe(TYPE_KEY, self.set_waveform)
+
#force update on pubsub keys
- for key in (INTERP_KEY, GAIN_KEY, TX_FREQ_KEY,
- AMPLITUDE_KEY, WAVEFORM_FREQ_KEY, WAVEFORM_OFFSET_KEY, WAVEFORM2_FREQ_KEY):
+ for key in (SAMP_RATE_KEY, GAIN_KEY, TX_FREQ_KEY,
+ AMPLITUDE_KEY, WAVEFORM_FREQ_KEY,
+ WAVEFORM_OFFSET_KEY, WAVEFORM2_FREQ_KEY):
self[key] = self[key]
self[TYPE_KEY] = options.type #set type last
def _setup_usrpx(self, options):
- self._u = usrp_options.create_usrp_sink(options)
+ self._u = uhd.usrp_sink(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+ self._u.set_samp_rate(options.samp_rate)
+ if(options.antenna):
+ self._u.set_antenna(options.antenna)
+
self.publish(DESC_KEY, lambda: str(self._u))
- self.publish(DAC_RATE_KEY, self._u.dac_rate)
- self.publish(FREQ_RANGE_KEY, self._u.freq_range)
- self.publish(GAIN_RANGE_KEY, self._u.gain_range)
- self.publish(GAIN_KEY, self._u.gain)
- if self._verbose: print str(self._u)
+ self.publish(FREQ_RANGE_KEY, self._u.get_freq_range)
+ self.publish(GAIN_RANGE_KEY, self._u.get_gain_range)
+ self.publish(GAIN_KEY, self._u.get_gain)
+ if self._verbose:
+ print str(self._u)
def _set_tx_amplitude(self, ampl):
"""
@@ -107,16 +112,13 @@ class top_block(gr.top_block, pubsub):
@param ampl the amplitude or None for automatic
"""
ampl_range = self[AMPL_RANGE_KEY]
- if ampl is None: ampl = (ampl_range[1] - ampl_range[0])*0.15 + ampl_range[0]
+ if ampl is None:
+ ampl = (ampl_range[1] - ampl_range[0])*0.15 + ampl_range[0]
self[AMPLITUDE_KEY] = max(ampl_range[0], min(ampl, ampl_range[1]))
- def set_interp(self, interp):
- if not self._u.set_interp(interp):
- raise RuntimeError("Failed to set interpolation rate %i" % (interp,))
-
- if self._verbose:
- print "USRP interpolation rate:", interp
- print "USRP IF bandwidth: %sHz" % (n2s(self[SAMP_RATE_KEY]),)
+ def set_samp_rate(self, sr):
+ self._u.set_samp_rate(sr)
+ sr = self._u.get_samp_rate()
if self[TYPE_KEY] in (gr.GR_SIN_WAVE, gr.GR_CONST_WAVE):
self._src.set_sampling_freq(self[SAMP_RATE_KEY])
@@ -129,7 +131,9 @@ class top_block(gr.top_block, pubsub):
else:
return True # Waveform not yet set
- if self._verbose: print "Set interpolation rate to:", interp
+ if self._verbose:
+ print "Set sample rate to:", sr
+
return True
def set_gain(self, gain):
@@ -158,14 +162,14 @@ class top_block(gr.top_block, pubsub):
fs = "%sHz" % (n2s(target_freq),)
if tr is not None:
self._freq = target_freq
- self[DDC_FREQ_KEY] = tr.dxc_freq
- self[BB_FREQ_KEY] = tr.baseband_freq
+ self[DSP_FREQ_KEY] = tr.actual_dsp_freq
+ self[RF_FREQ_KEY] = tr.actual_rf_freq
if self._verbose:
- print "Set center frequency to", fs
- print "Tx baseband frequency: %sHz" % (n2s(tr.baseband_freq),)
- print "Tx DDC frequency: %sHz" % (n2s(tr.dxc_freq),)
- print "Tx residual frequency: %sHz" % (n2s(tr.residual_freq),)
- elif self._verbose: print "Failed to set freq."
+ print "Set center frequency to", self._u.get_center_freq()
+ print "Tx RF frequency: %sHz" % (n2s(tr.actual_rf_freq),)
+ print "Tx DSP frequency: %sHz" % (n2s(tr.actual_dsp_freq),)
+ elif self._verbose:
+ print "Failed to set freq."
return tr
def set_waveform_freq(self, freq):
@@ -254,7 +258,8 @@ class top_block(gr.top_block, pubsub):
def set_amplitude(self, amplitude):
if amplitude < 0.0 or amplitude > 1.0:
- if self._verbose: print "Amplitude out of range:", amplitude
+ if self._verbose:
+ print "Amplitude out of range:", amplitude
return False
if self[TYPE_KEY] in (gr.GR_SIN_WAVE, gr.GR_CONST_WAVE, gr.GR_GAUSSIAN, gr.GR_UNIFORM):
@@ -267,22 +272,33 @@ class top_block(gr.top_block, pubsub):
else:
return True # Waveform not yet set
- if self._verbose: print "Set amplitude to:", amplitude
+ if self._verbose:
+ print "Set amplitude to:", amplitude
return True
def get_options():
usage="%prog: [options]"
parser = OptionParser(option_class=eng_option, usage=usage)
- usrp_options.add_tx_options(parser)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate (bandwidth) [default=%default]")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
parser.add_option("-f", "--tx-freq", type="eng_float", default=None,
- help="Set carrier frequency to FREQ [default=mid-point]", metavar="FREQ")
+ help="Set carrier frequency to FREQ [default=mid-point]",
+ metavar="FREQ")
parser.add_option("-x", "--waveform-freq", type="eng_float", default=0,
help="Set baseband waveform frequency to FREQ [default=%default]")
parser.add_option("-y", "--waveform2-freq", type="eng_float", default=None,
help="Set 2nd waveform frequency to FREQ [default=%default]")
parser.add_option("--sine", dest="type", action="store_const", const=gr.GR_SIN_WAVE,
- help="Generate a carrier modulated by a complex sine wave", default=gr.GR_SIN_WAVE)
+ help="Generate a carrier modulated by a complex sine wave",
+ default=gr.GR_SIN_WAVE)
parser.add_option("--const", dest="type", action="store_const", const=gr.GR_CONST_WAVE,
help="Generate a constant carrier")
parser.add_option("--offset", type="eng_float", default=0,
@@ -295,8 +311,9 @@ def get_options():
help="Generate Two Tone signal for IMD testing")
parser.add_option("--sweep", dest="type", action="store_const", const="sweep",
help="Generate a swept sine wave")
- parser.add_option("-A", "--amplitude", type="eng_float", default=0.15,
- help="Set output amplitude to AMPL (0.0-1.0) [default=%default]", metavar="AMPL")
+ parser.add_option("", "--amplitude", type="eng_float", default=0.15,
+ help="Set output amplitude to AMPL (0.0-1.0) [default=%default]",
+ metavar="AMPL")
parser.add_option("-v", "--verbose", action="store_true", default=False,
help="Use verbose console output [default=%default]")
@@ -304,7 +321,8 @@ def get_options():
return (options, args)
-# If this script is executed, the following runs. If it is imported, the below does not run.
+# If this script is executed, the following runs. If it is imported,
+# the below does not run.
def main():
if gr.enable_realtime_scheduling() != gr.RT_OK:
print "Note: failed to enable realtime scheduling, continuing"
@@ -328,4 +346,5 @@ def main():
# which will call the decontructor on usrp and stop transmit.
# Whats odd is that grc works fine with tb in the __main__,
# perhaps its because the try/except clauses around tb.
-if __name__ == "__main__": main()
+if __name__ == "__main__":
+ main()
diff --git a/gr-utils/src/python/usrp_siggen_gui.py b/gr-uhd/apps/uhd_siggen_gui.py
index 47d47bdb3..2ef6ea40f 100755
--- a/gr-utils/src/python/usrp_siggen_gui.py
+++ b/gr-uhd/apps/uhd_siggen_gui.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2009 Free Software Foundation, Inc.
+# Copyright 2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -24,7 +24,7 @@ import wx
from gnuradio import gr
from gnuradio.gr.pubsub import pubsub
from gnuradio.wxgui import gui, forms
-import usrp_siggen
+import uhd_siggen
import sys, math
class app_gui(pubsub):
@@ -62,14 +62,14 @@ class app_gui(pubsub):
sweep_bb_hbox.ShowItems(type == 'sweep')
tone_bb_hbox.ShowItems(type == '2tone')
self.vbox.Layout()
- self.tb.subscribe(usrp_siggen.TYPE_KEY, set_type)
+ self.tb.subscribe(uhd_siggen.TYPE_KEY, set_type)
#create sine forms
sine_bb_hbox.AddSpacer(10)
forms.text_box(
parent=self.panel, sizer=sine_bb_hbox,
label='Frequency (Hz)',
ps=self.tb,
- key=usrp_siggen.WAVEFORM_FREQ_KEY,
+ key=uhd_siggen.WAVEFORM_FREQ_KEY,
converter=forms.float_converter(),
)
sine_bb_hbox.AddStretchSpacer()
@@ -79,7 +79,7 @@ class app_gui(pubsub):
parent=self.panel, sizer=sweep_bb_hbox,
label='Sweep Width (Hz)',
ps=self.tb,
- key=usrp_siggen.WAVEFORM_FREQ_KEY,
+ key=uhd_siggen.WAVEFORM_FREQ_KEY,
converter=forms.float_converter(),
)
sweep_bb_hbox.AddStretchSpacer()
@@ -87,7 +87,7 @@ class app_gui(pubsub):
parent=self.panel, sizer=sweep_bb_hbox,
label='Sweep Rate (Hz)',
ps=self.tb,
- key=usrp_siggen.WAVEFORM2_FREQ_KEY,
+ key=uhd_siggen.WAVEFORM2_FREQ_KEY,
converter=forms.float_converter(),
)
sweep_bb_hbox.AddStretchSpacer()
@@ -97,7 +97,7 @@ class app_gui(pubsub):
parent=self.panel, sizer=tone_bb_hbox,
label='Tone 1 (Hz)',
ps=self.tb,
- key=usrp_siggen.WAVEFORM_FREQ_KEY,
+ key=uhd_siggen.WAVEFORM_FREQ_KEY,
converter=forms.float_converter(),
)
tone_bb_hbox.AddStretchSpacer()
@@ -105,27 +105,31 @@ class app_gui(pubsub):
parent=self.panel, sizer=tone_bb_hbox,
label='Tone 2 (Hz)',
ps=self.tb,
- key=usrp_siggen.WAVEFORM2_FREQ_KEY,
+ key=uhd_siggen.WAVEFORM2_FREQ_KEY,
converter=forms.float_converter(),
)
tone_bb_hbox.AddStretchSpacer()
forms.radio_buttons(
parent=self.panel, sizer=bb_vbox,
- choices=usrp_siggen.waveforms.keys(),
- labels=usrp_siggen.waveforms.values(),
+ choices=uhd_siggen.waveforms.keys(),
+ labels=uhd_siggen.waveforms.values(),
ps=self.tb,
- key=usrp_siggen.TYPE_KEY,
+ key=uhd_siggen.TYPE_KEY,
style=wx.NO_BORDER | wx.RA_HORIZONTAL,
)
bb_vbox.AddSpacer(10)
bb_vbox.Add(sine_bb_hbox, 0, wx.EXPAND)
bb_vbox.Add(sweep_bb_hbox, 0, wx.EXPAND)
bb_vbox.Add(tone_bb_hbox, 0, wx.EXPAND)
- set_type(self.tb[usrp_siggen.TYPE_KEY])
+ set_type(self.tb[uhd_siggen.TYPE_KEY])
+
##################################################
# Frequency controls
##################################################
- fc_vbox = forms.static_box_sizer(parent=self.panel, label="Center Frequency", orient=wx.VERTICAL, bold=True)
+ fc_vbox = forms.static_box_sizer(parent=self.panel,
+ label="Center Frequency",
+ orient=wx.VERTICAL,
+ bold=True)
fc_vbox.AddSpacer(5)
# First row of frequency controls (center frequency)
freq_hbox = wx.BoxSizer(wx.HORIZONTAL)
@@ -145,42 +149,47 @@ class app_gui(pubsub):
proportion=1,
converter=forms.float_converter(),
ps=self.tb,
- key=usrp_siggen.TX_FREQ_KEY,
+ key=uhd_siggen.TX_FREQ_KEY,
)
freq_hbox.AddSpacer(10)
+
forms.slider(
parent=self.panel, sizer=freq_hbox,
proportion=2,
ps=self.tb,
- key=usrp_siggen.TX_FREQ_KEY,
- minimum=self.tb[usrp_siggen.FREQ_RANGE_KEY][0],
- maximum=self.tb[usrp_siggen.FREQ_RANGE_KEY][1],
+ key=uhd_siggen.TX_FREQ_KEY,
+ minimum=self.tb[uhd_siggen.FREQ_RANGE_KEY].start(),
+ maximum=self.tb[uhd_siggen.FREQ_RANGE_KEY].stop(),
num_steps=100,
)
freq_hbox.AddSpacer(5)
tr_hbox.AddSpacer(5)
forms.static_text(
parent=self.panel, sizer=tr_hbox,
- label='Daughterboard (Hz)',
+ label='RF Frequency',
ps=self.tb,
- key=usrp_siggen.BB_FREQ_KEY,
+ key=uhd_siggen.RF_FREQ_KEY,
converter=forms.float_converter(),
proportion=1,
)
tr_hbox.AddSpacer(10)
forms.static_text(
parent=self.panel, sizer=tr_hbox,
- label='USRP DDC (Hz)',
+ label='DSP Frequency',
ps=self.tb,
- key=usrp_siggen.DDC_FREQ_KEY,
+ key=uhd_siggen.DSP_FREQ_KEY,
converter=forms.float_converter(),
proportion=1,
)
tr_hbox.AddSpacer(5)
+
##################################################
# Amplitude controls
##################################################
- amp_hbox = forms.static_box_sizer(parent=self.panel, label="Amplitude", orient=wx.VERTICAL, bold=True)
+ amp_hbox = forms.static_box_sizer(parent=self.panel,
+ label="Amplitude",
+ orient=wx.VERTICAL,
+ bold=True)
amp_hbox.AddSpacer(5)
# First row of amp controls (ampl)
lvl_hbox = wx.BoxSizer(wx.HORIZONTAL)
@@ -199,7 +208,7 @@ class app_gui(pubsub):
proportion=1,
converter=forms.float_converter(),
ps=self.tb,
- key=usrp_siggen.AMPLITUDE_KEY,
+ key=uhd_siggen.AMPLITUDE_KEY,
label="Level (0.0-1.0)",
)
lvl_hbox.AddSpacer(10)
@@ -207,21 +216,21 @@ class app_gui(pubsub):
parent=self.panel, sizer=lvl_hbox,
proportion=2,
ps=self.tb,
- key=usrp_siggen.AMPLITUDE_KEY,
+ key=uhd_siggen.AMPLITUDE_KEY,
min_exp=-6,
max_exp=0,
base=10,
num_steps=100,
)
lvl_hbox.AddSpacer(5)
- if self.tb[usrp_siggen.GAIN_RANGE_KEY][0] < self.tb[usrp_siggen.GAIN_RANGE_KEY][1]:
+ if self.tb[uhd_siggen.GAIN_RANGE_KEY].start() < self.tb[uhd_siggen.GAIN_RANGE_KEY].stop():
gain_hbox.AddSpacer(5)
forms.text_box(
parent=self.panel, sizer=gain_hbox,
proportion=1,
converter=forms.float_converter(),
ps=self.tb,
- key=usrp_siggen.GAIN_KEY,
+ key=uhd_siggen.GAIN_KEY,
label="TX Gain (dB)",
)
gain_hbox.AddSpacer(10)
@@ -229,48 +238,40 @@ class app_gui(pubsub):
parent=self.panel, sizer=gain_hbox,
proportion=2,
ps=self.tb,
- key=usrp_siggen.GAIN_KEY,
- minimum=self.tb[usrp_siggen.GAIN_RANGE_KEY][0],
- maximum=self.tb[usrp_siggen.GAIN_RANGE_KEY][1],
- step_size=self.tb[usrp_siggen.GAIN_RANGE_KEY][2],
+ key=uhd_siggen.GAIN_KEY,
+ minimum=self.tb[uhd_siggen.GAIN_RANGE_KEY].start(),
+ maximum=self.tb[uhd_siggen.GAIN_RANGE_KEY].stop(),
+ step_size=self.tb[uhd_siggen.GAIN_RANGE_KEY].step(),
)
gain_hbox.AddSpacer(5)
+
##################################################
# Sample Rate controls
##################################################
- sam_hbox = forms.static_box_sizer(parent=self.panel, label="Sample Rate", orient=wx.HORIZONTAL, bold=True)
+ sam_hbox = forms.static_box_sizer(parent=self.panel,
+ label="Sample Rate",
+ orient=wx.HORIZONTAL,
+ bold=True)
self.vbox.Add(sam_hbox, 0, wx.EXPAND)
self.vbox.AddSpacer(10)
self.vbox.AddStretchSpacer()
- sam_hbox.AddSpacer(5)
- forms.text_box(
- parent=self.panel, sizer=sam_hbox,
- converter=forms.int_converter(),
- ps=self.tb,
- key=usrp_siggen.INTERP_KEY,
- label="Interpolation",
- )
sam_hbox.AddStretchSpacer(20)
forms.static_text(
parent=self.panel, sizer=sam_hbox,
label='Sample Rate (sps)',
ps=self.tb,
- key=usrp_siggen.SAMP_RATE_KEY,
+ key=uhd_siggen.SAMP_RATE_KEY,
converter=forms.float_converter(),
)
sam_hbox.AddStretchSpacer(20)
- forms.static_text(
- parent=self.panel, sizer=sam_hbox,
- label='Link Rate (bits/sec)',
- ps=self.tb,
- key=usrp_siggen.LINK_RATE_KEY,
- converter=forms.float_converter(),
- )
- sam_hbox.AddSpacer(5)
+
##################################################
- # USRP status
+ # UHD status
##################################################
- u2_hbox = forms.static_box_sizer(parent=self.panel, label="USRP Status", orient=wx.HORIZONTAL, bold=True)
+ u2_hbox = forms.static_box_sizer(parent=self.panel,
+ label="UHD Status",
+ orient=wx.HORIZONTAL,
+ bold=True)
self.vbox.Add(u2_hbox, 0, wx.EXPAND)
self.vbox.AddSpacer(10)
self.vbox.AddStretchSpacer()
@@ -278,7 +279,7 @@ class app_gui(pubsub):
forms.static_text(
parent=self.panel, sizer=u2_hbox,
ps=self.tb,
- key=usrp_siggen.DESC_KEY,
+ key=uhd_siggen.DESC_KEY,
converter=forms.str_converter(),
)
self.vbox.AddSpacer(5)
@@ -287,17 +288,17 @@ class app_gui(pubsub):
def main():
try:
# Get command line parameters
- (options, args) = usrp_siggen.get_options()
+ (options, args) = uhd_siggen.get_options()
# Create the top block using these
- tb = usrp_siggen.top_block(options, args)
+ tb = uhd_siggen.top_block(options, args)
# Create the GUI application
app = gui.app(top_block=tb, # Constructed top block
gui=app_gui, # User interface class
options=options, # Command line options
args=args, # Command line args
- title="USRP Signal Generator", # Top window title
+ title="UHD Signal Generator", # Top window title
nstatus=1, # Number of status lines
start=True, # Whether to start flowgraph
realtime=True) # Whether to set realtime priority
@@ -309,9 +310,9 @@ def main():
print e
sys.exit(1)
-# Make sure to create the top block (tb) within a function:
-# That code in main will allow tb to go out of scope on return,
-# which will call the decontructor on usrp and stop transmit.
-# Whats odd is that grc works fine with tb in the __main__,
-# perhaps its because the try/except clauses around tb.
+# Make sure to create the top block (tb) within a function: That code
+# in main will allow tb to go out of scope on return, which will call
+# the decontructor on uhd device and stop transmit. Whats odd is that
+# grc works fine with tb in the __main__, perhaps its because the
+# try/except clauses around tb.
if __name__ == "__main__": main()
diff --git a/gr-gpio/src/.gitignore b/gr-uhd/doc/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-gpio/src/.gitignore
+++ b/gr-uhd/doc/.gitignore
diff --git a/gr-radar-mono/Makefile.am b/gr-uhd/doc/Makefile.am
index 98e3daf02..eee3ebcf6 100644
--- a/gr-radar-mono/Makefile.am
+++ b/gr-uhd/doc/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,5 +21,7 @@
include $(top_srcdir)/Makefile.common
-EXTRA_DIST += README
-SUBDIRS = src doc
+SUBDIRS =
+
+dist_gr_doc_DATA = \
+ README.uhd
diff --git a/gr-uhd/doc/README.uhd b/gr-uhd/doc/README.uhd
new file mode 100644
index 000000000..ec8024c09
--- /dev/null
+++ b/gr-uhd/doc/README.uhd
@@ -0,0 +1,14 @@
+This is the GNU Radio UHD package. It is the interface to the UHD
+library to connect to and send and receive data between the Ettus
+Research, LLC product line. To use the UHD blocks, the Python
+namespaces is in gnuradio.uhd, which would be normally imported
+as:
+
+ from gnuradio import uhd
+
+See the Doxygen documentation for details about the blocks available
+in this package. A quick listing of the details can be found in Python
+after importing by using:
+
+ help(uhd)
+
diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox
new file mode 100644
index 000000000..f08fe2f06
--- /dev/null
+++ b/gr-uhd/doc/uhd.dox
@@ -0,0 +1,35 @@
+/*! \page page_uhd UHD Interface
+
+\section Introduction
+This is the GNU Radio UHD package. It is the interface to the UHD
+library to connect to and send and receive data between the Ettus
+Research, LLC product line. To use the UHD blocks, the Python
+namespaces is in gnuradio.uhd, which would be normally imported
+as:
+
+\code
+ from gnuradio import uhd
+\endcode
+
+The relevant blocks are listed in the \ref uhd_blk group.
+
+A quick listing of the details can be found in Python after importing
+by using:
+
+\code
+ help(uhd)
+\endcode
+
+
+\section External Documentation
+
+Ettus Research keeps the comprehensive documentation to the underlying UHD driver, which can be found:
+
+ http://files.ettus.com/uhd_docs/manual/html/
+
+The UHD Doxygen page is located:
+
+ http://files.ettus.com/uhd_docs/doxygen/html/index.html
+
+
+*/
diff --git a/gr-gpio/src/python/.gitignore b/gr-uhd/examples/.gitignore
index b9e19a979..ad8a13c08 100644
--- a/gr-gpio/src/python/.gitignore
+++ b/gr-uhd/examples/.gitignore
@@ -1,4 +1,5 @@
/Makefile
/Makefile.in
-/*.pyc
-/run_tests
+*.dat
+*.32f
+*.32fc
diff --git a/gnuradio-examples/python/usrp2/Makefile.am b/gr-uhd/examples/Makefile.am
index cca813349..b10b48928 100644
--- a/gnuradio-examples/python/usrp2/Makefile.am
+++ b/gr-uhd/examples/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2004,2005,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,12 +21,24 @@
include $(top_srcdir)/Makefile.common
-ourdatadir = $(exampledir)/usrp2
-dist_ourdata_DATA = \
- qt_wfm_interface.ui \
- qt_wfm_interface.py
+SUBDIRS = multi-antenna
+ourdatadir = $(exampledir)/uhd
-dist_ourdata_SCRIPTS = \
- usrp2_wfm_qt.py \
- usrp2_wfm_rcv.py
+dist_ourdata_SCRIPTS = \
+ fm_tx4.py \
+ fm_tx_2_daughterboards.py \
+ max_power.py \
+ usrp_am_mw_rcv.py \
+ usrp_nbfm_ptt.py \
+ usrp_nbfm_rcv.py \
+ usrp_spectrum_sense.py \
+ usrp_tv_rcv_nogui.py \
+ usrp_tv_rcv.py \
+ usrp_wfm_rcv2_nogui.py \
+ usrp_wfm_rcv_fmdet.py \
+ usrp_wfm_rcv_nogui.py \
+ usrp_wfm_rcv_pll.py \
+ usrp_wfm_rcv.py \
+ usrp_wfm_rcv_sca.py \
+ usrp_wxapt_rcv.py
diff --git a/gnuradio-examples/python/usrp/fm_tx4.py b/gr-uhd/examples/fm_tx4.py
index a51668dde..9b39752c1 100755
--- a/gnuradio-examples/python/usrp/fm_tx4.py
+++ b/gr-uhd/examples/fm_tx4.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -33,8 +33,7 @@ audio_to_file.py
"""
from gnuradio import gr, eng_notation
-from gnuradio import usrp
-from gnuradio import audio
+from gnuradio import uhd
from gnuradio import blks2
from gnuradio.eng_option import eng_option
from optparse import OptionParser
@@ -43,7 +42,6 @@ import math
import sys
from gnuradio.wxgui import stdgui2, fftsink2
-#from gnuradio import tx_debug_gui
import wx
@@ -54,10 +52,17 @@ class pipeline(gr.hier_block2):
def __init__(self, filename, lo_freq, audio_rate, if_rate):
gr.hier_block2.__init__(self, "pipeline",
- gr.io_signature(0, 0, 0), # Input signature
- gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature
-
- src = gr.file_source (gr.sizeof_float, filename, True)
+ gr.io_signature(0, 0, 0),
+ gr.io_signature(1, 1, gr.sizeof_gr_complex))
+
+ try:
+ src = gr.file_source (gr.sizeof_float, filename, True)
+ except RuntimeError:
+ sys.stderr.write(("\nError: Could not open file '%s'\n\n" % \
+ filename))
+ sys.exit(1)
+
+ print audio_rate, if_rate
fmtx = blks2.nbfm_tx (audio_rate, if_rate, max_dev=5e3, tau=75e-6)
# Local oscillator
@@ -78,10 +83,17 @@ class fm_tx_block(stdgui2.std_top_block):
stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv)
parser = OptionParser (option_class=eng_option)
- parser.add_option("-T", "--tx-subdev-spec", type="subdev", default=None,
- help="select USRP Tx side A or B")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=400e3,
+ help="set sample rate (bandwidth) [default=%default]")
parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set Tx frequency to FREQ [required]", metavar="FREQ")
+ help="set frequency to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
parser.add_option("-n", "--nchannels", type="int", default=4,
help="number of Tx channels [1,4]")
#parser.add_option("","--debug", action="store_true", default=False,
@@ -104,57 +116,54 @@ class fm_tx_block(stdgui2.std_top_block):
# ----------------------------------------------------------------
# Set up constants and parameters
- self.u = usrp.sink_c () # the USRP sink (consumes samples)
+ self.u = uhd.usrp_sink(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self.usrp_rate = options.samp_rate
+ self.u.set_samp_rate(self.usrp_rate)
+ self.usrp_rate = self.u.get_samp_rate()
- self.dac_rate = self.u.dac_rate() # 128 MS/s
- self.usrp_interp = 400
- self.u.set_interp_rate(self.usrp_interp)
- self.usrp_rate = self.dac_rate / self.usrp_interp # 320 kS/s
self.sw_interp = 10
self.audio_rate = self.usrp_rate / self.sw_interp # 32 kS/s
- # determine the daughterboard subdevice we're using
- if options.tx_subdev_spec is None:
- options.tx_subdev_spec = usrp.pick_tx_subdevice(self.u)
+ if options.gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2
- m = usrp.determine_tx_mux_value(self.u, options.tx_subdev_spec)
- #print "mux = %#04x" % (m,)
- self.u.set_mux(m)
- self.subdev = usrp.selected_subdev(self.u, options.tx_subdev_spec)
- print "Using TX d'board %s" % (self.subdev.side_and_name(),)
+ self.set_gain(options.gain)
+ self.set_freq(options.freq)
- self.subdev.set_gain(self.subdev.gain_range()[1]) # set max Tx gain
- if not self.set_freq(options.freq):
- freq_range = self.subdev.freq_range()
- print "Failed to set frequency to %s. Daughterboard supports %s to %s" % (
- eng_notation.num_to_str(options.freq),
- eng_notation.num_to_str(freq_range[0]),
- eng_notation.num_to_str(freq_range[1]))
- raise SystemExit
- self.subdev.set_enable(True) # enable transmitter
+ if(options.antenna):
+ self.u.set_antenna(options.antenna, 0)
- sum = gr.add_cc ()
+ self.sum = gr.add_cc ()
# Instantiate N NBFM channels
step = 25e3
- offset = (0 * step, 1 * step, -1 * step, 2 * step, -2 * step, 3 * step, -3 * step)
+ offset = (0 * step, 1 * step, -1 * step,
+ 2 * step, -2 * step, 3 * step, -3 * step)
+
for i in range (options.nchannels):
t = pipeline("audio-%d.dat" % (i % 4), offset[i],
self.audio_rate, self.usrp_rate)
- self.connect(t, (sum, i))
+ self.connect(t, (self.sum, i))
- gain = gr.multiply_const_cc (4000.0 / options.nchannels)
+ self.gain = gr.multiply_const_cc (1.0 / options.nchannels)
# connect it all
- self.connect (sum, gain)
- self.connect (gain, self.u)
+ self.connect (self.sum, self.gain)
+ self.connect (self.gain, self.u)
# plot an FFT to verify we are sending what we want
if 1:
post_mod = fftsink2.fft_sink_c(panel, title="Post Modulation",
- fft_size=512, sample_rate=self.usrp_rate,
- y_per_div=20, ref_level=40)
- self.connect (sum, post_mod)
+ fft_size=512,
+ sample_rate=self.usrp_rate,
+ y_per_div=20,
+ ref_level=40)
+ self.connect (self.gain, post_mod)
vbox.Add (post_mod.win, 1, wx.EXPAND)
@@ -177,18 +186,17 @@ class fm_tx_block(stdgui2.std_top_block):
any residual_freq to the s/w freq translater.
"""
- r = self.u.tune(self.subdev.which(), self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq, 0)
if r:
- print "r.baseband_freq =", eng_notation.num_to_str(r.baseband_freq)
- print "r.dxc_freq =", eng_notation.num_to_str(r.dxc_freq)
- print "r.residual_freq =", eng_notation.num_to_str(r.residual_freq)
- print "r.inverted =", r.inverted
-
- # Could use residual_freq in s/w freq translator
+ print "Frequency =", eng_notation.num_to_str(self.u.get_center_freq())
return True
return False
+ def set_gain(self, gain):
+ self.u.set_gain(gain, 0)
+
+
def main ():
app = stdgui2.stdapp(fm_tx_block, "Multichannel FM Tx", nstatus=1)
app.MainLoop ()
diff --git a/gnuradio-examples/python/usrp/fm_tx_2_daughterboards.py b/gr-uhd/examples/fm_tx_2_daughterboards.py
index 15fdf2831..36d237616 100755
--- a/gnuradio-examples/python/usrp/fm_tx_2_daughterboards.py
+++ b/gr-uhd/examples/fm_tx_2_daughterboards.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -30,14 +30,10 @@ Side A is 600 Hz tone.
Side B is 350 + 440 Hz tones.
"""
-from gnuradio import gr
+from gnuradio import gr, uhd, blks2
from gnuradio.eng_notation import num_to_str, str_to_num
-from gnuradio import usrp
-from gnuradio import audio
-from gnuradio import blks2
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from usrpm import usrp_dbid
import math
import sys
@@ -90,8 +86,17 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- usage="%prog: [options] side-A-tx-freq side-B-tx-freq"
+ usage="%prog: [options] tx-freq0 tx-freq1"
parser = OptionParser (option_class=eng_option, usage=usage)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=320e3,
+ help="set sample rate [default=%default]")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
(options, args) = parser.parse_args ()
if len(args) != 2:
@@ -104,32 +109,45 @@ class my_top_block(gr.top_block):
# ----------------------------------------------------------------
# Set up USRP to transmit on both daughterboards
- self.u = usrp.sink_c(nchan=2) # say we want two channels
+ d = uhd.device_find(uhd.device_addr(options.address))
+ uhd_type = d[0].get('type')
- self.dac_rate = self.u.dac_rate() # 128 MS/s
- self.usrp_interp = 400
- self.u.set_interp_rate(self.usrp_interp)
- self.usrp_rate = self.dac_rate / self.usrp_interp # 320 kS/s
+ self.u = uhd.usrp_sink(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=2)
- # we're using both daughterboard slots, thus subdev is a 2-tuple
- self.subdev = (self.u.db(0, 0), self.u.db(1, 0))
- print "Using TX d'board %s" % (self.subdev[0].side_and_name(),)
- print "Using TX d'board %s" % (self.subdev[1].side_and_name(),)
-
- # set up the Tx mux so that
- # channel 0 goes to Slot A I&Q and channel 1 to Slot B I&Q
- self.u.set_mux(0xba98)
+ # Set up USRP system based on type
+ if(uhd_type == "usrp"):
+ self.u.set_subdev_spec("A:0 B:0")
+ tr0 = uhd.tune_request(freq0)
+ tr1 = uhd.tune_request(freq1)
- self.subdev[0].set_gain(self.subdev[0].gain_range()[1]) # set max Tx gain
- self.subdev[1].set_gain(self.subdev[1].gain_range()[1]) # set max Tx gain
+ else:
+ if abs(freq0 - freq1) > 5.5e6:
+ sys.stderr.write("\nError: When not using two separate d'boards, frequencies must bewithin 5.5MHz of each other.\n")
+ raise SystemExit
+
+ self.u.set_subdev_spec("A:0 A:0")
+
+ mid_freq = (freq0 + freq1)/2.0
+ tr0 = uhd.tune_request(freq0, rf_freq=mid_freq,
+ rf_freq_policy=uhd.tune_request.POLICY_MANUAL)
+
+ tr1 = uhd.tune_request(freq1, rf_freq=mid_freq,
+ rf_freq_policy=uhd.tune_request.POLICY_MANUAL)
+
+ # Use the tune requests to tune each channel
+ self.set_freq(tr0, 0)
+ self.set_freq(tr1, 1)
+
+ self.usrp_rate = options.samp_rate
- self.set_freq(0, freq0)
- self.set_freq(1, freq1)
- self.subdev[0].set_enable(True) # enable transmitter
- self.subdev[1].set_enable(True) # enable transmitter
+ self.u.set_samp_rate(self.usrp_rate)
+ dev_rate = self.u.get_samp_rate()
# ----------------------------------------------------------------
- # build two signal sources, interleave them, amplify and connect them to usrp
+ # build two signal sources, interleave them, amplify and
+ # connect them to usrp
sig0 = example_signal_0(self.usrp_rate)
sig1 = example_signal_1(self.usrp_rate)
@@ -138,43 +156,45 @@ class my_top_block(gr.top_block):
self.connect(sig0, (intl, 0))
self.connect(sig1, (intl, 1))
- # apply some gain
- if_gain = 10000
- ifamp = gr.multiply_const_cc(if_gain)
-
+ # Correct for any difference in requested and actual rates
+ rrate = self.usrp_rate / dev_rate
+ resamp = blks2.pfb_arb_resampler_ccf(rrate)
+
# and wire them up
- self.connect(intl, ifamp, self.u)
-
+ self.connect(intl, resamp, self.u)
+
+ if options.gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
+
+ self.set_gain(options.gain, 0)
+ self.set_gain(options.gain, 1)
- def set_freq(self, side, target_freq):
+ def set_freq(self, target_freq, chan):
"""
Set the center frequency we're interested in.
@param side: 0 = side A, 1 = side B
@param target_freq: frequency in Hz
@rtype: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital up converter.
"""
- print "Tuning side %s to %sHz" % (("A", "B")[side], num_to_str(target_freq))
- r = self.u.tune(self.subdev[side].which(), self.subdev[side], target_freq)
+ print "Tuning channel %s to %sHz" % \
+ (chan, num_to_str(target_freq))
+
+ r = self.u.set_center_freq(target_freq, chan)
+
if r:
- print " r.baseband_freq =", num_to_str(r.baseband_freq)
- print " r.dxc_freq =", num_to_str(r.dxc_freq)
- print " r.residual_freq =", num_to_str(r.residual_freq)
- print " r.inverted =", r.inverted
- print " OK"
return True
else:
- print " Failed!"
+ print " Set Frequency Failed!"
return False
+ def set_gain(self, gain, chan):
+ self.u.set_gain(gain, chan)
if __name__ == '__main__':
try:
diff --git a/gr-uhd/examples/max_power.py b/gr-uhd/examples/max_power.py
new file mode 100755
index 000000000..44d3beeee
--- /dev/null
+++ b/gr-uhd/examples/max_power.py
@@ -0,0 +1,142 @@
+#!/usr/bin/env python
+#
+# Copyright 2004,2007,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.
+#
+
+"""
+Setup USRP for maximum power consumption.
+"""
+
+
+from gnuradio import gr
+from gnuradio import uhd
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+
+from gnuradio import eng_notation
+
+n2s = eng_notation.num_to_str
+
+# Set this to a huge number; UHD will adjust to the
+# maximum the USRP xxxx device can handle
+MAX_RATE = 1000e6
+
+class build_block(gr.top_block):
+ def __init__(self, address, tx_enable, rx_enable):
+ gr.top_block.__init__(self)
+
+ d = uhd.device_find(uhd.device_addr(address))
+ uhd_type = d[0].get('type')
+
+ print "\nFound '%s' at address '%s'" % \
+ (uhd_type, address)
+
+ # Test the type of USRP; if it's a USRP (v1), it has
+ # 2 channels; otherwise, it has 1 channel
+ if uhd_type == "usrp":
+ tx_nchan = 2
+ rx_nchan = 2
+ else:
+ tx_nchan = 1
+ rx_nchan = 1
+
+ if tx_enable:
+ print "\nTRANSMIT CHAIN"
+ self.u_tx = uhd.usrp_sink(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=tx_nchan)
+ self.u_tx.set_samp_rate(MAX_RATE)
+
+ self.tx_src0 = gr.sig_source_c(self.u_tx.get_samp_rate(),
+ gr.GR_CONST_WAVE,
+ 0, 1.0, 0)
+
+ # Get dboard gain range and select maximum
+ tx_gain_range = self.u_tx.get_gain_range()
+ tx_gain = tx_gain_range.stop()
+
+ # Get dboard freq range and select midpoint
+ tx_freq_range = self.u_tx.get_freq_range()
+ tx_freq_mid = (tx_freq_range.start() + tx_freq_range.stop())/2.0
+
+ for i in xrange(tx_nchan):
+ self.u_tx.set_center_freq (tx_freq_mid + i*1e6, i)
+ self.u_tx.set_gain(tx_gain, i)
+
+ print "\nTx Sample Rate: %ssps" % (n2s(self.u_tx.get_samp_rate()))
+ for i in xrange(tx_nchan):
+ print "Tx Channel %d: " % (i)
+ print "\tFrequency = %sHz" % \
+ (n2s(self.u_tx.get_center_freq(i)))
+ print "\tGain = %f dB" % (self.u_tx.get_gain(i))
+ print ""
+
+ self.connect (self.tx_src0, self.u_tx)
+
+ if rx_enable:
+ print "\nRECEIVE CHAIN"
+ self.u_rx = uhd.usrp_source(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=rx_nchan)
+ self.rx_dst0 = gr.null_sink (gr.sizeof_gr_complex)
+
+ self.u_rx.set_samp_rate(MAX_RATE)
+
+ # Get dboard gain range and select maximum
+ rx_gain_range = self.u_rx.get_gain_range()
+ rx_gain = rx_gain_range.stop()
+
+ # Get dboard freq range and select midpoint
+ rx_freq_range = self.u_rx.get_freq_range()
+ rx_freq_mid = (rx_freq_range.start() + rx_freq_range.stop())/2.0
+
+ for i in xrange(tx_nchan):
+ self.u_rx.set_center_freq (rx_freq_mid + i*1e6, i)
+ self.u_rx.set_gain(rx_gain, i)
+
+ print "\nRx Sample Rate: %ssps" % (n2s(self.u_rx.get_samp_rate()))
+ for i in xrange(rx_nchan):
+ print "Rx Channel %d: " % (i)
+ print "\tFrequency = %sHz" % \
+ (n2s(self.u_rx.get_center_freq(i)))
+ print "\tGain = %f dB" % (self.u_rx.get_gain(i))
+ print ""
+
+ self.connect (self.u_rx, self.rx_dst0)
+
+def main ():
+ parser = OptionParser (option_class=eng_option)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-t", action="store_true", dest="tx_enable",
+ default=False, help="enable Tx path")
+ parser.add_option("-r", action="store_true", dest="rx_enable",
+ default=False, help="enable Rx path")
+ (options, args) = parser.parse_args ()
+
+ tb = build_block (options.address, options.tx_enable, options.rx_enable)
+
+ tb.start ()
+ raw_input ('Press Enter to quit: ')
+ tb.stop ()
+
+if __name__ == '__main__':
+ main ()
diff --git a/gnuradio-examples/python/digital/.gitignore b/gr-uhd/examples/multi-antenna/.gitignore
index ff40c06f3..ff40c06f3 100644
--- a/gnuradio-examples/python/digital/.gitignore
+++ b/gr-uhd/examples/multi-antenna/.gitignore
diff --git a/gnuradio-examples/python/multi-antenna/Makefile.am b/gr-uhd/examples/multi-antenna/Makefile.am
index 0cb944589..0cb944589 100644
--- a/gnuradio-examples/python/multi-antenna/Makefile.am
+++ b/gr-uhd/examples/multi-antenna/Makefile.am
diff --git a/gr-uhd/examples/multi-antenna/multi_fft.py b/gr-uhd/examples/multi-antenna/multi_fft.py
new file mode 100755
index 000000000..d4c878c84
--- /dev/null
+++ b/gr-uhd/examples/multi-antenna/multi_fft.py
@@ -0,0 +1,152 @@
+#!/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, eng_notation
+from gnuradio import uhd
+from gnuradio.eng_option import eng_option
+from gnuradio import eng_notation
+from gnuradio import optfir
+from optparse import OptionParser
+from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2
+from gnuradio.wxgui import scopesink2, form, slider
+import wx
+import time
+import os.path
+import sys
+
+# required FPGA that can do 4 rx channels.
+
+class my_graph(stdgui2.std_top_block):
+
+ def __init__(self, frame, panel, vbox, argv):
+ stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
+
+ self.frame = frame
+ self.panel = panel
+
+ parser = OptionParser (option_class=eng_option)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate (bandwidth) [default=%default]")
+ parser.add_option("-f", "--freq", type="eng_float", default=None,
+ help="set frequency to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
+ parser.add_option("-F", "--filter", action="store_true", default=True,
+ help="Enable channel filter")
+ parser.add_option("-N", "--nchans", type="int", default=1,
+ help="set number of channels (default=%default)")
+ (options, args) = parser.parse_args()
+
+ if len(args) != 0:
+ parser.print_help()
+ raise SystemExit
+
+ self.nchans = options.nchans
+
+ if options.filter:
+ sw_decim = 4
+ else:
+ sw_decim = 1
+
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=self.nchans)
+ self.u.set_samp_rate(options.samp_rate)
+ input_rate = self.u.get_samp_rate()
+
+ if options.gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2
+
+ if options.freq is None:
+ # if no freq was specified, use the mid-point
+ r = self.u.get_freq_range()
+ options.freq = float(r.start()+r.stop())/2
+
+ self.set_gain(options.gain)
+ self.set_freq(options.freq)
+
+ #if self.u.nddcs() < nchan:
+ # sys.stderr.write('This code requires an FPGA build with %d DDCs. This FPGA has only %d.\n' % (
+ # nchan, self.u.nddcs()))
+ # raise SystemExit
+
+ #if (len (self.subdev) < 4 or
+ # self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX or
+ # self.u.db(0, 0).dbid() != usrp_dbid.BASIC_RX):
+ # sys.stderr.write('This code requires a Basic Rx board on Sides A & B\n')
+ # sys.exit(1)
+
+ # deinterleave four channels from FPGA
+ di = gr.deinterleave(gr.sizeof_gr_complex)
+
+ self.connect(self.u, di)
+
+ # taps for channel filter
+ chan_filt_coeffs = optfir.low_pass (1, # gain
+ input_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
+ #print len(chan_filt_coeffs)
+
+ for i in range(self.nchans):
+ scope = fftsink2.fft_sink_c(panel, sample_rate=input_rate/sw_decim,
+ title="Input %d" % (i,),
+ ref_level=80, y_per_div=20)
+ vbox.Add(scope.win, 10, wx.EXPAND)
+
+ if options.filter:
+ chan_filt = gr.fir_filter_ccf(sw_decim, chan_filt_coeffs)
+ self.connect((di, i), chan_filt, scope)
+ else:
+ self.connect((di, i), scope)
+
+ def set_gain(self, gain):
+ for i in range(self.nchans):
+ self.u.set_gain(gain, i)
+
+
+ def set_freq(self, target_freq):
+ for i in range(self.nchans):
+ r = self.u.set_center_freq(target_freq, 0)
+
+ if r:
+ return True
+ else:
+ print "set_freq: failed to set subdev[%d] freq to %f" % \
+ (i, target_freq)
+ return False
+
+def main ():
+ app = stdgui2.stdapp(my_graph, "Multi Scope", nstatus=1)
+ app.MainLoop()
+
+if __name__ == '__main__':
+ main ()
diff --git a/gnuradio-examples/python/multi-antenna/multi_file.py b/gr-uhd/examples/multi-antenna/multi_file.py
index 87d9085e3..87d9085e3 100755
--- a/gnuradio-examples/python/multi-antenna/multi_file.py
+++ b/gr-uhd/examples/multi-antenna/multi_file.py
diff --git a/gnuradio-examples/python/multi-antenna/multi_scope.py b/gr-uhd/examples/multi-antenna/multi_scope.py
index d1e28ad18..d1e28ad18 100755
--- a/gnuradio-examples/python/multi-antenna/multi_scope.py
+++ b/gr-uhd/examples/multi-antenna/multi_scope.py
diff --git a/gnuradio-examples/python/usrp/usrp_am_mw_rcv.py b/gr-uhd/examples/usrp_am_mw_rcv.py
index 60f6c5825..130bdcf56 100755
--- a/gnuradio-examples/python/usrp/usrp_am_mw_rcv.py
+++ b/gr-uhd/examples/usrp_am_mw_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,9 +20,9 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir
+from gnuradio import gr, eng_notation, optfir
from gnuradio import audio
-from gnuradio import usrp
+from gnuradio import uhd
from gnuradio import blks2
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
@@ -33,30 +33,18 @@ import sys
import math
import wx
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: BASIC_RX,TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.BASIC_RX,
- usrp_dbid.LF_RX,
- usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO))
-
-
class wfm_rx_block (stdgui2.std_top_block):
- def __init__(self,frame,panel,vbox,argv):
- stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
+ def __init__(self, frame, panel, vbox, argv):
+ stdgui2.std_top_block.__init__ (self, frame, panel, vbox, argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate (bandwidth) [default=%default]")
parser.add_option("-f", "--freq", type="eng_float", default=1008.0e3,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-I", "--use-if-freq", action="store_true", default=False,
@@ -86,77 +74,72 @@ class wfm_rx_block (stdgui2.std_top_block):
self.freq = 0
# build graph
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ usrp_rate = 256e3
+ demod_rate = 64e3
+ audio_rate = 32e3
+ chanfilt_decim = int(usrp_rate // demod_rate)
+ audio_decim = int(demod_rate // audio_rate)
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
- #TODO: add an AGC after the channel filter and before the AM_demod
+ # Resample signal to exactly self.usrp_rate
+ # FIXME: make one of the follow-on filters an arb resampler
+ rrate = usrp_rate / dev_rate
+ self.resamp = blks2.pfb_arb_resampler_ccf(rrate)
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 250
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 256 kS/s
- chanfilt_decim = 4
- demod_rate = usrp_rate / chanfilt_decim # 64 kHz
- audio_decimation = 2
- audio_rate = demod_rate / audio_decimation # 32 kHz
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-
-
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 8e3, # passband cutoff
- 12e3, # stopband cutoff
- 1.0, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- self.chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
+ chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
+ usrp_rate, # sampling rate
+ 8e3, # passband cutoff
+ 4e3, # transition bw
+ 60) # stopband attenuation
+
if self.use_IF:
# Turn If to baseband and filter.
- self.chan_filt = gr.freq_xlating_fir_filter_ccf (chanfilt_decim, chan_filt_coeffs, self.IF_freq, usrp_rate)
+ self.chan_filt = gr.freq_xlating_fir_filter_ccf (chanfilt_decim,
+ chan_filt_coeffs,
+ self.IF_freq,
+ usrp_rate)
else:
self.chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
- self.am_demod = gr.complex_to_mag()
+ self.agc = gr.agc_cc(0.1, 1, 1, 100000)
+ self.am_demod = gr.complex_to_mag()
self.volume_control = gr.multiply_const_ff(self.vol)
- audio_filt_coeffs = optfir.low_pass (1, # gain
- demod_rate, # sampling rate
- 8e3, # passband cutoff
- 10e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- self.audio_filt=gr.fir_filter_fff(audio_decimation,audio_filt_coeffs)
+ audio_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
+ demod_rate, # sampling rate
+ 8e3, # passband cutoff
+ 2e3, # transition bw
+ 60) # stopband attenuation
+ self.audio_filt=gr.fir_filter_fff(audio_decim, audio_filt_coeffs)
+
# sound card as final sink
- audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink (int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, self.chan_filt, self.am_demod, self.audio_filt, self.volume_control, audio_sink)
+ self.connect (self.u, self.resamp, self.chan_filt, self.agc,
+ self.am_demod, self.audio_filt,
+ self.volume_control, self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
if options.gain is None:
- g = self.subdev.gain_range()
+ g = self.u.get_gain_range()
if True:
- # if no gain was specified, use the maximum gain available
- # (usefull for Basic_RX which is relatively deaf and the most probable board to be used for AM)
- # TODO: check db type to decide on default gain.
- options.gain = float(g[1])
- else:
- # if no gain was specified, use the mid-point in dB
- options.gain = float(g[0]+g[1])/2
-
+ # if no gain was specified, use the mid gain
+ options.gain = (g.start() + g.stop())/2.0
+ options.gain = g.stop()
if options.volume is None:
- g = self.volume_range()
- options.volume = float(g[0]*3+g[1])/4
+ v = self.volume_range()
+ options.volume = float(v[0]*3+v[1])/4.0
if abs(options.freq) < 1e3:
options.freq *= 1e3
@@ -168,6 +151,8 @@ class wfm_rx_block (stdgui2.std_top_block):
if not(self.set_freq(options.freq)):
self._set_status_msg("Failed to set initial frequency")
+ if(options.antenna):
+ self.u.set_antenna(options.antenna, 0)
def _set_status_msg(self, msg, which=0):
self.frame.GetStatusBar().SetStatusText(msg, which)
@@ -179,7 +164,7 @@ class wfm_rx_block (stdgui2.std_top_block):
return self.set_freq(kv['freq'])
- if 1:
+ if 0:
self.src_fft = fftsink2.fft_sink_c(self.panel, title="Data from USRP",
fft_size=512, sample_rate=usrp_rate,
ref_scale=32768.0, ref_level=0.0, y_divs=12)
@@ -233,9 +218,10 @@ class wfm_rx_block (stdgui2.std_top_block):
callback=self.set_vol)
hbox.Add((5,0), 1)
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -291,14 +277,8 @@ class wfm_rx_block (stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq + self.IF_freq)
- #TODO: check if db is inverting the spectrum or not to decide if we should do + self.IF_freq or - self.IF_freq
+ r = self.u.set_center_freq(target_freq + self.IF_freq, 0)
if r:
self.freq = target_freq
@@ -313,7 +293,7 @@ class wfm_rx_block (stdgui2.std_top_block):
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def update_status_bar (self):
msg = "Volume:%r Setting:%s" % (self.vol, self.state)
diff --git a/gnuradio-examples/python/usrp/usrp_nbfm_ptt.py b/gr-uhd/examples/usrp_nbfm_ptt.py
index 3ce1e0c49..af3b132f4 100755
--- a/gnuradio-examples/python/usrp/usrp_nbfm_ptt.py
+++ b/gr-uhd/examples/usrp_nbfm_ptt.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007.2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -25,10 +25,7 @@ import sys
import wx
from optparse import OptionParser
-from gnuradio import gr, gru, eng_notation
-from gnuradio import usrp
-from gnuradio import audio
-from gnuradio import blks2
+from gnuradio import gr, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import stdgui2, fftsink2, scopesink2, slider, form
from usrpm import usrp_dbid
@@ -51,14 +48,17 @@ class ptt_block(stdgui2.std_top_block):
self.space_bar_pressed = False
parser = OptionParser (option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B")
- parser.add_option("-T", "--tx-subdev-spec", type="subdev", default=None,
- help="select USRP Tx side A or B")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option ("-f", "--freq", type="eng_float", default=442.1e6,
help="set Tx and Rx frequency to FREQ", metavar="FREQ")
parser.add_option ("-g", "--rx-gain", type="eng_float", default=None,
help="set rx gain [default=midpoint in dB]")
+ parser.add_option ("", "--tx-gain", type="eng_float", default=None,
+ help="set tx gain [default=midpoint in dB]")
parser.add_option("-I", "--audio-input", type="string", default="",
help="pcm input device name. E.g., hw:0,0 or /dev/dsp")
parser.add_option("-O", "--audio-output", type="string", default="",
@@ -73,8 +73,10 @@ class ptt_block(stdgui2.std_top_block):
if options.freq < 1e6:
options.freq *= 1e6
- self.txpath = transmit_path(options.tx_subdev_spec, options.audio_input)
- self.rxpath = receive_path(options.rx_subdev_spec, options.rx_gain, options.audio_output)
+ self.txpath = transmit_path(options.address, options.tx_gain,
+ options.audio_input)
+ self.rxpath = receive_path(options.address, options.rx_gain,
+ options.audio_output)
self.connect(self.txpath)
self.connect(self.rxpath)
@@ -152,10 +154,10 @@ class ptt_block(stdgui2.std_top_block):
vbox.Add (rx_fft.win, 1, wx.EXPAND)
if 1 and not(no_gui):
- rx_fft = fftsink2.fft_sink_c(panel, title="Post s/w DDC",
+ rx_fft = fftsink2.fft_sink_c(panel, title="Post s/w Resampler",
fft_size=512, sample_rate=self.rxpath.quad_rate,
ref_level=80, y_per_div=20)
- self.connect (self.rxpath.ddc, rx_fft)
+ self.connect (self.rxpath.resamp, rx_fft)
vbox.Add (rx_fft.win, 1, wx.EXPAND)
if 0 and not(no_gui):
@@ -199,10 +201,12 @@ class ptt_block(stdgui2.std_top_block):
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Squelch",
weight=3, range=self.rxpath.squelch_range(),
callback=self.set_squelch)
+
+ g = self.rxpath.u.get_gain_range()
hbox.Add((5,0), 0)
myform['rx_gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Rx Gain",
- weight=3, range=self.rxpath.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_rx_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -269,19 +273,20 @@ class ptt_block(stdgui2.std_top_block):
# ////////////////////////////////////////////////////////////////////////
class transmit_path(gr.hier_block2):
- def __init__(self, subdev_spec, audio_input):
+ def __init__(self, address, gain, audio_input):
gr.hier_block2.__init__(self, "transmit_path",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
- self.u = usrp.sink_c ()
+ self.u = uhd.usrp_sink(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self.if_rate = 320e3
+ self.audio_rate = 32e3
- dac_rate = self.u.dac_rate();
- self.if_rate = 320e3 # 320 kS/s
- self.usrp_interp = int(dac_rate // self.if_rate)
- self.u.set_interp_rate(self.usrp_interp)
- self.sw_interp = 10
- self.audio_rate = self.if_rate // self.sw_interp # 32 kS/s
+ self.u.set_samp_rate(self.if_rate)
+ dev_rate = self.u.get_samp_rate()
self.audio_gain = 10
self.normal_gain = 32000
@@ -289,16 +294,16 @@ class transmit_path(gr.hier_block2):
self.audio = audio.source(int(self.audio_rate), audio_input)
self.audio_amp = gr.multiply_const_ff(self.audio_gain)
- lpf = gr.firdes.low_pass (1, # gain
- self.audio_rate, # sampling rate
+ lpf = gr.firdes.low_pass (1, # gain
+ self.audio_rate, # sampling rate
3800, # low pass cutoff freq
300, # width of trans. band
gr.firdes.WIN_HANN) # filter type
- hpf = gr.firdes.high_pass (1, # gain
- self.audio_rate, # sampling rate
- 325, # low pass cutoff freq
- 50, # width of trans. band
+ hpf = gr.firdes.high_pass (1, # gain
+ self.audio_rate, # sampling rate
+ 325, # low pass cutoff freq
+ 50, # width of trans. band
gr.firdes.WIN_HANN) # filter type
audio_taps = convolve(array(lpf),array(hpf))
@@ -311,18 +316,21 @@ class transmit_path(gr.hier_block2):
self.fmtx = blks2.nbfm_tx(self.audio_rate, self.if_rate)
self.amp = gr.multiply_const_cc (self.normal_gain)
- # determine the daughterboard subdevice we're using
- if subdev_spec is None:
- subdev_spec = usrp.pick_tx_subdevice(self.u)
- self.u.set_mux(usrp.determine_tx_mux_value(self.u, subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, subdev_spec)
- print "TX using", self.subdev.name()
+ rrate = dev_rate / self.if_rate
+ self.resamp = blks2.pfb_arb_resampler_ccf(rrate)
self.connect(self.audio, self.audio_amp, self.audio_filt,
- (self.add_pl,0), self.fmtx, self.amp, self.u)
+ (self.add_pl,0), self.fmtx, self.amp,
+ self.resamp, self.u)
+
+ if gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ gain = float(g.start() + g.stop())/2.0
- self.set_gain(self.subdev.gain_range()[1]) # set max Tx gain
+ self.set_gain(gain)
+ self.set_enable(False)
def set_freq(self, target_freq):
"""
@@ -330,26 +338,17 @@ class transmit_path(gr.hier_block2):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital up converter. Finally, we feed
- any residual_freq to the s/w freq translater.
"""
- r = self.u.tune(self.subdev.which(), self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
if r:
- # Use residual_freq in s/w freq translator
return True
-
return False
def set_gain(self, gain):
self.gain = gain
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def set_enable(self, enable):
- self.subdev.set_enable(enable) # set H/W Tx enable
if enable:
self.amp.set_k (self.normal_gain)
else:
@@ -362,64 +361,53 @@ class transmit_path(gr.hier_block2):
# ////////////////////////////////////////////////////////////////////////
class receive_path(gr.hier_block2):
- def __init__(self, subdev_spec, gain, audio_output):
+ def __init__(self, address, gain, audio_output):
gr.hier_block2.__init__(self, "receive_path",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
- self.u = usrp.source_c ()
- adc_rate = self.u.adc_rate()
-
- self.if_rate = 256e3 # 256 kS/s
- usrp_decim = int(adc_rate // self.if_rate)
- if_decim = 4
- self.u.set_decim_rate(usrp_decim)
- self.quad_rate = self.if_rate // if_decim # 64 kS/s
- audio_decim = 2
- audio_rate = self.quad_rate // audio_decim # 32 kS/s
+ self.u = uhd.usrp_source(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
- if subdev_spec is None:
- subdev_spec = usrp.pick_rx_subdevice(self.u)
- self.subdev = usrp.selected_subdev(self.u, subdev_spec)
- print "RX using", self.subdev.name()
+ self.if_rate = 256e3
+ self.quad_rate = 64e3
+ self.audio_rate = 32e3
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, subdev_spec))
+ self.u.set_samp_rate(self.if_rate)
+ dev_rate = self.u.get_samp_rate()
# Create filter to get actual channel we want
- chan_coeffs = gr.firdes.low_pass (1.0, # gain
- self.if_rate, # sampling rate
+ nfilts = 32
+ chan_coeffs = gr.firdes.low_pass (nfilts, # gain
+ nfilts*dev_rate, # sampling rate
13e3, # low pass cutoff freq
4e3, # width of trans. band
gr.firdes.WIN_HANN) # filter type
- print "len(rx_chan_coeffs) =", len(chan_coeffs)
-
- # Decimating Channel filter with frequency translation
- # complex in and out, float taps
- self.ddc = gr.freq_xlating_fir_filter_ccf(if_decim, # decimation rate
- chan_coeffs, # taps
- 0, # frequency translation amount
- self.if_rate) # input sample rate
+ rrate = self.quad_rate / dev_rate
+ self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
# instantiate the guts of the single channel receiver
- self.fmrx = blks2.nbfm_rx(audio_rate, self.quad_rate)
+ self.fmrx = blks2.nbfm_rx(self.audio_rate, self.quad_rate)
# standard squelch block
- self.squelch = blks2.standard_squelch(audio_rate)
+ self.squelch = blks2.standard_squelch(self.audio_rate)
# audio gain / mute block
self._audio_gain = gr.multiply_const_ff(1.0)
# sound card as final sink
- audio_sink = audio.sink (int(audio_rate), audio_output)
+ audio_sink = audio.sink (int(self.audio_rate), audio_output)
# now wire it all together
- self.connect (self.u, self.ddc, self.fmrx, self.squelch, self._audio_gain, audio_sink)
+ self.connect (self.u, self.resamp, self.fmrx, self.squelch,
+ self._audio_gain, audio_sink)
if gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ gain = float(g.start() + g.stop())/2.0
self.enabled = True
self.set_gain(gain)
@@ -463,26 +451,15 @@ class receive_path(gr.hier_block2):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter in the
- FPGA. Finally, we feed any residual_freq to the s/w freq
- translator.
"""
- r = self.u.tune(0, self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
if r:
- # Use residual_freq in s/w freq translater
- # print "residual_freq =", r.residual_freq
- self.ddc.set_center_freq(-r.residual_freq)
return True
-
return False
def set_gain(self, gain):
self.gain = gain
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
# ////////////////////////////////////////////////////////////////////////
diff --git a/gnuradio-examples/python/usrp/usrp_nbfm_rcv.py b/gr-uhd/examples/usrp_nbfm_rcv.py
index 4c66fc970..2dc69423c 100755
--- a/gnuradio-examples/python/usrp/usrp_nbfm_rcv.py
+++ b/gr-uhd/examples/usrp_nbfm_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,20 +20,15 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
+from gnuradio import gr, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
import math
import wx
-
#////////////////////////////////////////////////////////////////////////
# Control Stuff
#////////////////////////////////////////////////////////////////////////
@@ -43,8 +38,11 @@ class my_top_block (stdgui2.std_top_block):
stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option("-f", "--freq", type="eng_float", default=146.585e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=None,
@@ -70,7 +68,8 @@ class my_top_block (stdgui2.std_top_block):
self.freq = 0
self.freq_step = 25e3
- self.rxpath = receive_path(options.rx_subdev_spec, options.gain, options.audio_output)
+ self.rxpath = receive_path(options.address, options.antenna,
+ options.gain, options.audio_output)
self.connect(self.rxpath)
self._build_gui(vbox, options.no_gui)
@@ -99,34 +98,47 @@ class my_top_block (stdgui2.std_top_block):
self.src_fft = None
- if 1 and not(no_gui):
- self.src_fft = fftsink2.fft_sink_c(self.panel, title="Data from USRP",
- fft_size=512, sample_rate=self.rxpath.if_rate,
- ref_scale=32768.0, ref_level=0, y_per_div=10, y_divs=12)
+ if 0 and not(no_gui):
+ self.src_fft = fftsink2.fft_sink_c(self.panel,
+ title="Data from USRP",
+ fft_size=512,
+ sample_rate=self.rxpath.if_rate,
+ ref_scale=32768.0,
+ ref_level=0,
+ y_per_div=10,
+ y_divs=12)
self.connect (self.rxpath.u, self.src_fft)
vbox.Add (self.src_fft.win, 4, wx.EXPAND)
if 1 and not(no_gui):
- rx_fft = fftsink2.fft_sink_c(self.panel, title="Post s/w DDC",
- fft_size=512, sample_rate=self.rxpath.quad_rate,
- ref_level=80, y_per_div=20)
- self.connect (self.rxpath.ddc, rx_fft)
+ rx_fft = fftsink2.fft_sink_c(self.panel,
+ title="Post s/w Resampling",
+ fft_size=512,
+ sample_rate=self.rxpath.quad_rate,
+ ref_level=80,
+ y_per_div=20)
+ self.connect (self.rxpath.resamp, rx_fft)
vbox.Add (rx_fft.win, 4, wx.EXPAND)
if 1 and not(no_gui):
- post_deemph_fft = fftsink2.fft_sink_f(self.panel, title="Post Deemph",
- fft_size=512, sample_rate=self.rxpath.audio_rate,
- y_per_div=10, ref_level=-40)
+ post_deemph_fft = fftsink2.fft_sink_f(self.panel,
+ title="Post Deemph",
+ fft_size=512,
+ sample_rate=self.rxpath.audio_rate,
+ y_per_div=10,
+ ref_level=-40)
self.connect (self.rxpath.fmrx.deemph, post_deemph_fft)
vbox.Add (post_deemph_fft.win, 4, wx.EXPAND)
if 0:
- post_filt_fft = fftsink2.fft_sink_f(self.panel, title="Post Filter",
- fft_size=512, sample_rate=audio_rate,
- y_per_div=10, ref_level=-40)
+ post_filt_fft = fftsink2.fft_sink_f(self.panel,
+ title="Post Filter",
+ fft_size=512,
+ sample_rate=audio_rate,
+ y_per_div=10,
+ ref_level=-40)
self.connect (self.guts.audio_filter, post_filt)
vbox.Add (fft_win4, 4, wx.EXPAND)
-
# control area form at bottom
self.myform = myform = form.form()
@@ -134,7 +146,8 @@ class my_top_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq'] = form.float_field(
parent=self.panel, sizer=hbox, label="Freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
+ callback=myform.check_input_and_call(_form_set_freq,
+ self._set_status_msg))
#hbox.Add((5,0), 0)
#myform['freq_slider'] = \
@@ -157,10 +170,11 @@ class my_top_block (stdgui2.std_top_block):
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Squelch",
weight=3, range=self.rxpath.squelch_range(),
callback=self.set_squelch)
+ g = self.rxpath.u.get_gain_range()
hbox.Add((5,0), 0)
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.rxpath.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -246,45 +260,31 @@ class my_top_block (stdgui2.std_top_block):
USE_SIMPLE_SQUELCH = False
class receive_path(gr.hier_block2):
- def __init__(self, subdev_spec, gain, audio_output):
+ def __init__(self, address, antenna, gain, audio_output):
gr.hier_block2.__init__(self, "receive_path",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
- self.u = usrp.source_c ()
- adc_rate = self.u.adc_rate()
+ self.u = uhd.usrp_source(device_addr=address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
- self.if_rate = 256e3 # 256 kS/s
- usrp_decim = int(adc_rate // self.if_rate)
- if_decim = 4
- self.u.set_decim_rate(usrp_decim)
- self.quad_rate = self.if_rate // if_decim # 64 kS/s
- audio_decim = 2
- self.audio_rate = self.quad_rate // audio_decim # 32 kS/s
+ self.if_rate = 256e3
+ self.quad_rate = 64e3
+ self.audio_rate = 32e3
-
- if subdev_spec is None:
- subdev_spec = usrp.pick_rx_subdevice(self.u)
- self.subdev = usrp.selected_subdev(self.u, subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, subdev_spec))
+ self.u.set_samp_rate(self.if_rate)
+ dev_rate = self.u.get_samp_rate()
# Create filter to get actual channel we want
- chan_coeffs = gr.firdes.low_pass (1.0, # gain
- self.if_rate, # sampling rate
- 8e3, # low pass cutoff freq
- 2e3, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
-
- print "len(rx_chan_coeffs) =", len(chan_coeffs)
-
- # Decimating Channel filter with frequency translation
- # complex in and out, float taps
- self.ddc = gr.freq_xlating_fir_filter_ccf(if_decim, # decimation rate
- chan_coeffs, # taps
- 0, # frequency translation amount
- self.if_rate) # input sample rate
+ nfilts = 32
+ chan_coeffs = gr.firdes.low_pass (nfilts, # gain
+ nfilts*dev_rate, # sampling rate
+ 8e3, # low pass cutoff freq
+ 2e3, # width of trans. band
+ gr.firdes.WIN_HANN) # filter type
+ rrate = self.quad_rate / dev_rate
+ self.resamp = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
if USE_SIMPLE_SQUELCH:
self.squelch = gr.simple_squelch_cc(20)
@@ -302,24 +302,28 @@ class receive_path(gr.hier_block2):
# now wire it all together
if USE_SIMPLE_SQUELCH:
- self.connect (self.u, self.ddc, self.squelch, self.fmrx,
+ self.connect (self.u, self.resamp, self.squelch, self.fmrx,
self._audio_gain, audio_sink)
else:
- self.connect (self.u, self.ddc, self.fmrx, self.squelch,
+ self.connect (self.u, self.resamp, self.fmrx, self.squelch,
self._audio_gain, audio_sink)
if gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ gain = float(g.start()+g.stop())/2
self.set_gain(gain)
v = self.volume_range()
self.set_volume((v[0]+v[1])/2)
+
s = self.squelch_range()
self.set_squelch((s[0]+s[1])/2)
+ if(antenna):
+ self.u.set_antenna(antenna, 0)
+
def volume_range(self):
return (-20.0, 0.0, 0.5)
@@ -351,27 +355,16 @@ class receive_path(gr.hier_block2):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter in the
- FPGA. Finally, we feed any residual_freq to the s/w freq
- translator.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
if r:
- # Use residual_freq in s/w freq translater
- # print "residual_freq =", r.residual_freq
- self.ddc.set_center_freq(-r.residual_freq)
return True
-
return False
def set_gain(self, gain):
self.gain = gain
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
# ////////////////////////////////////////////////////////////////////////
diff --git a/gnuradio-examples/python/usrp/usrp_spectrum_sense.py b/gr-uhd/examples/usrp_spectrum_sense.py
index 90adf1671..e89745b3b 100755
--- a/gnuradio-examples/python/usrp/usrp_spectrum_sense.py
+++ b/gr-uhd/examples/usrp_spectrum_sense.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2005,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,16 +20,16 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir, window
+from gnuradio import gr, eng_notation, window
from gnuradio import audio
-from gnuradio import usrp
+from gnuradio import uhd
from gnuradio.eng_option import eng_option
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
import math
import struct
+sys.stderr.write("Warning: this is known to have issues on some machines+Python version combinations to seg fault due to the callback in bin_statitics. If you figure out why, we'd love to hear about it!\n")
class tune(gr.feval_dd):
"""
@@ -41,17 +41,20 @@ class tune(gr.feval_dd):
def eval(self, ignore):
"""
- This method is called from gr.bin_statistics_f when it wants to change
- the center frequency. This method tunes the front end to the new center
- frequency, and returns the new frequency as its result.
+ This method is called from gr.bin_statistics_f when it wants
+ to change the center frequency. This method tunes the front
+ end to the new center frequency, and returns the new frequency
+ as its result.
"""
+
try:
- # We use this try block so that if something goes wrong from here
- # down, at least we'll have a prayer of knowing what went wrong.
- # Without this, you get a very mysterious:
+ # We use this try block so that if something goes wrong
+ # from here down, at least we'll have a prayer of knowing
+ # what went wrong. Without this, you get a very
+ # mysterious:
#
- # terminate called after throwing an instance of 'Swig::DirectorMethodException'
- # Aborted
+ # terminate called after throwing an instance of
+ # 'Swig::DirectorMethodException' Aborted
#
# message on stderr. Not exactly helpful ;)
@@ -68,7 +71,7 @@ class parse_msg(object):
self.vlen = int(msg.arg2())
assert(msg.length() == self.vlen * gr.sizeof_float)
- # FIXME consider using Numarray or NumPy vector
+ # FIXME consider using NumPy array
t = msg.to_string()
self.raw_data = t
self.data = struct.unpack('%df' % (self.vlen,), t)
@@ -81,24 +84,25 @@ class my_top_block(gr.top_block):
usage = "usage: %prog [options] min_freq max_freq"
parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=(0,0),
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate [default=%default]")
parser.add_option("-g", "--gain", type="eng_float", default=None,
help="set gain in dB (default is midpoint)")
- parser.add_option("", "--tune-delay", type="eng_float", default=1e-3, metavar="SECS",
+ parser.add_option("", "--tune-delay", type="eng_float",
+ default=1e-3, metavar="SECS",
help="time to delay (in seconds) after changing frequency [default=%default]")
- parser.add_option("", "--dwell-delay", type="eng_float", default=10e-3, metavar="SECS",
+ parser.add_option("", "--dwell-delay", type="eng_float",
+ default=10e-3, metavar="SECS",
help="time to dwell (in seconds) at a given frequncy [default=%default]")
parser.add_option("-F", "--fft-size", type="int", default=256,
help="specify number of FFT bins [default=%default]")
- parser.add_option("-d", "--decim", type="intx", default=16,
- help="set decimation to DECIM [default=%default]")
parser.add_option("", "--real-time", action="store_true", default=False,
help="Attempt to enable real-time scheduling")
- parser.add_option("-B", "--fusb-block-size", type="int", default=0,
- help="specify fast usb block size [default=%default]")
- parser.add_option("-N", "--fusb-nblocks", type="int", default=0,
- help="specify number of fast usb blocks [default=%default]")
(options, args) = parser.parse_args()
if len(args) != 2:
@@ -109,11 +113,11 @@ class my_top_block(gr.top_block):
self.max_freq = eng_notation.str_to_num(args[1])
if self.min_freq > self.max_freq:
- self.min_freq, self.max_freq = self.max_freq, self.min_freq # swap them
+ # swap them
+ self.min_freq, self.max_freq = self.max_freq, self.min_freq
self.fft_size = options.fft_size
-
if not options.real_time:
realtime = False
else:
@@ -125,36 +129,14 @@ class my_top_block(gr.top_block):
realtime = False
print "Note: failed to enable realtime scheduling"
- # If the user hasn't set the fusb_* parameters on the command line,
- # pick some values that will reduce latency.
-
- if 1:
- if options.fusb_block_size == 0 and options.fusb_nblocks == 0:
- if realtime: # be more aggressive
- options.fusb_block_size = gr.prefs().get_long('fusb', 'rt_block_size', 1024)
- options.fusb_nblocks = gr.prefs().get_long('fusb', 'rt_nblocks', 16)
- else:
- options.fusb_block_size = gr.prefs().get_long('fusb', 'block_size', 4096)
- options.fusb_nblocks = gr.prefs().get_long('fusb', 'nblocks', 16)
-
- #print "fusb_block_size =", options.fusb_block_size
- #print "fusb_nblocks =", options.fusb_nblocks
-
# build graph
-
- self.u = usrp.source_c(fusb_block_size=options.fusb_block_size,
- fusb_nblocks=options.fusb_nblocks)
-
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = options.decim
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+ usrp_rate = options.samp_rate
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
s2v = gr.stream_to_vector(gr.sizeof_gr_complex, self.fft_size)
@@ -186,7 +168,8 @@ class my_top_block(gr.top_block):
self.msgq = gr.msg_queue(16)
self._tune_callback = tune(self) # hang on to this to keep it from being GC'd
stats = gr.bin_statistics_f(self.fft_size, self.msgq,
- self._tune_callback, tune_delay, dwell_delay)
+ self._tune_callback, tune_delay,
+ dwell_delay)
# FIXME leave out the log10 until we speed it up
#self.connect(self.u, s2v, fft, c2mag, log, stats)
@@ -194,8 +177,8 @@ class my_top_block(gr.top_block):
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
self.set_gain(options.gain)
print "gain =", options.gain
@@ -209,6 +192,7 @@ class my_top_block(gr.top_block):
if not self.set_freq(target_freq):
print "Failed to set frequency to", target_freq
+ sys.exit(1)
return target_freq
@@ -219,17 +203,15 @@ class my_top_block(gr.top_block):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
- return self.u.tune(0, self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
+ if r:
+ return True
+ return False
def set_gain(self, gain):
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def main_loop(tb):
@@ -254,7 +236,7 @@ def main_loop(tb):
if __name__ == '__main__':
tb = my_top_block()
try:
- tb.start() # start executing flow graph in another thread...
+ tb.start()
main_loop(tb)
except KeyboardInterrupt:
diff --git a/gnuradio-examples/python/usrp/usrp_tv_rcv.py b/gr-uhd/examples/usrp_tv_rcv.py
index 4e13a83ab..a68867365 100755
--- a/gnuradio-examples/python/usrp/usrp_tv_rcv.py
+++ b/gr-uhd/examples/usrp_tv_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,51 +22,38 @@
"""
Realtime capture and display of analog Tv stations.
+
Can also use a file as source or sink
-When you use an output file you can show the results frame-by-frame using ImageMagick
-When you want to use the realtime sdl display window you must first install gr-video-sdl (is in gnuradio cvs).
-When you use a file source, in stead of the usrp, make sure you capture interleaved shorts.
-(Use usrp_rx_file.py, or use usrp_rx_cfile.py --output-shorts if you have a recent enough usrp_rx_cfile.py)
-There is no synchronisation yet. The sync blocks are in development but not yet in cvs.
+When you use an output file you can show the results frame-by-frame
+using ImageMagick
+
+When you want to use the realtime sdl display window you must first
+install gr-video-sdl.
+
+When you use a file source, instead of the usrp, make sure you
+capture interleaved shorts. (Use usrp_rx_file.py, or use
+usrp_rx_cfile.py --output-shorts if you have a recent enough
+usrp_rx_cfile.py)
+
+There is no synchronisation yet. The sync blocks are in development
+but not yet in cvs.
"""
-from gnuradio import gr, gru, eng_notation, optfir
+
+from gnuradio import gr
try:
from gnuradio import video_sdl
except:
print "FYI: gr-video-sdl is not installed"
print "realtime SDL video output window will not be available"
-from gnuradio import usrp
+from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
-import math
import wx
-# To debug, insert this in your test code...
-#import os
-#print 'Blocked waiting for GDB attach (pid = %d)' % (os.getpid(),)
-#raw_input ('Press Enter to continue: ')
-# remainder of your test code follows...
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
class tv_rx_block (stdgui2.std_top_block):
def __init__(self,frame,panel,vbox,argv):
@@ -74,11 +61,14 @@ class tv_rx_block (stdgui2.std_top_block):
usage="%prog: [options] [input_filename]. \n If you don't specify an input filename the usrp will be used as source\n " \
"Make sure your input capture file containes interleaved shorts not complex floats"
- parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
- parser.add_option("-d", "--decim", type="int", default=64,
- help="set fgpa decimation rate to DECIM [default=%default]")
+ parser=OptionParser(option_class=eng_option, usage=usage)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate")
parser.add_option("-f", "--freq", type="eng_float", default=519.25e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=None,
@@ -87,8 +77,6 @@ class tv_rx_block (stdgui2.std_top_block):
help="set contrast (default is 1.0)")
parser.add_option("-b", "--brightness", type="eng_float", default=0.0,
help="set brightness (default is 0)")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
parser.add_option("-p", "--pal", action="store_true", default=False,
help="PAL video format (this is the default)")
parser.add_option("-n", "--ntsc", action="store_true", default=False,
@@ -97,8 +85,10 @@ class tv_rx_block (stdgui2.std_top_block):
help="For example out_raw_uchar.gray. If you don't specify an output filename you will get a video_sink_sdl realtime output window. You then need to have gr-video-sdl installed)")
parser.add_option("-r", "--repeat", action="store_false", default=True,
help="repeat file in a loop")
- parser.add_option("-N", "--no-hb", action="store_true", default=False,
- help="don't use halfband filter in usrp")
+ parser.add_option("", "--freq-min", type="eng_float", default=50.25e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=900.25e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args()
if not ((len(args) == 1) or (len(args) == 0)):
@@ -118,68 +108,70 @@ class tv_rx_block (stdgui2.std_top_block):
self.state = "FREQ"
self.freq = 0
- # build graph
+ self.tv_freq_min = options.freq_min
+ self.tv_freq_max = options.freq_max
+ # build graph
self.u=None
- usrp_decim = options.decim # 32
-
if not (options.out_filename=="sdl"):
options.repeat=False
+ usrp_rate = options.samp_rate
+
if not ((filename is None) or (filename=="usrp")):
- self.filesource = gr.file_source(gr.sizeof_short,filename,options.repeat) # file is data source
+ # file is data source
+ self.filesource = gr.file_source(gr.sizeof_short,filename,options.repeat)
self.istoc = gr.interleaved_short_to_complex()
self.connect(self.filesource,self.istoc)
- adc_rate=64e6
self.src=self.istoc
+
options.gain=0.0
self.gain=0.0
- else:
- if options.no_hb or (options.decim<8):
- self.fpga_filename="std_4rx_0tx.rbf" #contains 4 Rx paths without halfbands and 0 tx paths
- else:
- self.fpga_filename="std_2rxhb_2tx.rbf" # contains 2 Rx paths with halfband filters and 2 tx paths (the default)
- self.u = usrp.source_c(0,fpga_filename=self.fpga_filename) # usrp is data source
- if options.width_8:
- sample_width = 8
- sample_shift = 8
- format = self.u.make_format(sample_width, sample_shift)
- r = self.u.set_format(format)
- adc_rate = self.u.adc_rate() # 64 MS/s
- self.u.set_decim_rate(usrp_decim)
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
+
+ else: # use a UHD device
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
+
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
+
self.src=self.u
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
+ self.gain = options.gain
f2uc=gr.float_to_uchar()
+
# sdl window as final sink
if not (options.pal or options.ntsc):
options.pal=True #set default to PAL
+
if options.pal:
lines_per_frame=625.0
frames_per_sec=25.0
show_width=768
+
elif options.ntsc:
lines_per_frame=525.0
frames_per_sec=29.97002997
show_width=640
+
width=int(usrp_rate/(lines_per_frame*frames_per_sec))
height=int(lines_per_frame)
if (options.out_filename=="sdl"):
- #Here comes the tv screen, you have to build and install gr-video-sdl for this (subproject of gnuradio, only in cvs for now)
+ #Here comes the tv screen, you have to build and install
+ #gr-video-sdl for this (subproject of gnuradio, only in cvs
+ #for now)
try:
- video_sink = video_sdl.sink_uc ( frames_per_sec, width, height,0,show_width,height)
+ video_sink = video_sdl.sink_uc ( frames_per_sec, width, height, 0,
+ show_width, height)
except:
print "gr-video-sdl is not installed"
print "realtime \"sdl\" video output window is not available"
@@ -188,7 +180,8 @@ class tv_rx_block (stdgui2.std_top_block):
else:
print "You can use the imagemagick display tool to show the resulting imagesequence"
print "use the following line to show the demodulated TV-signal:"
- print "display -depth 8 -size " +str(width)+ "x" + str(height) + " gray:" + options.out_filename
+ print "display -depth 8 -size " +str(width)+ "x" + str(height) \
+ + " gray:" + options.out_filename
print "(Use the spacebar to advance to next frames)"
options.repeat=False
file_sink=gr.file_sink(gr.sizeof_char, options.out_filename)
@@ -204,11 +197,23 @@ class tv_rx_block (stdgui2.std_top_block):
process_type='do_no_sync'
if process_type=='do_no_sync':
- self.connect (self.src, self.agc,self.am_demod,self.invert_and_scale, self.set_blacklevel,f2uc,self.dst)
+ self.connect (self.src, self.agc,self.am_demod,
+ self.invert_and_scale, self.set_blacklevel,
+ f2uc,self.dst)
elif process_type=='do_tv_sync_adv':
- #defaults: gr.tv_sync_adv (double sampling_freq, unsigned int tv_format,bool output_active_video_only=false, bool do_invert=false, double wanted_black_level=0.0, double wanted_white_level=255.0, double avg_alpha=0.1, double initial_gain=1.0, double initial_offset=0.0,bool debug=false)
- self.tv_sync_adv=gr.tv_sync_adv(usrp_rate,0,False,False,0.0,255.0,0.01,1.0,0.0,False) #note, this block is not yet in cvs
- self.connect (self.src, self.am_demod,self.invert_and_scale,self.tv_sync_adv,s2f,f2uc,self.dst)
+ #defaults: gr.tv_sync_adv (double sampling_freq, unsigned
+ #int tv_format,bool output_active_video_only=false, bool
+ #do_invert=false, double wanted_black_level=0.0, double
+ #wanted_white_level=255.0, double avg_alpha=0.1, double
+ #initial_gain=1.0, double initial_offset=0.0,bool
+ #debug=false)
+
+ #note, this block is not yet in cvs
+ self.tv_sync_adv=gr.tv_sync_adv(usrp_rate, 0, False, False,
+ 0.0, 255.0, 0.01, 1.0, 0.0, False)
+ self.connect (self.src, self.am_demod, self.invert_and_scale,
+ self.tv_sync_adv, s2f, f2uc, self.dst)
+
elif process_type=='do_nullsink':
#self.connect (self.src, self.am_demod,self.invert_and_scale,f2uc,video_sink)
c2r=gr.complex_to_real()
@@ -221,18 +226,30 @@ class tv_rx_block (stdgui2.std_top_block):
debug=False
video_alpha=0.3 #0.1
corr_alpha=0.3
- tv_corr=gr.tv_correlator_ff(frame_size,nframes, search_window, video_alpha, corr_alpha,debug) #Note: this block is not yet in cvs
+
+ #Note: this block is not yet in cvs
+ tv_corr=gr.tv_correlator_ff(frame_size,nframes, search_window,
+ video_alpha, corr_alpha,debug)
shift=gr.add_const_ff(-0.7)
- self.connect (self.src, self.agc,self.am_demod,tv_corr,self.invert_and_scale, self.set_blacklevel,f2uc,self.dst) #self.agc,
+
+ self.connect (self.src, self.agc, self.am_demod, tv_corr,
+ self.invert_and_scale, self.set_blacklevel,
+ f2uc, self.dst)
else: # process_type=='do_test_image':
- src_vertical_bars = gr.sig_source_f (usrp_rate, gr.GR_SIN_WAVE, 10.0 *usrp_rate/320, 255,128)
- self.connect(src_vertical_bars,f2uc,self.dst)
+ src_vertical_bars = gr.sig_source_f (usrp_rate, gr.GR_SIN_WAVE,
+ 10.0 *usrp_rate/320, 255,128)
+ self.connect(src_vertical_bars, f2uc, self.dst)
self._build_gui(vbox, usrp_rate, usrp_rate, usrp_rate)
+
-
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.tv_freq_max or frange.stop() < self.tv_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.tv_freq_min or options.freq > self.tv_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
# set initial values
self.set_gain(options.gain)
@@ -286,7 +303,7 @@ class tv_rx_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq_slider'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(50.25e6, 900.25e6, 0.25e6),
+ range=(self.tv_freq_min, self.tv_freq_max, 0.25e6),
callback=self.set_freq)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -307,9 +324,10 @@ class tv_rx_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
if not (self.u is None):
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -387,7 +405,7 @@ class tv_rx_block (stdgui2.std_top_block):
determine the value for the digital down converter.
"""
if not (self.u is None):
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -400,17 +418,17 @@ class tv_rx_block (stdgui2.std_top_block):
return False
def set_gain(self, gain):
- if not (self.u is None):
- self.gain=gain
- self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
- self.update_status_bar()
-
+ if not (self.u is None):
+ self.gain=gain
+ self.myform['gain'].set_value(gain) # update displayed value
+ self.u.set_gain(gain)
+ self.update_status_bar()
+
def update_status_bar (self):
- msg = "Setting:%s Contrast:%r Brightness:%r Gain: %r" % (self.state, self.contrast,self.brightness,self.gain)
- self._set_status_msg(msg, 1)
+ msg = "Setting:%s Contrast:%r Brightness:%r Gain: %r" % \
+ (self.state, self.contrast,self.brightness,self.gain)
+ self._set_status_msg(msg, 1)
#self.src_fft.set_baseband_freq(self.freq)
-
if __name__ == '__main__':
diff --git a/gnuradio-examples/python/usrp/usrp_tv_rcv_nogui.py b/gr-uhd/examples/usrp_tv_rcv_nogui.py
index e6a8de1be..a44e20d39 100755
--- a/gnuradio-examples/python/usrp/usrp_tv_rcv_nogui.py
+++ b/gr-uhd/examples/usrp_tv_rcv_nogui.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,17 +22,21 @@
"""
Reads from a file and generates PAL TV pictures in black and white
-which can be displayed using ImageMagick or realtime using gr-video-sdl
-(To capture the input file Use usrp_rx_file.py, or use usrp_rx_cfile.py --output-shorts if you have a recent enough usrp_rx_cfile.py)
-Can also use usrp directly as capture source, but then you need a higher decimation factor (64)
-and thus get a lower horizontal resulution.
-There is no synchronisation yet. The sync blocks are in development but not yet in cvs.
+which can be displayed using ImageMagick or realtime using
+gr-video-sdl (To capture the input file Use usrp_rx_file.py, or use
+usrp_rx_cfile.py --output-shorts if you have a recent enough
+usrp_rx_cfile.py)
+
+Can also use usrp directly as capture source, but then you need a
+higher decimation factor (64) and thus get a lower horizontal
+resulution. There is no synchronisation yet. The sync blocks are in
+development but not yet in cvs.
"""
from gnuradio import gr, eng_notation
from gnuradio import audio
-from gnuradio import usrp
+from gnuradio import uhd
from gnuradio.eng_option import eng_option
from optparse import OptionParser
import sys
@@ -49,24 +53,31 @@ class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
- usage="%prog: [options] output_filename. \n Special output_filename \"sdl\" will use video_sink_sdl as realtime output window. " \
- "You then need to have gr-video-sdl installed. \n" \
- "Make sure your input capture file containes interleaved shorts not complex floats"
+ usage=("%prog: [options] output_filename.\nSpecial output_filename" + \
+ "\"sdl\" will use video_sink_sdl as realtime output window. " + \
+ "You then need to have gr-video-sdl installed.\n" +\
+ "Make sure your input capture file containes interleaved " + \
+ "shorts not complex floats")
parser = OptionParser(option_class=eng_option, usage=usage)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=(0, 0),
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-s", "--samp-rate", type="eng_float", default=1e6,
+ help="set sample rate")
parser.add_option("-c", "--contrast", type="eng_float", default=1.0,
help="set contrast (default is 1.0)")
parser.add_option("-b", "--brightness", type="eng_float", default=0.0,
help="set brightness (default is 0)")
- parser.add_option("-d", "--decim", type="int", default=8,
- help="set fgpa decimation rate to DECIM [default=%default]")
parser.add_option("-i", "--in-filename", type="string", default=None,
- help="Use input file as source. samples must be interleaved shorts \n " +
- "Use usrp_rx_file.py or usrp_rx_cfile.py --output-shorts. \n"
- "Special name \"usrp\" results in realtime capturing and processing using usrp. \n" +
- "You then probably need a decimation factor of 64 or higher.")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
+ help="Use input file as source. samples must be " + \
+ "interleaved shorts \n Use usrp_rx_file.py or " + \
+ "usrp_rx_cfile.py --output-shorts.\n Special " + \
+ "name \"usrp\" results in realtime capturing " + \
+ "and processing using usrp.\n" + \
+ "You then probably need a decimation factor of 64 or higher.")
+ parser.add_option("-f", "--freq", type="eng_float", default=519.25e6,
help="set frequency to FREQ.\nNote that the frequency of the video carrier is not at the middle of the TV channel", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=None,
help="set gain in dB (default is midpoint)")
@@ -76,12 +87,12 @@ class my_top_block(gr.top_block):
help="NTSC video format")
parser.add_option("-r", "--repeat", action="store_false", default=True,
help="repeat in_file in a loop")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
parser.add_option("-N", "--nframes", type="eng_float", default=None,
help="number of frames to collect [default=+inf]")
- parser.add_option( "--no-hb", action="store_true", default=False,
- help="don't use halfband filter in usrp")
+ parser.add_option("", "--freq-min", type="eng_float", default=50.25e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=900.25e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args ()
if not (len(args) == 1):
parser.print_help()
@@ -90,6 +101,9 @@ class my_top_block(gr.top_block):
filename = args[0]
+ self.tv_freq_min = options.freq_min
+ self.tv_freq_max = options.freq_max
+
if options.in_filename is None:
parser.print_help()
sys.stderr.write('You must specify the input -i FILENAME or -i usrp\n');
@@ -98,61 +112,51 @@ class my_top_block(gr.top_block):
if not (filename=="sdl"):
options.repeat=False
+ input_rate = options.samp_rate
+ print "video sample rate %s" % (eng_notation.num_to_str(input_rate))
+
if not (options.in_filename=="usrp"):
- self.filesource = gr.file_source(gr.sizeof_short,options.in_filename,options.repeat) # file is data source, capture with usr_rx_csfile.py
+ # file is data source, capture with usr_rx_csfile.py
+ self.filesource = gr.file_source(gr.sizeof_short,
+ options.in_filename,
+ options.repeat)
self.istoc = gr.interleaved_short_to_complex()
self.connect(self.filesource,self.istoc)
- self.adc_rate=64e6
self.src=self.istoc
else:
if options.freq is None:
parser.print_help()
sys.stderr.write('You must specify the frequency with -f FREQ\n');
raise SystemExit, 1
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
- if options.no_hb or (options.decim<8):
- self.fpga_filename="std_4rx_0tx.rbf" #contains 4 Rx paths without halfbands and 0 tx paths
- else:
- self.fpga_filename="std_2rxhb_2tx.rbf" # contains 2 Rx paths with halfband filters and 2 tx paths (the default)
# build the graph
- self.u = usrp.source_c(decim_rate=options.decim,fpga_filename=self.fpga_filename)
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ self.u.set_samp_rate(input_rate)
+ dev_rate = self.u.get_samp_rate()
+
self.src=self.u
- if options.width_8:
- sample_width = 8
- sample_shift = 8
- format = self.u.make_format(sample_width, sample_shift)
- r = self.u.set_format(format)
- self.adc_rate=self.u.adc_freq()
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = usrp.pick_rx_subdevice(self.u)
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- # determine the daughterboard subdevice we're using
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
- self.subdev.set_gain(options.gain)
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
+ self.u.set_gain(options.gain)
- r = self.u.tune(0, self.subdev, options.freq)
+ r = self.u.set_center_freq(options.freq)
if not r:
sys.stderr.write('Failed to set frequency\n')
raise SystemExit, 1
- input_rate = self.adc_rate / options.decim
- print "video sample rate %s" % (eng_notation.num_to_str(input_rate))
-
- self.agc=gr.agc_cc(1e-7,1.0,1.0) #1e-7
+ self.agc = gr.agc_cc(1e-7,1.0,1.0) #1e-7
self.am_demod = gr.complex_to_mag ()
- self.set_blacklevel=gr.add_const_ff(options.brightness +255.0)
+ self.set_blacklevel = gr.add_const_ff(options.brightness +255.0)
self.invert_and_scale = gr.multiply_const_ff (-options.contrast *128.0*255.0/(200.0))
- self.f2uc=gr.float_to_uchar()
+ self.f2uc = gr.float_to_uchar()
- # sdl window as final sink
+ # sdl window as final sink
if not (options.pal or options.ntsc):
options.pal=True #set default to PAL
if options.pal:
@@ -167,9 +171,12 @@ class my_top_block(gr.top_block):
height=int(lines_per_frame)
if filename=="sdl":
- #Here comes the tv screen, you have to build and install gr-video-sdl for this (subproject of gnuradio, only in cvs for now)
+ #Here comes the tv screen, you have to build and install
+ #gr-video-sdl for this (subproject of gnuradio, only in cvs
+ #for now)
try:
- video_sink = video_sdl.sink_uc ( frames_per_sec, width, height,0,show_width,height)
+ video_sink = video_sdl.sink_uc(frames_per_sec, width, height, 0,
+ show_width,height)
except:
print "gr-video-sdl is not installed"
print "realtime \"sdl\" video output window is not available"
@@ -189,9 +196,9 @@ class my_top_block(gr.top_block):
self.head = gr.head(gr.sizeof_gr_complex, int(options.nframes*width*height))
self.connect(self.src, self.head, self.agc)
- self.connect (self.agc,self.am_demod,self.invert_and_scale, self.set_blacklevel,self.f2uc,self.dst)
+ self.connect (self.agc, self.am_demod, self.invert_and_scale,
+ self.set_blacklevel, self.f2uc, self.dst)
-
if __name__ == '__main__':
try:
my_top_block().run()
diff --git a/gnuradio-examples/python/usrp/usrp_wfm_rcv.py b/gr-uhd/examples/usrp_wfm_rcv.py
index fba2a1210..7b35fbbe4 100755
--- a/gnuradio-examples/python/usrp/usrp_wfm_rcv.py
+++ b/gr-uhd/examples/usrp_wfm_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
+# Copyright 2005-2007,2009,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,42 +20,25 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
+from gnuradio import gr, optfir, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
-import math
import wx
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
class wfm_rx_block (stdgui2.std_top_block):
def __init__(self,frame,panel,vbox,argv):
stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=40,
@@ -64,6 +47,10 @@ class wfm_rx_block (stdgui2.std_top_block):
help="set volume (default is midpoint)")
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
+ parser.add_option("", "--freq-min", type="eng_float", default=87.9e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=108.1e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args()
if len(args) != 0:
@@ -77,72 +64,64 @@ class wfm_rx_block (stdgui2.std_top_block):
self.state = "FREQ"
self.freq = 0
+ self.fm_freq_min = options.freq_min
+ self.fm_freq_max = options.freq_max
+
# build graph
-
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = demod_rate / audio_decimation # 32 kHz
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
- dbid = self.subdev.dbid()
- if not (dbid == usrp_dbid.BASIC_RX or
- dbid == usrp_dbid.TV_RX or
- dbid == usrp_dbid.TV_RX_REV_2 or
- dbid == usrp_dbid.TV_RX_REV_3 or
- dbid == usrp_dbid.TV_RX_MIMO or
- dbid == usrp_dbid.TV_RX_REV_2_MIMO or
- dbid == usrp_dbid.TV_RX_REV_3_MIMO
-):
- print "This daughterboard does not cover the required frequency range"
- print "for this application. Please use a BasicRX or TVRX daughterboard."
- raw_input("Press ENTER to continue anyway, or Ctrl-C to exit.")
-
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 80e3, # passband cutoff
- 115e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
-
- self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 32e3
+ audio_decim = int(demod_rate / audio_rate)
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
+
+ nfilts = 32
+ chan_coeffs = optfir.low_pass (nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+ self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+
+ self.guts = blks2.wfm_rcv (demod_rate, audio_decim)
self.volume_control = gr.multiply_const_ff(self.vol)
# sound card as final sink
- audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink (int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, chan_filt, self.guts, self.volume_control, audio_sink)
+ self.connect (self.u, self.chan_filt, self.guts,
+ self.volume_control, self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2
if options.volume is None:
g = self.volume_range()
options.volume = float(g[0]+g[1])/2
+
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
# set initial values
@@ -196,7 +175,7 @@ class wfm_rx_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq_slider'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(87.9e6, 108.1e6, 0.1e6),
+ range=(self.fm_freq_min, self.fm_freq_max, 0.1e6),
callback=self.set_freq)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -210,9 +189,10 @@ class wfm_rx_block (stdgui2.std_top_block):
callback=self.set_vol)
hbox.Add((5,0), 1)
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -268,14 +248,9 @@ class wfm_rx_block (stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
-
+
+ r = self.u.set_center_freq(target_freq)
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -289,7 +264,7 @@ class wfm_rx_block (stdgui2.std_top_block):
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def update_status_bar (self):
msg = "Volume:%r Setting:%s" % (self.vol, self.state)
diff --git a/gr-uhd/examples/usrp_wfm_rcv2_nogui.py b/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
new file mode 100755
index 000000000..013a6864f
--- /dev/null
+++ b/gr-uhd/examples/usrp_wfm_rcv2_nogui.py
@@ -0,0 +1,151 @@
+#!/usr/bin/env python
+#
+# Copyright 2005-2007,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, optfir, audio, blks2, uhd
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+from usrpm import usrp_dbid
+import sys
+import math
+
+class wfm_rx_block (gr.top_block):
+
+ def __init__(self):
+ gr.top_block.__init__(self)
+
+ parser=OptionParser(option_class=eng_option)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("", "--f1", type="eng_float", default=100.7e6,
+ help="set 1st station frequency to FREQ", metavar="FREQ")
+ parser.add_option("", "--f2", type="eng_float", default=102.5e6,
+ help="set 2nd station freq to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=40,
+ help="set gain in dB (default is midpoint)")
+ parser.add_option("-O", "--audio-output", type="string", default="",
+ help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
+ parser.add_option("", "--freq-min", type="eng_float", default=87.9e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=108.1e6,
+ help="Set a maximum frequency [default=%default]")
+
+ (options, args) = parser.parse_args()
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ if abs(options.f1 - options.f2) > 5.5e6:
+ print "Sorry, two stations must be within 5.5MHz of each other"
+ raise SystemExit
+
+ f = (options.f1, options.f2)
+
+ self.vol = .1
+ self.state = "FREQ"
+
+ self.fm_freq_min = options.freq_min
+ self.fm_freq_max = options.freq_max
+
+ # build graph
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=2)
+
+ # Set front end channel mapping
+ self.u.set_subdev_spec("A:0 A:0")
+
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 32e3
+ audio_decim = int(demod_rate / audio_rate)
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
+
+ # Make sure dboard can suppor the required frequencies
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+
+ # sound card as final sink
+ self.audio_sink = audio.sink(int(audio_rate), options.audio_output)
+
+ # taps for channel filter
+ nfilts = 32
+ chan_coeffs = optfir.low_pass (nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+
+ # set front end PLL to middle frequency
+ mid_freq = (f[0] + f[1]) / 2.0
+
+ if options.gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
+
+ for n in range(2):
+ chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ guts = blks2.wfm_rcv (demod_rate, audio_decim)
+ volume_control = gr.multiply_const_ff(self.vol)
+
+ #self.connect((self.di, n), chan_filt)
+ self.connect((self.u, n), chan_filt)
+ self.connect(chan_filt, guts, volume_control)
+ self.connect(volume_control, (self.audio_sink, n))
+
+ # Test the the requested frequencies are in range
+ if(f[n] < self.fm_freq_min or f[n] > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
+
+ # Tune each channel by setting the RF freq to mid_freq and the
+ # DDC freq to f[n].
+ tr = uhd.tune_request(f[n], rf_freq=mid_freq,
+ rf_freq_policy=uhd.tune_request.POLICY_MANUAL)
+ self.u.set_center_freq(tr, n)
+
+ # Set gain for each channel
+ self.set_gain(options.gain, n)
+
+ def set_vol (self, vol):
+ self.vol = vol
+ self.volume_control.set_k(self.vol)
+
+
+ def set_gain(self, gain, n):
+ self.u.set_gain(gain, n)
+
+if __name__ == '__main__':
+ tb = wfm_rx_block()
+ try:
+ tb.run()
+ except KeyboardInterrupt:
+ pass
diff --git a/gnuradio-examples/python/usrp/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
index 30744ee01..53ad6edbf 100755
--- a/gnuradio-examples/python/usrp/usrp_wfm_rcv_fmdet.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_fmdet.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,41 +20,28 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
+from gnuradio import gr, optfir, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
-import math
import wx
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
+import os
+print os.getpid()
+raw_input()
class wfm_rx_block (stdgui2.std_top_block):
def __init__(self,frame,panel,vbox,argv):
stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=65,
@@ -65,6 +52,10 @@ class wfm_rx_block (stdgui2.std_top_block):
help="set volume (default is midpoint)")
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
+ parser.add_option("", "--freq-min", type="eng_float", default=87.9e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=108.1e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args()
@@ -79,55 +70,52 @@ class wfm_rx_block (stdgui2.std_top_block):
self.state = "FREQ"
self.freq = 0
- # build graph
-
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = 3*demod_rate / audio_decimation/2 # 48 kHz
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
+ self.fm_freq_min = options.freq_min
+ self.fm_freq_max = options.freq_max
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
+ # build graph
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 48e3
+ audio_decim = 10
- chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
- usrp_rate, # sampling rate
- 90e3, # passband cutoff
- 30e3, # transition bandwidth
- 70, # stopband attenuation
- gr.firdes.WIN_BLACKMAN)
- print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
- self.rchan_sample = blks2.rational_resampler_fff(3,2)
- self.lchan_sample = blks2.rational_resampler_fff(3,2)
+ nfilts = 32
+ chan_coeffs = gr.firdes.low_pass_2(10*nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 90e3, # passband cutoff
+ 30e3, # transition bw
+ 70) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+ self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+ self.guts = blks2.wfm_rcv_fmdet (demod_rate, audio_decim)
- #self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
- self.guts = blks2.wfm_rcv_fmdet (demod_rate, audio_decimation)
+ chan_rate = audio_rate / (demod_rate/audio_decim)
+ self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
+ self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
# FIXME rework {add,multiply}_const_* to handle multiple streams
self.volume_control_l = gr.multiply_const_ff(self.vol)
self.volume_control_r = gr.multiply_const_ff(self.vol)
# sound card as final sink
- audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink (int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, chan_filt, self.guts)
- self.connect((self.guts, 0), self.lchan_sample,self.volume_control_l,(audio_sink,0))
- self.connect((self.guts, 1), self.rchan_sample,self.volume_control_r,(audio_sink,1))
+ self.connect (self.u, self.chan_filt, self.guts)
+ self.connect((self.guts, 0), self.lchan_filt,
+ self.volume_control_l, (self.audio_sink,0))
+ self.connect((self.guts, 1), self.rchan_filt,
+ self.volume_control_r, (self.audio_sink,1))
try:
self.guts.stereo_carrier_pll_recovery.squelch_enable(True)
@@ -139,8 +127,8 @@ class wfm_rx_block (stdgui2.std_top_block):
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
if options.volume is None:
g = self.volume_range()
@@ -149,8 +137,15 @@ class wfm_rx_block (stdgui2.std_top_block):
if abs(options.freq) < 1e6:
options.freq *= 1e6
- # set initial values
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
+ # set initial values
self.set_gain(options.gain)
self.set_vol(options.volume)
try:
@@ -232,7 +227,7 @@ class wfm_rx_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq_slider'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(87.9e6, 108.1e6, 0.1e6),
+ range=(self.fm_freq_min, self.fm_freq_max, 0.1e6),
callback=self.set_freq)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -246,9 +241,10 @@ class wfm_rx_block (stdgui2.std_top_block):
callback=self.set_vol)
hbox.Add((5,0), 1)
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
@@ -311,20 +307,17 @@ class wfm_rx_block (stdgui2.std_top_block):
except:
print "FYI: This implementation of the stereo_carrier_pll_recovery has no squelch implementation yet"
+
def set_freq(self, target_freq):
"""
Set the center frequency we're interested in.
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
+
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -335,10 +328,10 @@ class wfm_rx_block (stdgui2.std_top_block):
self._set_status_msg("Failed", 0)
return False
-
+
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def update_status_bar (self):
msg = "Volume:%r Setting:%s" % (self.vol, self.state)
diff --git a/gr-uhd/examples/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
new file mode 100755
index 000000000..ffeda4493
--- /dev/null
+++ b/gr-uhd/examples/usrp_wfm_rcv_nogui.py
@@ -0,0 +1,168 @@
+#!/usr/bin/env python
+#
+# Copyright 2005-2007,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, optfir, audio, blks2, uhd
+from gnuradio import eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+import sys
+
+class wfm_rx_block (gr.top_block):
+
+ def __init__(self):
+ gr.top_block.__init__(self)
+
+ parser=OptionParser(option_class=eng_option)
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
+ parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
+ help="set frequency to FREQ", metavar="FREQ")
+ parser.add_option("-g", "--gain", type="eng_float", default=None,
+ help="set gain in dB (default is midpoint)")
+ parser.add_option("-V", "--volume", type="eng_float", default=None,
+ help="set volume (default is midpoint)")
+ parser.add_option("-O", "--audio-output", type="string", default="",
+ help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
+ parser.add_option("", "--freq-min", type="eng_float", default=87.9e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=108.1e6,
+ help="Set a maximum frequency [default=%default]")
+
+ (options, args) = parser.parse_args()
+ if len(args) != 0:
+ parser.print_help()
+ sys.exit(1)
+
+ self.state = "FREQ"
+ self.freq = 0
+
+ self.fm_freq_min = options.freq_min
+ self.fm_freq_max = options.freq_max
+
+ # build graph
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 32e3
+ audio_decim = int(demod_rate / audio_rate)
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
+
+ nfilts = 32
+ chan_coeffs = optfir.low_pass (nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 80e3, # passband cutoff
+ 115e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+ self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
+
+ self.guts = blks2.wfm_rcv (demod_rate, audio_decim)
+
+ self.volume_control = gr.multiply_const_ff(1)
+
+ # sound card as final sink
+ self.audio_sink = audio.sink(int(audio_rate),
+ options.audio_output,
+ False) # ok_to_block
+
+ # now wire it all together
+ self.connect (self.u, self.chan_filt, self.guts,
+ self.volume_control, self.audio_sink)
+
+ if options.gain is None:
+ # if no gain was specified, use the mid-point in dB
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
+
+ if options.volume is None:
+ g = self.volume_range()
+ options.volume = float(g[0]+g[1])/2
+
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
+
+ # set initial values
+ self.set_gain(options.gain)
+ self.set_vol(options.volume)
+ if not(self.set_freq(options.freq)):
+ self._set_status_msg("Failed to set initial frequency")
+
+ def set_vol (self, vol):
+ g = self.volume_range()
+ self.vol = max(g[0], min(g[1], vol))
+ self.volume_control.set_k(10**(self.vol/10))
+ self.update_status_bar ()
+
+ def set_freq(self, target_freq):
+ """
+ Set the center frequency we're interested in.
+
+ @param target_freq: frequency in Hz
+ @rypte: bool
+ """
+
+ r = self.u.set_center_freq(target_freq)
+
+ if r:
+ self.freq = target_freq
+ self.update_status_bar()
+ self._set_status_msg("OK", 0)
+ return True
+
+ self._set_status_msg("Failed", 0)
+ return False
+
+ def set_gain(self, gain):
+ self.u.set_gain(gain)
+
+ def update_status_bar (self):
+ msg = "Freq: %s Volume:%f Setting:%s" % (
+ eng_notation.num_to_str(self.freq), self.vol, self.state)
+ self._set_status_msg(msg, 1)
+
+ def _set_status_msg(self, msg, which=0):
+ print msg
+
+ def volume_range(self):
+ return (-20.0, 0.0, 0.5)
+
+
+if __name__ == '__main__':
+ tb = wfm_rx_block()
+ try:
+ tb.run()
+ except KeyboardInterrupt:
+ pass
diff --git a/gnuradio-examples/python/usrp/usrp_wfm_rcv_pll.py b/gr-uhd/examples/usrp_wfm_rcv_pll.py
index 0d52ed7ee..2cb4e4068 100755
--- a/gnuradio-examples/python/usrp/usrp_wfm_rcv_pll.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_pll.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,41 +20,25 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
+from gnuradio import gr, optfir, audio, blks2, uhd
+from gnuradio import eng_notation
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form, scopesink2
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
-import math
import wx
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
class wfm_rx_block (stdgui2.std_top_block):
def __init__(self,frame,panel,vbox,argv):
stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=65,
@@ -65,7 +49,10 @@ class wfm_rx_block (stdgui2.std_top_block):
help="set volume (default is midpoint)")
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
-
+ parser.add_option("", "--freq-min", type="eng_float", default=87.9e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=108.1e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args()
if len(args) != 0:
@@ -79,55 +66,53 @@ class wfm_rx_block (stdgui2.std_top_block):
self.state = "FREQ"
self.freq = 0
+ self.fm_freq_min = options.freq_min
+ self.fm_freq_max = options.freq_max
+
# build graph
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 48e3
+ audio_decim = 10
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
+
+ nfilts = 32
+ chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 90e3, # passband cutoff
+ 30e3, # stopband cutoff
+ 70) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+ self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = 3*demod_rate / audio_decimation/2 # 48 kHz
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
-
-
- chan_filt_coeffs = gr.firdes.low_pass_2 (1, # gain
- usrp_rate, # sampling rate
- 90e3, # passband cutoff
- 30e3, # transition bandwidth
- 70, # stopband attenuation
- gr.firdes.WIN_BLACKMAN)
- print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
- self.rchan_sample = blks2.rational_resampler_fff(3,2)
- self.lchan_sample = blks2.rational_resampler_fff(3,2)
+ self.guts = blks2.wfm_rcv_pll (demod_rate, audio_decim)
-
- #self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
- self.guts = blks2.wfm_rcv_pll (demod_rate, audio_decimation)
+ chan_rate = audio_rate / (demod_rate/audio_decim)
+ self.rchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
+ self.lchan_filt = blks2.pfb_arb_resampler_fff(chan_rate)
# FIXME rework {add,multiply}_const_* to handle multiple streams
self.volume_control_l = gr.multiply_const_ff(self.vol)
self.volume_control_r = gr.multiply_const_ff(self.vol)
# sound card as final sink
- audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink (int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, chan_filt, self.guts)
- self.connect((self.guts, 0), self.lchan_sample,self.volume_control_l,(audio_sink,0))
- self.connect((self.guts, 1), self.rchan_sample,self.volume_control_r,(audio_sink,1))
+ self.connect (self.u, self.chan_filt, self.guts)
+ self.connect((self.guts, 0), self.lchan_filt,
+ self.volume_control_l, (self.audio_sink,0))
+ self.connect((self.guts, 1), self.rchan_filt,
+ self.volume_control_r, (self.audio_sink,1))
try:
self.guts.stereo_carrier_pll_recovery.squelch_enable(True)
@@ -139,18 +124,22 @@ class wfm_rx_block (stdgui2.std_top_block):
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
if options.volume is None:
g = self.volume_range()
options.volume = float(g[0]+g[1])/2
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
# set initial values
-
self.set_gain(options.gain)
self.set_vol(options.volume)
try:
@@ -232,7 +221,7 @@ class wfm_rx_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq_slider'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(87.9e6, 108.1e6, 0.1e6),
+ range=(self.fm_freq_min, self.fm_freq_max, 0.1e6),
callback=self.set_freq)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -246,9 +235,10 @@ class wfm_rx_block (stdgui2.std_top_block):
callback=self.set_vol)
hbox.Add((5,0), 1)
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
@@ -317,14 +307,10 @@ class wfm_rx_block (stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
+ r = self.u.set_center_freq(target_freq)
+
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -335,10 +321,10 @@ class wfm_rx_block (stdgui2.std_top_block):
self._set_status_msg("Failed", 0)
return False
-
+
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def update_status_bar (self):
msg = "Volume:%r Setting:%s" % (self.vol, self.state)
diff --git a/gnuradio-examples/python/usrp/usrp_wfm_rcv_sca.py b/gr-uhd/examples/usrp_wfm_rcv_sca.py
index 39547b3ae..1c6154871 100755
--- a/gnuradio-examples/python/usrp/usrp_wfm_rcv_sca.py
+++ b/gr-uhd/examples/usrp_wfm_rcv_sca.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006,2007 Free Software Foundation, Inc.
+# Copyright 2006,2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -50,42 +50,25 @@ OFDM.
"""
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio.blks2impl.fm_emph import fm_deemph
+from gnuradio import gr, optfir, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
import math
import wx
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
-
class wfm_rx_sca_block (stdgui2.std_top_block):
def __init__(self,frame,panel,vbox,argv):
stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option("-f", "--freq", type="eng_float", default=100.1e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=40,
@@ -94,6 +77,10 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
help="set volume (default is midpoint)")
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
+ parser.add_option("", "--freq-min", type="eng_float", default=87.9e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=108.1e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args()
if len(args) != 0:
@@ -107,58 +94,57 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
self.state = "FREQ"
self.freq = 0
+ self.fm_freq_min = options.freq_min
+ self.fm_freq_max = options.freq_max
+
# build graph
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 1
- demod_rate = usrp_rate / chanfilt_decim
- sca_chanfilt_decim = 5
- sca_demod_rate = demod_rate / sca_chanfilt_decim #64 kHz
- audio_decimation = 2
- audio_rate = sca_demod_rate / audio_decimation # 32 kHz
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-
- #Create filter to get main FM Channel we want
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 100e3, # passband cutoff
- 140e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
+
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 32e3
+ sca_demod_rate = 64e3
+ audio_decim = int(demod_rate / audio_rate)
+ sca_chanfilt_decim = int(demod_rate / sca_demod_rate)
+
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
+
+ nfilts = 32
+ chan_coeffs = optfir.low_pass (nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 100e3, # passband cutoff
+ 140e3, # stopband cutoff
+ 0.1, # passband ripple
+ 60) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+ self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
#Create demodulator block for Main FM Channel
max_dev = 75e3
fm_demod_gain = demod_rate/(2*math.pi*max_dev)
self.fm_demod = gr.quadrature_demod_cf (fm_demod_gain)
- # Note - deemphasis is not applied to the Main FM Channel as main audio is not decoded
+ # Note - deemphasis is not applied to the Main FM Channel as
+ # main audio is not decoded
- # SCA Devation is 10% of carrier but some references say 20% if mono with one SCA (6 KHz seems typical)
+ # SCA Devation is 10% of carrier but some references say 20%
+ # if mono with one SCA (6 KHz seems typical)
max_sca_dev = 6e3
# Create filter to get SCA channel we want
sca_chan_coeffs = gr.firdes.low_pass (1.0, # gain
- demod_rate, # sampling rate
- max_sca_dev, # low pass cutoff freq
- max_sca_dev/3, # width of trans. band
- gr.firdes.WIN_HANN) # filter type
+ demod_rate, # sampling rate
+ max_sca_dev, # cutoff freq
+ max_sca_dev/3, # trans. band
+ gr.firdes.WIN_HANN) # filter type
- self.ddc = gr.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decimation rate
+ self.ddc = gr.freq_xlating_fir_filter_fcf(sca_chanfilt_decim, # decim rate
sca_chan_coeffs, # taps
- 0, # frequency translation amount (Gets set by the UI)
+ 0, # freq translation amount (Gets set by the UI)
demod_rate) # input sample rate
#Create demodulator block for SCA Channel
@@ -168,46 +154,55 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
# SCA analog audio is bandwidth limited to 5 KHz
max_sca_audio_freq = 5.0e3
+
# SCA analog deephasis is 150 uS (75 uS may be used)
sca_tau = 150e-6
# compute FIR filter taps for SCA audio filter
- audio_coeffs = gr.firdes.low_pass (1.0, # gain
- sca_demod_rate, # sampling rate
- max_sca_audio_freq, # low pass cutoff freq
- max_sca_audio_freq/2.5, # width of trans. band
+ audio_coeffs = gr.firdes.low_pass (1.0, # gain
+ sca_demod_rate, # sampling rate
+ max_sca_audio_freq, # cutoff freq
+ max_sca_audio_freq/2.5, # trans. band
gr.firdes.WIN_HAMMING)
# input: float; output: float
- self.audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs)
+ self.audio_filter = gr.fir_filter_fff (audio_decim, audio_coeffs)
# Create deemphasis block that is applied after SCA demodulation
- self.deemph = fm_deemph (audio_rate, sca_tau)
+ self.deemph = blks2.fm_deemph (audio_rate, sca_tau)
self.volume_control = gr.multiply_const_ff(self.vol)
# sound card as final sink
- audio_sink = audio.sink (int (audio_rate),
- options.audio_output,
- False) # ok_to_block
+ self.audio_sink = audio.sink (int (audio_rate),
+ options.audio_output,
+ False) # ok_to_block
# now wire it all together
- self.connect (self.u, chan_filt, self.fm_demod, self.ddc, self.fm_demod_sca)
- self.connect (self.fm_demod_sca, self.audio_filter, self.deemph, self.volume_control, audio_sink)
+ self.connect (self.u, self.chan_filt, self.fm_demod,
+ self.ddc, self.fm_demod_sca)
+ self.connect (self.fm_demod_sca, self.audio_filter,
+ self.deemph, self.volume_control,
+ self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, sca_demod_rate, audio_rate)
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2
if options.volume is None:
g = self.volume_range()
options.volume = float(g[0]+g[1])/2
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.fm_freq_max or frange.stop() < self.fm_freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.fm_freq_min or options.freq > self.fm_freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
# set initial values
@@ -271,7 +266,7 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq_slider'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(87.9e6, 108.1e6, 0.1e6),
+ range=(self.fm_freq_min, self.fm_freq_max, 0.1e6),
callback=self.set_freq)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -299,9 +294,10 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
callback=self.set_vol)
hbox.Add((5,0), 1)
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.stop(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -363,8 +359,7 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
the result of that operation and our target_frequency to
determine the value for the digital down converter.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
-
+ r = self.u.set_center_freq(target_freq)
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -372,7 +367,6 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
self.update_status_bar()
self._set_status_msg("OK", 0)
return True
-
self._set_status_msg("Failed", 0)
return False
@@ -387,7 +381,7 @@ class wfm_rx_sca_block (stdgui2.std_top_block):
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def update_status_bar (self):
msg = "Volume:%r Setting:%s" % (self.vol, self.state)
diff --git a/gnuradio-examples/python/usrp/usrp_wxapt_rcv.py b/gr-uhd/examples/usrp_wxapt_rcv.py
index b356702a6..5b44398d1 100755
--- a/gnuradio-examples/python/usrp/usrp_wxapt_rcv.py
+++ b/gr-uhd/examples/usrp_wxapt_rcv.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,42 +20,25 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gru, eng_notation, optfir
-from gnuradio import audio
-from gnuradio import usrp
-from gnuradio import blks2
+from gnuradio import gr, audio, blks2, uhd
from gnuradio.eng_option import eng_option
from gnuradio.wxgui import slider, powermate
from gnuradio.wxgui import stdgui2, fftsink2, form
from optparse import OptionParser
-from usrpm import usrp_dbid
import sys
-import math
import wx
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- Try for one of these, in order: TV_RX, BASIC_RX, whatever is on side A.
-
- @return a subdev_spec
- """
- return usrp.pick_subdev(u, (usrp_dbid.TV_RX,
- usrp_dbid.TV_RX_REV_2,
- usrp_dbid.TV_RX_REV_3,
- usrp_dbid.TV_RX_MIMO,
- usrp_dbid.TV_RX_REV_2_MIMO,
- usrp_dbid.TV_RX_REV_3_MIMO,
- usrp_dbid.BASIC_RX))
-
class wxapt_rx_block (stdgui2.std_top_block):
def __init__(self,frame,panel,vbox,argv):
stdgui2.std_top_block.__init__ (self,frame,panel,vbox,argv)
parser=OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=A)")
+ parser.add_option("-a", "--address", type="string",
+ default="addr=192.168.10.2",
+ help="Address of UHD device, [default=%default]")
+ parser.add_option("-A", "--antenna", type="string", default=None,
+ help="select Rx Antenna where appropriate")
parser.add_option("-f", "--freq", type="eng_float", default=137.5e6,
help="set frequency to FREQ", metavar="FREQ")
parser.add_option("-g", "--gain", type="eng_float", default=None,
@@ -64,6 +47,10 @@ class wxapt_rx_block (stdgui2.std_top_block):
help="set volume (default is midpoint)")
parser.add_option("-O", "--audio-output", type="string", default="",
help="pcm device name. E.g., hw:0,0 or surround51 or /dev/dsp")
+ parser.add_option("", "--freq-min", type="eng_float", default=137e6,
+ help="Set a minimum frequency [default=%default]")
+ parser.add_option("", "--freq-max", type="eng_float", default=138e6,
+ help="Set a maximum frequency [default=%default]")
(options, args) = parser.parse_args()
if len(args) != 0:
@@ -77,62 +64,62 @@ class wxapt_rx_block (stdgui2.std_top_block):
self.state = "FREQ"
self.freq = 0
- # build graph
-
- self.u = usrp.source_c() # usrp is data source
-
- adc_rate = self.u.adc_rate() # 64 MS/s
- usrp_decim = 200
- self.u.set_decim_rate(usrp_decim)
- usrp_rate = adc_rate / usrp_decim # 320 kS/s
- chanfilt_decim = 4
- demod_rate = usrp_rate / chanfilt_decim
- audio_decimation = 10
- audio_rate = demod_rate / audio_decimation # 32 kHz
+ self.freq_min = options.freq_min
+ self.freq_max = options.freq_max
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
+ # build graph
+ self.u = uhd.usrp_source(device_addr=options.address,
+ io_type=uhd.io_type.COMPLEX_FLOAT32,
+ num_channels=1)
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- print "Using RX d'board %s" % (self.subdev.side_and_name(),)
+ usrp_rate = 320e3
+ demod_rate = 320e3
+ audio_rate = 32e3
+ audio_decim = int(demod_rate / audio_rate)
+ self.u.set_samp_rate(usrp_rate)
+ dev_rate = self.u.get_samp_rate()
- chan_filt_coeffs = optfir.low_pass (1, # gain
- usrp_rate, # sampling rate
- 40e3, # passband cutoff
- 60e3, # stopband cutoff
- 0.1, # passband ripple
- 60) # stopband attenuation
- #print len(chan_filt_coeffs)
- chan_filt = gr.fir_filter_ccf (chanfilt_decim, chan_filt_coeffs)
+ nfilts = 32
+ chan_coeffs = gr.firdes.low_pass_2 (nfilts, # gain
+ nfilts*usrp_rate, # sampling rate
+ 40e3, # passband cutoff
+ 20e3, # transition bw
+ 60) # stopband attenuation
+ rrate = usrp_rate / dev_rate
+ self.chan_filt = blks2.pfb_arb_resampler_ccf(rrate, chan_coeffs, nfilts)
- self.guts = blks2.wfm_rcv (demod_rate, audio_decimation)
+ self.guts = blks2.wfm_rcv (demod_rate, audio_decim)
self.volume_control = gr.multiply_const_ff(self.vol)
# sound card as final sink
- audio_sink = audio.sink (int (audio_rate), options.audio_output)
+ self.audio_sink = audio.sink (int (audio_rate), options.audio_output)
# now wire it all together
- self.connect (self.u, chan_filt, self.guts, self.volume_control, audio_sink)
+ self.connect (self.u, self.chan_filt, self.guts,
+ self.volume_control, self.audio_sink)
self._build_gui(vbox, usrp_rate, demod_rate, audio_rate)
if options.gain is None:
# if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
+ g = self.u.get_gain_range()
+ options.gain = float(g.start()+g.stop())/2.0
if options.volume is None:
g = self.volume_range()
options.volume = float(g[0]+g[1])/2
-
- if abs(options.freq) < 1e6:
- options.freq *= 1e6
- # set initial values
+ frange = self.u.get_freq_range()
+ if(frange.start() > self.freq_max or frange.stop() < self.freq_min):
+ sys.stderr.write("Radio does not support required frequency range.\n")
+ sys.exit(1)
+ if(options.freq < self.freq_min or options.freq > self.freq_max):
+ sys.stderr.write("Requested frequency is outside of required frequency range.\n")
+ sys.exit(1)
+ # set initial values
self.set_gain(options.gain)
self.set_vol(options.volume)
if not(self.set_freq(options.freq)):
@@ -183,7 +170,7 @@ class wxapt_rx_block (stdgui2.std_top_block):
hbox.Add((5,0), 0)
myform['freq_slider'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, weight=3,
- range=(137.0e6, 138.0e6, 0.0005e6),
+ range=(self.freq_min, self.freq_max, 0.0005e6),
callback=self.set_freq)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -197,9 +184,10 @@ class wxapt_rx_block (stdgui2.std_top_block):
callback=self.set_vol)
hbox.Add((5,0), 1)
+ g = self.u.get_gain_range()
myform['gain'] = \
form.quantized_slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3, range=self.subdev.gain_range(),
+ weight=3, range=(g.start(), g.start(), g.step()),
callback=self.set_gain)
hbox.Add((5,0), 0)
vbox.Add(hbox, 0, wx.EXPAND)
@@ -255,14 +243,10 @@ class wxapt_rx_block (stdgui2.std_top_block):
@param target_freq: frequency in Hz
@rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
"""
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
-
+
+ r = self.u.set_center_freq(target_freq)
+
if r:
self.freq = target_freq
self.myform['freq'].set_value(target_freq) # update displayed value
@@ -276,7 +260,7 @@ class wxapt_rx_block (stdgui2.std_top_block):
def set_gain(self, gain):
self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
+ self.u.set_gain(gain)
def update_status_bar (self):
msg = "Volume:%r Setting:%s" % (self.vol, self.state)
diff --git a/gr-uhd/include/gr_uhd_amsg_source.h b/gr-uhd/include/gr_uhd_amsg_source.h
index bc0feb438..accf15ce2 100644
--- a/gr-uhd/include/gr_uhd_amsg_source.h
+++ b/gr-uhd/include/gr_uhd_amsg_source.h
@@ -28,6 +28,10 @@
class uhd_amsg_source;
+/*!
+ * \brief Make a new USRP asynchronous message-based source block.
+ * \ingroup uhd_blk
+ */
GR_UHD_API boost::shared_ptr<uhd_amsg_source> uhd_make_amsg_source(
const uhd::device_addr_t &device_addr,
gr_msg_queue_sptr msgq
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h
index c1fc3b09e..f11d00063 100644
--- a/gr-uhd/include/gr_uhd_usrp_sink.h
+++ b/gr-uhd/include/gr_uhd_usrp_sink.h
@@ -30,6 +30,7 @@ class uhd_usrp_sink;
/*!
* \brief Make a new USRP sink block.
+ * \ingroup uhd_blk
*
* The USRP sink block reads a stream and transmits the samples.
* The sink block also provides API calls for transmitter settings.
diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h
index f8ac9361e..fecc6e94d 100644
--- a/gr-uhd/include/gr_uhd_usrp_source.h
+++ b/gr-uhd/include/gr_uhd_usrp_source.h
@@ -30,6 +30,7 @@ class uhd_usrp_source;
/*!
* \brief Make a new USRP source block.
+ * \ingroup uhd_blk
*
* The USRP source block receives samples and writes to a stream.
* The source block also provides API calls for receiver settings.
diff --git a/gr-uhd/swig/Makefile.swig.gen b/gr-uhd/swig/Makefile.swig.gen
index b73ccd3c4..62adf8958 100644
--- a/gr-uhd/swig/Makefile.swig.gen
+++ b/gr-uhd/swig/Makefile.swig.gen
@@ -105,7 +105,7 @@ _uhd_swig_la_CXXFLAGS = \
$(uhd_swig_la_swig_cxxflags)
python/uhd_swig.cc: uhd_swig.py
-uhd_swig.py: uhd_swig.i
+uhd_swig.py: uhd_swig.i
# Include the python dependencies for this file
-include python/uhd_swig.d
diff --git a/gr-uhd/swig/__init__.py b/gr-uhd/swig/__init__.py
index 1f82b4a26..c63d3cc57 100644
--- a/gr-uhd/swig/__init__.py
+++ b/gr-uhd/swig/__init__.py
@@ -19,6 +19,12 @@
# Boston, MA 02110-1301, USA.
#
+'''
+This is the GNU Radio UHD package. It is the interface to the UHD
+library to connect to and send and receive data between the Ettus
+Research, LLC product line.
+'''
+
########################################################################
# Prepare uhd swig module to make it more pythonic
########################################################################
diff --git a/gr-usrp/src/Makefile.swig.gen b/gr-usrp/src/Makefile.swig.gen
index c122d6dd9..00ecfcb54 100644
--- a/gr-usrp/src/Makefile.swig.gen
+++ b/gr-usrp/src/Makefile.swig.gen
@@ -105,7 +105,7 @@ _usrp_swig_la_CXXFLAGS = \
$(usrp_swig_la_swig_cxxflags)
python/usrp_swig.cc: usrp_swig.py
-usrp_swig.py: usrp_swig.i
+usrp_swig.py: usrp_swig.i
# Include the python dependencies for this file
-include python/usrp_swig.d
diff --git a/gr-usrp2/src/Makefile.swig.gen b/gr-usrp2/src/Makefile.swig.gen
index d791ae2fa..78cb4e5c6 100644
--- a/gr-usrp2/src/Makefile.swig.gen
+++ b/gr-usrp2/src/Makefile.swig.gen
@@ -105,7 +105,7 @@ _usrp2_swig_la_CXXFLAGS = \
$(usrp2_swig_la_swig_cxxflags)
python/usrp2_swig.cc: usrp2_swig.py
-usrp2_swig.py: usrp2_swig.i
+usrp2_swig.py: usrp2_swig.i
# Include the python dependencies for this file
-include python/usrp2_swig.d
diff --git a/gr-utils/src/python/Makefile.am b/gr-utils/src/python/Makefile.am
index b422bfd05..11fb038f6 100644
--- a/gr-utils/src/python/Makefile.am
+++ b/gr-utils/src/python/Makefile.am
@@ -49,10 +49,4 @@ bin_SCRIPTS = \
gr_plot_iq.py \
gr_plot_short.py \
gr_plot_qt.py \
- gr_filter_design.py \
- usrp_fft.py \
- usrp_oscope.py \
- usrp_rx_nogui.py \
- usrp_siggen.py \
- usrp_siggen_gui.py \
- usrp2_fft.py
+ gr_filter_design.py
diff --git a/gr-utils/src/python/gr_plot_const.py b/gr-utils/src/python/gr_plot_const.py
index 5dd08c9a0..8873e5b7e 100755
--- a/gr-utils/src/python/gr_plot_const.py
+++ b/gr-utils/src/python/gr_plot_const.py
@@ -85,16 +85,23 @@ class draw_constellation:
except MemoryError:
print "End of File"
else:
- self.reals = scipy.array([r.real for r in iq])
- self.imags = scipy.array([i.imag for i in iq])
+ # retesting length here as newer version of scipy does not throw a MemoryError, just
+ # returns a zero-length array
+ if(len(iq) > 0):
+ self.reals = scipy.array([r.real for r in iq])
+ self.imags = scipy.array([i.imag for i in iq])
+
+ self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
+ return True
+ else:
+ print "End of File"
+ return False
- self.time = scipy.array([i*(1/self.sample_rate) for i in range(len(self.reals))])
-
def make_plots(self):
# if specified on the command-line, set file pointer
self.hfile.seek(self.sizeof_data*self.start, 1)
- self.get_data()
+ r = self.get_data()
# Subplot for real and imaginary parts of signal
self.sp_iq = self.fig.add_subplot(2,1,1, position=[0.075, 0.2, 0.4, 0.6])
@@ -175,8 +182,9 @@ class draw_constellation:
self.step_forward()
def step_forward(self):
- self.get_data()
- self.update_plots()
+ r = self.get_data()
+ if(r):
+ self.update_plots()
def step_backward(self):
# Step back in file position
@@ -184,8 +192,9 @@ class draw_constellation:
self.hfile.seek(-2*self.sizeof_data*self.block_length, 1)
else:
self.hfile.seek(-self.hfile.tell(),1)
- self.get_data()
- self.update_plots()
+ r = self.get_data()
+ if(r):
+ self.update_plots()
def mouse_button_callback(self, event):
diff --git a/gr-utils/src/python/usrp2_fft.py b/gr-utils/src/python/usrp2_fft.py
deleted file mode 100755
index 4276e389a..000000000
--- a/gr-utils/src/python/usrp2_fft.py
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005,2007,2008,2010 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, gru
-from gnuradio import usrp2
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
-from optparse import OptionParser
-import wx
-import sys
-import numpy
-
-class app_top_block(stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-e", "--interface", type="string", default="eth0",
- help="select Ethernet interface, default is eth0")
- parser.add_option("-m", "--mac-addr", type="string", default="",
- help="select USRP by MAC address, default is auto-select")
- #parser.add_option("-A", "--antenna", default=None,
- # help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-W", "--waterfall", action="store_true", default=False,
- help="Enable waterfall display")
- parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
- help="Enable oscilloscope display")
- parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
- help="Set fftsink averaging factor, default=[%default]")
- parser.add_option("", "--ref-scale", type="eng_float", default=1.0,
- help="Set dBFS=0dB input value, default=[%default]")
- parser.add_option("--fft-size", type="int", default=1024,
- help="Set number of FFT bins [default=%default]")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
- self.show_debug_info = True
-
- self.u = usrp2.source_32fc(options.interface, options.mac_addr)
- self.u.set_decim(options.decim)
-
- input_rate = self.u.adc_rate() / self.u.decim()
-
- if options.waterfall:
- self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=1024, sample_rate=input_rate)
- elif options.oscilloscope:
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
- else:
- self.scope = fftsink2.fft_sink_c (panel,
- fft_size=options.fft_size,
- sample_rate=input_rate,
- ref_scale=options.ref_scale,
- ref_level=20.0,
- y_divs = 12,
- avg_alpha=options.avg_alpha)
-
- self.connect(self.u, self.scope)
-
- self._build_gui(vbox)
- self._setup_events()
-
- # set initial values
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.u.gain_range()
- options.gain = float(g[0]+g[1])/2
-
- if options.freq is None:
- # if no freq was specified, use the mid-point
- r = self.u.freq_range()
- options.freq = float(r[0]+r[1])/2
-
- self.set_gain(options.gain)
-
- #if options.antenna is not None:
- # print "Selecting antenna %s" % (options.antenna,)
- # self.subdev.select_rx_antenna(options.antenna)
-
- if self.show_debug_info:
- self.myform['decim'].set_value(self.u.decim())
- self.myform['fs@gbe'].set_value(input_rate)
- self.myform['dbname'].set_value("0x%04X" % (self.u.daughterboard_id(),)) # FIXME: add text name
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- vbox.Add(self.scope.win, 10, wx.EXPAND)
-
- # add control area at the bottom
- self.myform = myform = form.form()
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0, 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0, 0)
- g = self.u.gain_range()
-
- # some configurations don't have gain control
- if g[1] > g[0]:
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3,
- min=int(g[0]), max=int(g[1]),
- callback=self.set_gain)
-
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- self._build_subpanel(vbox)
-
- def _build_subpanel(self, vbox_arg):
- # build a secondary information panel (sometimes hidden)
-
- # FIXME figure out how to have this be a subpanel that is always
- # created, but has its visibility controlled by foo.Show(True/False)
-
- def _form_set_decim(kv):
- return self.set_decim(kv['decim'])
-
- if not(self.show_debug_info):
- return
-
- panel = self.panel
- vbox = vbox_arg
- myform = self.myform
-
- #panel = wx.Panel(self.panel, -1)
- #vbox = wx.BoxSizer(wx.VERTICAL)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['decim'] = form.int_field(
- parent=panel, sizer=hbox, label="Decim",
- callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
-
- hbox.Add((5,0), 1)
- myform['fs@gbe'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@GbE")
-
- hbox.Add((5,0), 1)
- myform['dbname'] = form.static_text_field(
- parent=panel, sizer=hbox)
-
- hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
-
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.set_center_freq(target_freq)
-
- if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
- if self.show_debug_info:
- self.myform['baseband'].set_value(r.baseband_freq)
- self.myform['ddc'].set_value(r.dxc_freq)
- if not self.options.oscilloscope:
- self.scope.set_baseband_freq(target_freq)
- return True
-
- return False
-
- def set_gain(self, gain):
- if self.myform.has_key('gain'):
- self.myform['gain'].set_value(gain) # update displayed value
- self.u.set_gain(gain)
-
- def set_decim(self, decim):
- ok = self.u.set_decim(decim)
- if not ok:
- print "set_decim failed"
- input_rate = self.u.adc_rate() / self.u.decim()
- self.scope.set_sample_rate(input_rate)
- if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(self.u.decim())
- self.myform['fs@gbe'].set_value(input_rate)
- return ok
-
- def _setup_events(self):
- if not self.options.waterfall and not self.options.oscilloscope:
- self.scope.win.Bind(wx.EVT_LEFT_DCLICK, self.evt_left_dclick)
-
- def evt_left_dclick(self, event):
- (ux, uy) = self.scope.win.GetXY(event)
- if event.CmdDown():
- # Re-center on maximum power
- points = self.scope.win._points
- if self.scope.win.peak_hold:
- if self.scope.win.peak_vals is not None:
- ind = numpy.argmax(self.scope.win.peak_vals)
- else:
- ind = int(points.shape()[0]/2)
- else:
- ind = numpy.argmax(points[:,1])
- (freq, pwr) = points[ind]
- target_freq = freq/self.scope.win._scale_factor
- print ind, freq, pwr
- self.set_freq(target_freq)
- else:
- # Re-center on clicked frequency
- target_freq = ux/self.scope.win._scale_factor
- self.set_freq(target_freq)
-
-
-def main ():
- app = stdgui2.stdapp(app_top_block, "USRP2 FFT", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-utils/src/python/usrp_fft.py b/gr-utils/src/python/usrp_fft.py
deleted file mode 100755
index eda9bd57c..000000000
--- a/gr-utils/src/python/usrp_fft.py
+++ /dev/null
@@ -1,309 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005,2007,2008,2010 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, gru
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, fftsink2, waterfallsink2, scopesink2, form, slider
-from optparse import OptionParser
-import wx
-import sys
-import numpy
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db(0, 0).dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- if u.db(1, 0).dbid() >= 0:
- return (1, 0)
- return (0, 0)
-
-
-class app_top_block(stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-w", "--which", type="int", default=0,
- help="select which USRP (0, 1, ...) default is %default",
- metavar="NUM")
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-A", "--antenna", default=None,
- help="select Rx Antenna (only on RFX-series boards)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB [default is midpoint]")
- parser.add_option("-W", "--waterfall", action="store_true", default=False,
- help="Enable waterfall display")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
- parser.add_option( "--no-hb", action="store_true", default=False,
- help="don't use halfband filter in usrp")
- parser.add_option("-S", "--oscilloscope", action="store_true", default=False,
- help="Enable oscilloscope display")
- parser.add_option("", "--avg-alpha", type="eng_float", default=1e-1,
- help="Set fftsink averaging factor, [default=%default]")
- parser.add_option("", "--ref-scale", type="eng_float", default=13490.0,
- help="Set dBFS=0dB input value, [default=%default]")
- parser.add_option("", "--fft-size", type="int", default=1024,
- help="Set FFT frame size, [default=%default]");
-
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
- self.options = options
- self.show_debug_info = True
-
- # build the graph
- if options.no_hb or (options.decim<8):
- #Min decimation of this firmware is 4.
- #contains 4 Rx paths without halfbands and 0 tx paths.
- self.fpga_filename="std_4rx_0tx.rbf"
- self.u = usrp.source_c(which=options.which, decim_rate=options.decim, fpga_filename=self.fpga_filename)
- else:
- #Min decimation of standard firmware is 8.
- #standard fpga firmware "std_2rxhb_2tx.rbf"
- #contains 2 Rx paths with halfband filters and 2 tx paths (the default)
- self.u = usrp.source_c(which=options.which, decim_rate=options.decim)
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
-
- if options.width_8:
- width = 8
- shift = 8
- format = self.u.make_format(width, shift)
- print "format =", hex(format)
- r = self.u.set_format(format)
- print "set_format =", r
-
- # determine the daughterboard subdevice we're using
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
-
- input_rate = self.u.adc_freq() / self.u.decim_rate()
-
- if options.waterfall:
- self.scope = \
- waterfallsink2.waterfall_sink_c (panel, fft_size=options.fft_size, sample_rate=input_rate)
- elif options.oscilloscope:
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate)
- else:
- self.scope = fftsink2.fft_sink_c (panel, fft_size=options.fft_size, sample_rate=input_rate,
- ref_scale=options.ref_scale, ref_level=0.0, y_divs = 10,
- avg_alpha=options.avg_alpha)
-
- self.connect(self.u, self.scope)
-
- self._build_gui(vbox)
- self._setup_events()
-
- # set initial values
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
-
- if options.freq is None:
- # if no freq was specified, use the mid-point
- r = self.subdev.freq_range()
- options.freq = float(r[0]+r[1])/2
-
- self.set_gain(options.gain)
-
- if options.antenna is not None:
- print "Selecting antenna %s" % (options.antenna,)
- self.subdev.select_rx_antenna(options.antenna)
-
- if self.show_debug_info:
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- self.myform['dbname'].set_value(self.subdev.name())
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
-
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- vbox.Add(self.scope.win, 10, wx.EXPAND)
-
- # add control area at the bottom
- self.myform = myform = form.form()
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0, 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
-
- hbox.Add((5,0), 0, 0)
- g = self.subdev.gain_range()
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3,
- min=int(g[0]), max=int(g[1]),
- callback=self.set_gain)
-
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- self._build_subpanel(vbox)
-
- def _build_subpanel(self, vbox_arg):
- # build a secondary information panel (sometimes hidden)
-
- # FIXME figure out how to have this be a subpanel that is always
- # created, but has its visibility controlled by foo.Show(True/False)
-
- def _form_set_decim(kv):
- return self.set_decim(kv['decim'])
-
- if not(self.show_debug_info):
- return
-
- panel = self.panel
- vbox = vbox_arg
- myform = self.myform
-
- #panel = wx.Panel(self.panel, -1)
- #vbox = wx.BoxSizer(wx.VERTICAL)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['decim'] = form.int_field(
- parent=panel, sizer=hbox, label="Decim",
- callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
-
- hbox.Add((5,0), 1)
- myform['fs@usb'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@USB")
-
- hbox.Add((5,0), 1)
- myform['dbname'] = form.static_text_field(
- parent=panel, sizer=hbox)
-
- hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
-
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = self.u.tune(0, self.subdev, target_freq)
-
- if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
- if self.show_debug_info:
- self.myform['baseband'].set_value(r.baseband_freq)
- self.myform['ddc'].set_value(r.dxc_freq)
- if not self.options.oscilloscope:
- self.scope.set_baseband_freq(target_freq)
- return True
-
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
-
- def set_decim(self, decim):
- ok = self.u.set_decim_rate(decim)
- if not ok:
- print "set_decim failed"
- input_rate = self.u.adc_freq() / self.u.decim_rate()
- self.scope.set_sample_rate(input_rate)
- if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- return ok
-
- def _setup_events(self):
- if not self.options.waterfall and not self.options.oscilloscope:
- self.scope.win.Bind(wx.EVT_LEFT_DCLICK, self.evt_left_dclick)
-
- def evt_left_dclick(self, event):
- (ux, uy) = self.scope.win.GetXY(event)
- if event.CmdDown():
- # Re-center on maximum power
- points = self.scope.win._points
- if self.scope.win.peak_hold:
- if self.scope.win.peak_vals is not None:
- ind = numpy.argmax(self.scope.win.peak_vals)
- else:
- ind = int(points.shape()[0]/2)
- else:
- ind = numpy.argmax(points[:,1])
- (freq, pwr) = points[ind]
- target_freq = freq/self.scope.win._scale_factor
- print ind, freq, pwr
- self.set_freq(target_freq)
- else:
- # Re-center on clicked frequency
- target_freq = ux/self.scope.win._scale_factor
- self.set_freq(target_freq)
-
-
-def main ():
- app = stdgui2.stdapp(app_top_block, "USRP FFT", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-utils/src/python/usrp_oscope.py b/gr-utils/src/python/usrp_oscope.py
deleted file mode 100755
index 9921e9873..000000000
--- a/gr-utils/src/python/usrp_oscope.py
+++ /dev/null
@@ -1,349 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2004,2005,2006,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.
-#
-
-# print "Loading revised usrp_oscope with additional options for scopesink..."
-
-from gnuradio import gr, gru
-from gnuradio import usrp
-from gnuradio import eng_notation
-from gnuradio.eng_option import eng_option
-from gnuradio.wxgui import stdgui2, scopesink2, form, slider
-from optparse import OptionParser
-import wx
-import sys
-from usrpm import usrp_dbid
-
-
-def pick_subdevice(u):
- """
- The user didn't specify a subdevice on the command line.
- If there's a daughterboard on A, select A.
- If there's a daughterboard on B, select B.
- Otherwise, select A.
- """
- if u.db(0, 0).dbid() >= 0: # dbid is < 0 if there's no d'board or a problem
- return (0, 0)
- if u.db(1, 0).dbid() >= 0:
- return (1, 0)
- return (0, 0)
-
-
-class app_top_block(stdgui2.std_top_block):
- def __init__(self, frame, panel, vbox, argv):
- stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
-
- self.frame = frame
- self.panel = panel
-
- parser = OptionParser(option_class=eng_option)
- parser.add_option("-R", "--rx-subdev-spec", type="subdev", default=None,
- help="select USRP Rx side A or B (default=first one with a daughterboard)")
- parser.add_option("-d", "--decim", type="int", default=16,
- help="set fgpa decimation rate to DECIM [default=%default]")
- parser.add_option("-f", "--freq", type="eng_float", default=None,
- help="set frequency to FREQ", metavar="FREQ")
- parser.add_option("-g", "--gain", type="eng_float", default=None,
- help="set gain in dB (default is midpoint)")
- parser.add_option("-8", "--width-8", action="store_true", default=False,
- help="Enable 8-bit samples across USB")
- parser.add_option( "--no-hb", action="store_true", default=False,
- help="don't use halfband filter in usrp")
- parser.add_option("-C", "--basic-complex", action="store_true", default=False,
- help="Use both inputs of a basicRX or LFRX as a single Complex input channel")
- parser.add_option("-D", "--basic-dualchan", action="store_true", default=False,
- help="Use both inputs of a basicRX or LFRX as seperate Real input channels")
- parser.add_option("-n", "--frame-decim", type="int", default=1,
- help="set oscope frame decimation factor to n [default=1]")
- parser.add_option("-v", "--v-scale", type="eng_float", default=1000,
- help="set oscope initial V/div to SCALE [default=%default]")
- parser.add_option("-t", "--t-scale", type="eng_float", default=49e-6,
- help="set oscope initial s/div to SCALE [default=50us]")
- (options, args) = parser.parse_args()
- if len(args) != 0:
- parser.print_help()
- sys.exit(1)
-
- self.show_debug_info = True
-
- # build the graph
- if options.basic_dualchan:
- self.num_inputs=2
- else:
- self.num_inputs=1
- if options.no_hb or (options.decim<8):
- #Min decimation of this firmware is 4.
- #contains 4 Rx paths without halfbands and 0 tx paths.
- self.fpga_filename="std_4rx_0tx.rbf"
- self.u = usrp.source_c(nchan=self.num_inputs,decim_rate=options.decim, fpga_filename=self.fpga_filename)
- else:
- #Min decimation of standard firmware is 8.
- #standard fpga firmware "std_2rxhb_2tx.rbf"
- #contains 2 Rx paths with halfband filters and 2 tx paths (the default)
- self.u = usrp.source_c(nchan=self.num_inputs,decim_rate=options.decim)
-
- if options.rx_subdev_spec is None:
- options.rx_subdev_spec = pick_subdevice(self.u)
-
- if options.width_8:
- width = 8
- shift = 8
- format = self.u.make_format(width, shift)
- #print "format =", hex(format)
- r = self.u.set_format(format)
- #print "set_format =", r
-
- # determine the daughterboard subdevice we're using
- self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
- if (options.basic_complex or options.basic_dualchan ):
- if ((self.subdev.dbid()==usrp_dbid.BASIC_RX) or (self.subdev.dbid()==usrp_dbid.LF_RX)):
- side = options.rx_subdev_spec[0] # side A = 0, side B = 1
- if options.basic_complex:
- #force Basic_RX and LF_RX in complex mode (use both I and Q channel)
- print "Receiver daughterboard forced in complex mode. Both inputs will combined to form a single complex channel."
- self.dualchan=False
- if side==0:
- self.u.set_mux(0x00000010) #enable adc 0 and 1 to form a single complex input on side A
- else: #side ==1
- self.u.set_mux(0x00000032) #enable adc 3 and 2 to form a single complex input on side B
- elif options.basic_dualchan:
- #force Basic_RX and LF_RX in dualchan mode (use input A for channel 0 and input B for channel 1)
- print "Receiver daughterboard forced in dualchannel mode. Each input will be used to form a seperate channel."
- self.dualchan=True
- if side==0:
- self.u.set_mux(gru.hexint(0xf0f0f1f0)) #enable adc 0, side A to form a real input on channel 0 and adc1,side A to form a real input on channel 1
- else: #side ==1
- self.u.set_mux(0xf0f0f3f2) #enable adc 2, side B to form a real input on channel 0 and adc3,side B to form a real input on channel 1
- else:
- sys.stderr.write('options basic_dualchan or basic_complex is only supported for Basic Rx or LFRX at the moment\n')
- sys.exit(1)
- else:
- self.dualchan=False
- self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
-
- input_rate = self.u.adc_freq() / self.u.decim_rate()
-
- self.scope = scopesink2.scope_sink_c(panel, sample_rate=input_rate,
- frame_decim=options.frame_decim,
- v_scale=options.v_scale,
- t_scale=options.t_scale,
- num_inputs=self.num_inputs)
- if self.dualchan:
- # deinterleave two channels from FPGA
- self.di = gr.deinterleave(gr.sizeof_gr_complex)
- self.connect(self.u,self.di)
- self.connect((self.di,0),(self.scope,0))
- self.connect((self.di,1),(self.scope,1))
- else:
- self.connect(self.u, self.scope)
-
- self._build_gui(vbox)
-
- # set initial values
-
- if options.gain is None:
- # if no gain was specified, use the mid-point in dB
- g = self.subdev.gain_range()
- options.gain = float(g[0]+g[1])/2
-
- if options.freq is None:
- if ((self.subdev.dbid()==usrp_dbid.BASIC_RX) or (self.subdev.dbid()==usrp_dbid.LF_RX)):
- #for Basic RX and LFRX if no freq is specified you probably want 0.0 Hz and not 45 GHz
- options.freq=0.0
- else:
- # if no freq was specified, use the mid-point
- r = self.subdev.freq_range()
- options.freq = float(r[0]+r[1])/2
-
- self.set_gain(options.gain)
-
- if self.show_debug_info:
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- self.myform['dbname'].set_value(self.subdev.name())
- self.myform['baseband'].set_value(0)
- self.myform['ddc'].set_value(0)
- if self.num_inputs==2:
- self.myform['baseband2'].set_value(0)
- self.myform['ddc2'].set_value(0)
-
- if not(self.set_freq(options.freq)):
- self._set_status_msg("Failed to set initial frequency")
- if self.num_inputs==2:
- if not(self.set_freq2(options.freq)):
- self._set_status_msg("Failed to set initial frequency for channel 2")
-
-
- def _set_status_msg(self, msg):
- self.frame.GetStatusBar().SetStatusText(msg, 0)
-
- def _build_gui(self, vbox):
-
- def _form_set_freq(kv):
- return self.set_freq(kv['freq'])
-
- def _form_set_freq2(kv):
- return self.set_freq2(kv['freq2'])
- vbox.Add(self.scope.win, 10, wx.EXPAND)
-
- # add control area at the bottom
- self.myform = myform = form.form()
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0, 0)
- myform['freq'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq", weight=1,
- callback=myform.check_input_and_call(_form_set_freq, self._set_status_msg))
- if self.num_inputs==2:
- myform['freq2'] = form.float_field(
- parent=self.panel, sizer=hbox, label="Center freq2", weight=1,
- callback=myform.check_input_and_call(_form_set_freq2, self._set_status_msg))
- hbox.Add((5,0), 0, 0)
- g = self.subdev.gain_range()
- myform['gain'] = form.slider_field(parent=self.panel, sizer=hbox, label="Gain",
- weight=3,
- min=int(g[0]), max=int(g[1]),
- callback=self.set_gain)
-
- hbox.Add((5,0), 0, 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
- self._build_subpanel(vbox)
-
- def _build_subpanel(self, vbox_arg):
- # build a secondary information panel (sometimes hidden)
-
- # FIXME figure out how to have this be a subpanel that is always
- # created, but has its visibility controlled by foo.Show(True/False)
-
- def _form_set_decim(kv):
- return self.set_decim(kv['decim'])
-
- if not(self.show_debug_info):
- return
-
- panel = self.panel
- vbox = vbox_arg
- myform = self.myform
-
- #panel = wx.Panel(self.panel, -1)
- #vbox = wx.BoxSizer(wx.VERTICAL)
-
- hbox = wx.BoxSizer(wx.HORIZONTAL)
- hbox.Add((5,0), 0)
-
- myform['decim'] = form.int_field(
- parent=panel, sizer=hbox, label="Decim",
- callback=myform.check_input_and_call(_form_set_decim, self._set_status_msg))
-
- hbox.Add((5,0), 1)
- myform['fs@usb'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Fs@USB")
-
- hbox.Add((5,0), 1)
- myform['dbname'] = form.static_text_field(
- parent=panel, sizer=hbox)
-
- hbox.Add((5,0), 1)
- myform['baseband'] = form.static_float_field(
- parent=panel, sizer=hbox, label="Analog BB")
-
- hbox.Add((5,0), 1)
- myform['ddc'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC")
- if self.num_inputs==2:
- hbox.Add((1,0), 1)
- myform['baseband2'] = form.static_float_field(
- parent=panel, sizer=hbox, label="BB2")
- hbox.Add((1,0), 1)
- myform['ddc2'] = form.static_float_field(
- parent=panel, sizer=hbox, label="DDC2")
-
- hbox.Add((5,0), 0)
- vbox.Add(hbox, 0, wx.EXPAND)
-
-
- def set_freq(self, target_freq):
- """
- Set the center frequency we're interested in.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = usrp.tune(self.u, 0, self.subdev, target_freq)
-
- if r:
- self.myform['freq'].set_value(target_freq) # update displayed value
- if self.show_debug_info:
- self.myform['baseband'].set_value(r.baseband_freq)
- self.myform['ddc'].set_value(r.dxc_freq)
- return True
-
- return False
-
- def set_freq2(self, target_freq):
- """
- Set the center frequency of we're interested in for the second channel.
-
- @param target_freq: frequency in Hz
- @rypte: bool
-
- Tuning is a two step process. First we ask the front-end to
- tune as close to the desired frequency as it can. Then we use
- the result of that operation and our target_frequency to
- determine the value for the digital down converter.
- """
- r = usrp.tune(self.u, 1, self.subdev, target_freq)
-
- if r:
- self.myform['freq2'].set_value(target_freq) # update displayed value
- if self.show_debug_info:
- self.myform['baseband2'].set_value(r.baseband_freq)
- self.myform['ddc2'].set_value(r.dxc_freq)
- return True
-
- return False
-
- def set_gain(self, gain):
- self.myform['gain'].set_value(gain) # update displayed value
- self.subdev.set_gain(gain)
-
- def set_decim(self, decim):
- ok = self.u.set_decim_rate(decim)
- if not ok:
- print "set_decim failed"
- input_rate = self.u.adc_freq() / self.u.decim_rate()
- self.scope.set_sample_rate(input_rate)
- if self.show_debug_info: # update displayed values
- self.myform['decim'].set_value(self.u.decim_rate())
- self.myform['fs@usb'].set_value(self.u.adc_freq() / self.u.decim_rate())
- return ok
-
-def main ():
- app = stdgui2.stdapp(app_top_block, "USRP O'scope", nstatus=1)
- app.MainLoop()
-
-if __name__ == '__main__':
- main ()
diff --git a/gr-video-sdl/src/Makefile.swig.gen b/gr-video-sdl/src/Makefile.swig.gen
index d69203f79..ac66bc9a2 100644
--- a/gr-video-sdl/src/Makefile.swig.gen
+++ b/gr-video-sdl/src/Makefile.swig.gen
@@ -105,7 +105,7 @@ _video_sdl_la_CXXFLAGS = \
$(video_sdl_la_swig_cxxflags)
python/video_sdl.cc: video_sdl.py
-video_sdl.py: video_sdl.i
+video_sdl.py: video_sdl.i
# Include the python dependencies for this file
-include python/video_sdl.d
diff --git a/gr-cvsd-vocoder/.gitignore b/gr-vocoder/.gitignore
index a37fc0c1a..a37fc0c1a 100644
--- a/gr-cvsd-vocoder/.gitignore
+++ b/gr-vocoder/.gitignore
diff --git a/gr-gcell/src/examples/Makefile.am b/gr-vocoder/Makefile.am
index bdea961ea..c280358a8 100644
--- a/gr-gcell/src/examples/Makefile.am
+++ b/gr-vocoder/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2008,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,8 +21,11 @@
include $(top_srcdir)/Makefile.common
-#ourdatadir = $(exampledir)/gcell
+SUBDIRS = include lib python swig grc apps examples doc
-#dist_ourdata_DATA = README
+if PYTHON
+SUBDIRS += python swig
+endif
-#dist_ourdata_SCRIPTS = fsm_utils.py
+pkgconfigdir = $(libdir)/pkgconfig
+dist_pkgconfig_DATA = gnuradio-vocoder.pc
diff --git a/gr-gpio/src/fpga/.gitignore b/gr-vocoder/apps/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-gpio/src/fpga/.gitignore
+++ b/gr-vocoder/apps/.gitignore
diff --git a/gr-sounder/doc/Makefile.am b/gr-vocoder/apps/Makefile.am
index 714ed52b9..b1c7b44d5 100644
--- a/gr-sounder/doc/Makefile.am
+++ b/gr-vocoder/apps/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,3 +21,4 @@
include $(top_srcdir)/Makefile.common
+SUBDIRS =
diff --git a/gr-gpio/src/fpga/include/.gitignore b/gr-vocoder/doc/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-gpio/src/fpga/include/.gitignore
+++ b/gr-vocoder/doc/.gitignore
diff --git a/gr-vocoder/doc/Makefile.am b/gr-vocoder/doc/Makefile.am
new file mode 100644
index 000000000..a277264fe
--- /dev/null
+++ b/gr-vocoder/doc/Makefile.am
@@ -0,0 +1,27 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+SUBDIRS =
+
+dist_gr_doc_DATA = \
+ README.vocoder
diff --git a/gr-vocoder/doc/README.vocoder b/gr-vocoder/doc/README.vocoder
new file mode 100644
index 000000000..912d664ad
--- /dev/null
+++ b/gr-vocoder/doc/README.vocoder
@@ -0,0 +1,12 @@
+This is the gr-vocoder package. This package includes the various
+vocoder blocks in GNU Radio. To use the vocoder blocks, the Python
+namespaces is in gnuradio.vocoder, which would be normally imported
+as:
+
+ from gnuradio import vocoder
+
+See the Doxygen documentation for details about the blocks available
+in this package. A quick listing of the details can be found in Python
+after importing by using:
+
+ help(vocoder)
diff --git a/gr-vocoder/doc/vocoder.dox b/gr-vocoder/doc/vocoder.dox
new file mode 100644
index 000000000..ff1c4b9dd
--- /dev/null
+++ b/gr-vocoder/doc/vocoder.dox
@@ -0,0 +1,24 @@
+/*! \page page_vocoder Voice Coders and Decoders (Vocoders)
+
+\section Introduction
+
+This is the gr-vocoder package. It contains all available vocoders in
+GNU Radio. The Python namespaces is in gnuradio.vocoder, which would be
+normally imported as:
+
+\code
+ from gnuradio import vocoder
+\endcode
+
+See the Doxygen documentation for details about the blocks available
+in this package. The relevant blocks are listed in the \ref
+vocoder_blk group.
+
+A quick listing of the details can be found in Python after importing
+by using:
+
+\code
+ help(vocoder)
+\endcode
+
+*/
diff --git a/gr-radar-mono/src/fpga/.gitignore b/gr-vocoder/examples/.gitignore
index b336cc7ce..0a864cc38 100644
--- a/gr-radar-mono/src/fpga/.gitignore
+++ b/gr-vocoder/examples/.gitignore
@@ -1,2 +1,3 @@
/Makefile
/Makefile.in
+
diff --git a/gr-vocoder/examples/Makefile.am b/gr-vocoder/examples/Makefile.am
new file mode 100644
index 000000000..32176cf23
--- /dev/null
+++ b/gr-vocoder/examples/Makefile.am
@@ -0,0 +1,34 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+ourdatadir = $(exampledir)/vocoder
+
+dist_ourdata_SCRIPTS = \
+ alaw_audio_loopback.py \
+ codec2_audio_loopback.py \
+ cvsd_audio_loopback.py \
+ g721_audio_loopback.py \
+ g723_24_audio_loopback.py \
+ g723_40_audio_loopback.py \
+ gsm_audio_loopback.py \
+ ulaw_audio_loopback.py
diff --git a/gr-gsm-fr-vocoder/src/python/encdec.py b/gr-vocoder/examples/alaw_audio_loopback.py
index 94e4e5b82..8fdd64d44 100755
--- a/gr-gsm-fr-vocoder/src/python/encdec.py
+++ b/gr-vocoder/examples/alaw_audio_loopback.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2005,2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,15 +22,15 @@
from gnuradio import gr
from gnuradio import audio
-from gnuradio.vocoder import gsm_full_rate
+from gnuradio import vocoder
def build_graph():
tb = gr.top_block()
src = audio.source(8000)
src_scale = gr.multiply_const_ff(32767)
f2s = gr.float_to_short ()
- enc = gsm_full_rate.encode_sp()
- dec = gsm_full_rate.decode_ps()
+ enc = vocoder.alaw_encode_sb()
+ dec = vocoder.alaw_decode_bs()
s2f = gr.short_to_float ()
sink_scale = gr.multiply_const_ff(1.0/32767.)
sink = audio.sink(8000)
@@ -42,3 +42,4 @@ if __name__ == '__main__':
tb.start()
raw_input ('Press Enter to exit: ')
tb.stop()
+ tb.wait()
diff --git a/gr-vocoder/examples/codec2_audio_loopback.py b/gr-vocoder/examples/codec2_audio_loopback.py
new file mode 100755
index 000000000..54b453f8a
--- /dev/null
+++ b/gr-vocoder/examples/codec2_audio_loopback.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+#
+# Copyright 2005,2007,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
+from gnuradio import audio
+from gnuradio import vocoder
+
+def build_graph():
+ tb = gr.top_block()
+ src = audio.source(8000)
+ src_scale = gr.multiply_const_ff(32767)
+ f2s = gr.float_to_short ()
+ enc = vocoder.codec2_encode_sp()
+ dec = vocoder.codec2_decode_ps()
+ s2f = gr.short_to_float ()
+ sink_scale = gr.multiply_const_ff(1.0/32767.)
+ sink = audio.sink(8000)
+ tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+ return tb
+
+if __name__ == '__main__':
+ tb = build_graph()
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-cvsd-vocoder/src/python/encdec.py b/gr-vocoder/examples/cvsd_audio_loopback.py
index 34c153b06..7f2a00dbf 100755
--- a/gr-cvsd-vocoder/src/python/encdec.py
+++ b/gr-vocoder/examples/cvsd_audio_loopback.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,7 +22,7 @@
from gnuradio import gr, blks2
from gnuradio import audio
-from gnuradio.vocoder import cvsd_vocoder
+from gnuradio import vocoder
def build_graph():
sample_rate = 8000
@@ -35,8 +35,8 @@ def build_graph():
interp = blks2.rational_resampler_fff(8, 1)
f2s = gr.float_to_short ()
- enc = cvsd_vocoder.encode_sb()
- dec = cvsd_vocoder.decode_bs()
+ enc = vocoder.cvsd_encode_sb()
+ dec = vocoder.cvsd_decode_bs()
s2f = gr.short_to_float ()
decim = blks2.rational_resampler_fff(1, 8)
@@ -62,8 +62,7 @@ def build_graph():
if __name__ == '__main__':
tb = build_graph()
- print "Enter CTRL-C to stop"
- try:
- tb.run()
- except KeyboardInterrupt:
- pass
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-vocoder/examples/g721_audio_loopback.py b/gr-vocoder/examples/g721_audio_loopback.py
new file mode 100755
index 000000000..8b5bc8f33
--- /dev/null
+++ b/gr-vocoder/examples/g721_audio_loopback.py
@@ -0,0 +1,45 @@
+#!/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
+from gnuradio import audio
+from gnuradio import vocoder
+
+def build_graph():
+ tb = gr.top_block()
+ src = audio.source(8000)
+ src_scale = gr.multiply_const_ff(32767)
+ f2s = gr.float_to_short ()
+ enc = vocoder.g721_encode_sb()
+ dec = vocoder.g721_decode_bs()
+ s2f = gr.short_to_float ()
+ sink_scale = gr.multiply_const_ff(1.0/32767.)
+ sink = audio.sink(8000)
+ tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+ return tb
+
+if __name__ == '__main__':
+ tb = build_graph()
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-vocoder/examples/g723_24_audio_loopback.py b/gr-vocoder/examples/g723_24_audio_loopback.py
new file mode 100755
index 000000000..f125282dc
--- /dev/null
+++ b/gr-vocoder/examples/g723_24_audio_loopback.py
@@ -0,0 +1,45 @@
+#!/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
+from gnuradio import audio
+from gnuradio import vocoder
+
+def build_graph():
+ tb = gr.top_block()
+ src = audio.source(8000)
+ src_scale = gr.multiply_const_ff(32767)
+ f2s = gr.float_to_short ()
+ enc = vocoder.g723_24_encode_sb()
+ dec = vocoder.g723_24_decode_bs()
+ s2f = gr.short_to_float ()
+ sink_scale = gr.multiply_const_ff(1.0/32767.)
+ sink = audio.sink(8000)
+ tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+ return tb
+
+if __name__ == '__main__':
+ tb = build_graph()
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-vocoder/examples/g723_40_audio_loopback.py b/gr-vocoder/examples/g723_40_audio_loopback.py
new file mode 100755
index 000000000..cd2ea5ff1
--- /dev/null
+++ b/gr-vocoder/examples/g723_40_audio_loopback.py
@@ -0,0 +1,45 @@
+#!/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
+from gnuradio import audio
+from gnuradio import vocoder
+
+def build_graph():
+ tb = gr.top_block()
+ src = audio.source(8000)
+ src_scale = gr.multiply_const_ff(32767)
+ f2s = gr.float_to_short ()
+ enc = vocoder.g723_40_encode_sb()
+ dec = vocoder.g723_40_decode_bs()
+ s2f = gr.short_to_float ()
+ sink_scale = gr.multiply_const_ff(1.0/32767.)
+ sink = audio.sink(8000)
+ tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+ return tb
+
+if __name__ == '__main__':
+ tb = build_graph()
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-vocoder/examples/gsm_audio_loopback.py b/gr-vocoder/examples/gsm_audio_loopback.py
new file mode 100755
index 000000000..f4e96f471
--- /dev/null
+++ b/gr-vocoder/examples/gsm_audio_loopback.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+#
+# Copyright 2005,2007,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
+from gnuradio import audio
+from gnuradio import vocoder
+
+def build_graph():
+ tb = gr.top_block()
+ src = audio.source(8000)
+ src_scale = gr.multiply_const_ff(32767)
+ f2s = gr.float_to_short ()
+ enc = vocoder.gsm_fr_encode_sp()
+ dec = vocoder.gsm_fr_decode_ps()
+ s2f = gr.short_to_float ()
+ sink_scale = gr.multiply_const_ff(1.0/32767.)
+ sink = audio.sink(8000)
+ tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+ return tb
+
+if __name__ == '__main__':
+ tb = build_graph()
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-vocoder/examples/ulaw_audio_loopback.py b/gr-vocoder/examples/ulaw_audio_loopback.py
new file mode 100755
index 000000000..afe0921fa
--- /dev/null
+++ b/gr-vocoder/examples/ulaw_audio_loopback.py
@@ -0,0 +1,45 @@
+#!/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
+from gnuradio import audio
+from gnuradio import vocoder
+
+def build_graph():
+ tb = gr.top_block()
+ src = audio.source(8000)
+ src_scale = gr.multiply_const_ff(32767)
+ f2s = gr.float_to_short ()
+ enc = vocoder.ulaw_encode_sb()
+ dec = vocoder.ulaw_decode_bs()
+ s2f = gr.short_to_float ()
+ sink_scale = gr.multiply_const_ff(1.0/32767.)
+ sink = audio.sink(8000)
+ tb.connect(src, src_scale, f2s, enc, dec, s2f, sink_scale, sink)
+ return tb
+
+if __name__ == '__main__':
+ tb = build_graph()
+ tb.start()
+ raw_input ('Press Enter to exit: ')
+ tb.stop()
+ tb.wait()
diff --git a/gr-cvsd-vocoder/gnuradio-cvsd-vocoder.pc.in b/gr-vocoder/gnuradio-vocoder.pc.in
index f5f0c2e64..7ff4420b6 100644
--- a/gr-cvsd-vocoder/gnuradio-cvsd-vocoder.pc.in
+++ b/gr-vocoder/gnuradio-vocoder.pc.in
@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
-Name: gnuradio-cvsd-vocoder
-Description: GNU Radio blocks implementing a CVSD vocoder
+Name: gnuradio-vocoder
+Description: GNU Radio blocks implementing voice codecs
Requires: gnuradio-core
Version: @LIBVER@
-Libs: -L${libdir} -lgnuradio-cvsd-vocoder
+Libs: -L${libdir} -lgnuradio-vocoder
Cflags: -I${includedir}
diff --git a/gr-cvsd-vocoder/src/lib/.gitignore b/gr-vocoder/grc/.gitignore
index ea0a01678..d2e2e9ce8 100644
--- a/gr-cvsd-vocoder/src/lib/.gitignore
+++ b/gr-vocoder/grc/.gitignore
@@ -2,8 +2,6 @@
/Makefile.in
/.libs
/.deps
-/cvsd_vocoder.cc
-/cvsd_vocoder.py*
/gnuradio
/guile
/python
diff --git a/gr-radar-mono/src/lib/Makefile.am b/gr-vocoder/grc/Makefile.am
index 4f35e3aef..b1c7b44d5 100644
--- a/gr-radar-mono/src/lib/Makefile.am
+++ b/gr-vocoder/grc/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,3 +20,5 @@
#
include $(top_srcdir)/Makefile.common
+
+SUBDIRS =
diff --git a/gr-gpio/src/fpga/lib/.gitignore b/gr-vocoder/include/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-gpio/src/fpga/lib/.gitignore
+++ b/gr-vocoder/include/.gitignore
diff --git a/gnuradio-core/src/python/gnuradio/vocoder/Makefile.am b/gr-vocoder/include/Makefile.am
index 69c140c10..aab77e3f9 100644
--- a/gnuradio-core/src/python/gnuradio/vocoder/Makefile.am
+++ b/gr-vocoder/include/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2004,2007 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,6 +21,21 @@
include $(top_srcdir)/Makefile.common
-grvocoderpythondir = $(grpythondir)/vocoder
-grvocoderpython_PYTHON = \
- __init__.py
+# C/C++ headers get installed in ${prefix}/include/gnuradio
+grinclude_HEADERS = \
+ vocoder_alaw_decode_bs.h \
+ vocoder_alaw_encode_sb.h \
+ vocoder_codec2_decode_ps.h \
+ vocoder_codec2_encode_sp.h \
+ vocoder_cvsd_decode_bs.h \
+ vocoder_cvsd_encode_sb.h \
+ vocoder_g721_decode_bs.h \
+ vocoder_g721_encode_sb.h \
+ vocoder_g723_24_decode_bs.h \
+ vocoder_g723_24_encode_sb.h \
+ vocoder_g723_40_decode_bs.h \
+ vocoder_g723_40_encode_sb.h \
+ vocoder_gsm_fr_decode_ps.h \
+ vocoder_gsm_fr_encode_sp.h \
+ vocoder_ulaw_decode_bs.h \
+ vocoder_ulaw_encode_sb.h
diff --git a/gr-vocoder/include/vocoder_alaw_decode_bs.h b/gr-vocoder/include/vocoder_alaw_decode_bs.h
new file mode 100644
index 000000000..b71569439
--- /dev/null
+++ b/gr-vocoder/include/vocoder_alaw_decode_bs.h
@@ -0,0 +1,55 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_ALAW_DECODE_BS_H
+#define INCLUDED_VOCODER_ALAW_DECODE_BS_H
+
+#include <gr_sync_block.h>
+
+class vocoder_alaw_decode_bs;
+
+typedef boost::shared_ptr<vocoder_alaw_decode_bs> vocoder_alaw_decode_bs_sptr;
+
+vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs();
+
+/*!
+ * \brief This block performs alaw audio decoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_alaw_decode_bs : public gr_sync_block
+{
+private:
+ friend vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs();
+
+ vocoder_alaw_decode_bs();
+
+ public:
+ ~vocoder_alaw_decode_bs();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_VOCODER_ALAW_DECODE_BS_H */
diff --git a/gr-vocoder/include/vocoder_alaw_encode_sb.h b/gr-vocoder/include/vocoder_alaw_encode_sb.h
new file mode 100644
index 000000000..d1858d048
--- /dev/null
+++ b/gr-vocoder/include/vocoder_alaw_encode_sb.h
@@ -0,0 +1,54 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_ALAW_ENCODER_SB_H
+#define INCLUDED_VOCODER_ALAW_ENCODER_SB_H
+
+#include <gr_sync_block.h>
+
+class vocoder_alaw_encode_sb;
+
+typedef boost::shared_ptr<vocoder_alaw_encode_sb> vocoder_alaw_encode_sb_sptr;
+
+vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb();
+
+/*!
+ * \brief This block performs g.711 alaw audio encoding.
+ *
+ * \ingroup vocoder_blk
+ */
+class vocoder_alaw_encode_sb : public gr_sync_block
+{
+private:
+ friend vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb();
+
+ vocoder_alaw_encode_sb();
+
+ public:
+ ~vocoder_alaw_encode_sb();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_VOCODER_ALAW_ENCODE_SB_H */
diff --git a/gr-msdd6000/src/msdd.i b/gr-vocoder/include/vocoder_codec2_decode_ps.h
index 935bf2b58..02b80a454 100644
--- a/gr-msdd6000/src/msdd.i
+++ b/gr-vocoder/include/vocoder_codec2_decode_ps.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2009 Free Software Foundation, Inc.
+ * Copyright 2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,46 +19,32 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
+#ifndef INCLUDED_VOCODER_CODEC2_DECODE_PS_H
+#define INCLUDED_VOCODER_CODEC2_DECODE_PS_H
-%include "gnuradio.i" // the common stuff
+#include <gr_sync_interpolator.h>
-%{
-#include "msdd_source_simple.h"
-%}
+class vocoder_codec2_decode_ps;
+typedef boost::shared_ptr<vocoder_codec2_decode_ps> vocoder_codec2_decode_ps_sptr;
+vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps ();
-GR_SWIG_BLOCK_MAGIC(msdd,source_simple)
-
-msdd_source_simple_sptr
-msdd_make_source_simple (
- const char *src,
- unsigned short port_src
- );
-
-class msdd_source_simple : public gr_sync_block {
- protected:
- msdd_source_simple(
- const char *src,
- unsigned short port_src
- );
-
- public:
- ~msdd_source_c();
- int work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items);
+/*!
+ * \brief CODEC2 Vocoder Decoder
+ * \ingroup vocoder_blk
+ */
+class vocoder_codec2_decode_ps : public gr_sync_interpolator {
+ void *d_codec2;
- bool start();
- bool stop();
+ friend vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps ();
+ vocoder_codec2_decode_ps ();
- long adc_freq();
- int decim_rate();
- gr_vector_int gain_range();
- gr_vector_float freq_range();
+public:
+ ~vocoder_codec2_decode_ps ();
- bool set_decim_rate(unsigned int);
- bool set_rx_freq(int,double);
- bool set_pga(int,double);
-
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
- };
+#endif /* INCLUDED_VOCODER_CODEC2_DECODE_PS_H */
diff --git a/gr-vocoder/include/vocoder_codec2_encode_sp.h b/gr-vocoder/include/vocoder_codec2_encode_sp.h
new file mode 100644
index 000000000..de4784f8d
--- /dev/null
+++ b/gr-vocoder/include/vocoder_codec2_encode_sp.h
@@ -0,0 +1,50 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005 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_VOCODER_CODEC2_ENCODE_SP_H
+#define INCLUDED_VOCODER_CODEC2_ENCODE_SP_H
+
+#include <gr_sync_decimator.h>
+
+class vocoder_codec2_encode_sp;
+typedef boost::shared_ptr<vocoder_codec2_encode_sp> vocoder_codec2_encode_sp_sptr;
+
+vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp ();
+
+/*!
+ * \brief CODEC2 Vocoder Encoder
+ * \ingroup vocoder_blk
+ */
+class vocoder_codec2_encode_sp : public gr_sync_decimator {
+ void *d_codec2;
+
+ friend vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp ();
+ vocoder_codec2_encode_sp ();
+
+public:
+ ~vocoder_codec2_encode_sp ();
+
+ int work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_VOCODER_CODEC2_ENCODE_SP_H */
diff --git a/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h b/gr-vocoder/include/vocoder_cvsd_decode_bs.h
index f7b50909f..104ec2400 100644
--- a/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.h
+++ b/gr-vocoder/include/vocoder_cvsd_decode_bs.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2007 Free Software Foundation, Inc.
+ * Copyright 2007,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,20 +19,23 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_CVSD_DECODE_BS_H
-#define INCLUDED_CVSD_DECODE_BS_H
+
+#ifndef INCLUDED_VOCODER_CVSD_DECODE_BS_H
+#define INCLUDED_VOCODER_CVSD_DECODE_BS_H
#include <gr_sync_interpolator.h>
-class cvsd_decode_bs;
+class vocoder_cvsd_decode_bs;
-typedef boost::shared_ptr<cvsd_decode_bs> cvsd_decode_bs_sptr;
+typedef boost::shared_ptr<vocoder_cvsd_decode_bs> vocoder_cvsd_decode_bs_sptr;
/*!
* \brief Constructor parameters to initialize the CVSD decoder. The default
* values are modeled after the Bluetooth standard and should not be changed,
* except by an advanced user
*
+ * \ingroup vocoder_blk
+ *
* \param min_step Minimum step size used to update the internal reference. Default: "10"
* \param max_step Maximum step size used to update the internal reference. Default: "1280"
* \param step_decay Decay factor applied to step size when there is not a run of J output 1s or 0s. Default: "0.9990234375" (i.e. 1-1/1024)
@@ -43,14 +46,14 @@ typedef boost::shared_ptr<cvsd_decode_bs> cvsd_decode_bs_sptr;
* \param neg_accum_max Minimum integer value allowed for the internal reference. Default: "-32767" (-2^15 + 1 or MINSHORT+1)
*
*/
-cvsd_decode_bs_sptr cvsd_make_decode_bs (short min_step=10,
- short max_step=1280,
- double step_decay=0.9990234375,
- double accum_decay= 0.96875,
- int K=32,
- int J=4,
- short pos_accum_max=32767,
- short neg_accum_max=-32767);
+vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10,
+ short max_step=1280,
+ double step_decay=0.9990234375,
+ double accum_decay= 0.96875,
+ int K=32,
+ int J=4,
+ short pos_accum_max=32767,
+ short neg_accum_max=-32767);
/*!
* \brief This block performs CVSD audio decoding. Its design and implementation
@@ -104,21 +107,21 @@ cvsd_decode_bs_sptr cvsd_make_decode_bs (short min_step=10,
*
*/
-class cvsd_decode_bs : public gr_sync_interpolator
+class vocoder_cvsd_decode_bs : public gr_sync_interpolator
{
private:
- friend cvsd_decode_bs_sptr cvsd_make_decode_bs (short min_step,
- short max_step,
- double step_decay,
- double accum_decay,
- int K,
- int J,
- short pos_accum_max,
- short neg_accum_max);
-
- cvsd_decode_bs (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max);
+ friend vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step,
+ short max_step,
+ double step_decay,
+ double accum_decay,
+ int K,
+ int J,
+ short pos_accum_max,
+ short neg_accum_max);
+
+ vocoder_cvsd_decode_bs (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max);
//! Member functions required by the encoder/decoder
//! \brief Rounding function specific to CVSD
@@ -151,7 +154,7 @@ private:
short d_stepsize; //!< \brief Current value of the step sizer
public:
- ~cvsd_decode_bs (); // public destructor
+ ~vocoder_cvsd_decode_bs (); // public destructor
short min_step() { return d_min_step; }
short max_step() { return d_max_step; }
@@ -167,4 +170,4 @@ private:
gr_vector_void_star &output_items);
};
-#endif /* INCLUDED_CVSD_DECODE_BS_H */
+#endif /* INCLUDED_VOCODER_CVSD_DECODE_BS_H */
diff --git a/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h b/gr-vocoder/include/vocoder_cvsd_encode_sb.h
index a7994d4ed..422a2f521 100644
--- a/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.h
+++ b/gr-vocoder/include/vocoder_cvsd_encode_sb.h
@@ -19,19 +19,21 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_CVSD_ENCODER_SB_H
-#define INCLUDED_CVSD_ENCODER_SB_H
+#ifndef INCLUDED_VOCODER_CVSD_ENCODER_SB_H
+#define INCLUDED_VOCODER_CVSD_ENCODER_SB_H
#include <gr_sync_decimator.h>
-class cvsd_encode_sb;
+class vocoder_cvsd_encode_sb;
-typedef boost::shared_ptr<cvsd_encode_sb> cvsd_encode_sb_sptr;
+typedef boost::shared_ptr<vocoder_cvsd_encode_sb> vocoder_cvsd_encode_sb_sptr;
/*!
- * \brief Constructor parameters to initialize the CVSD encoder. The default
- * values are modeled after the Bluetooth standard and should not be changed
- * except by an advanced user
+ * \brief Constructor parameters to initialize the CVSD encoder. The
+ * default values are modeled after the Bluetooth standard and should
+ * not be changed except by an advanced user
+ *
+ * \ingroup vocoder_blk
*
* \param min_step Minimum step size used to update the internal reference. Default: "10"
* \param max_step Maximum step size used to update the internal reference. Default: "1280"
@@ -44,14 +46,14 @@ typedef boost::shared_ptr<cvsd_encode_sb> cvsd_encode_sb_sptr;
*
*/
-cvsd_encode_sb_sptr cvsd_make_encode_sb (short min_step=10,
- short max_step=1280,
- double step_decay=0.9990234375,
- double accum_decay= 0.96875,
- int K=32,
- int J=4,
- short pos_accum_max=32767,
- short neg_accum_max=-32767);
+vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step=10,
+ short max_step=1280,
+ double step_decay=0.9990234375,
+ double accum_decay= 0.96875,
+ int K=32,
+ int J=4,
+ short pos_accum_max=32767,
+ short neg_accum_max=-32767);
/*!
* \brief This block performs CVSD audio encoding. Its design and implementation
@@ -107,21 +109,21 @@ cvsd_encode_sb_sptr cvsd_make_encode_sb (short min_step=10,
*
*/
-class cvsd_encode_sb : public gr_sync_decimator
+class vocoder_cvsd_encode_sb : public gr_sync_decimator
{
private:
- friend cvsd_encode_sb_sptr cvsd_make_encode_sb (short min_step,
- short max_step,
- double step_decay,
- double accum_decay,
- int K,
- int J,
- short pos_accum_max,
- short neg_accum_max);
+ friend vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb(short min_step,
+ short max_step,
+ double step_decay,
+ double accum_decay,
+ int K,
+ int J,
+ short pos_accum_max,
+ short neg_accum_max);
- cvsd_encode_sb (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max);
+ vocoder_cvsd_encode_sb(short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max);
//! Member functions required by the encoder/decoder
//! \brief Rounding function specific to CVSD
@@ -154,7 +156,7 @@ private:
short d_stepsize; //!< \brief Current value of the step sizer
public:
- ~cvsd_encode_sb (); // public destructor
+ ~vocoder_cvsd_encode_sb (); // public destructor
short min_step() { return d_min_step; }
short max_step() { return d_max_step; }
@@ -170,4 +172,4 @@ private:
gr_vector_void_star &output_items);
};
-#endif /* INCLUDED_CVSD_ENCODE_SB_H */
+#endif /* INCLUDED_VOCODER_CVSD_ENCODE_SB_H */
diff --git a/gr-vocoder/include/vocoder_g721_decode_bs.h b/gr-vocoder/include/vocoder_g721_decode_bs.h
new file mode 100644
index 000000000..8ce3b12e5
--- /dev/null
+++ b/gr-vocoder/include/vocoder_g721_decode_bs.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_G721_DECODE_BS_H
+#define INCLUDED_VOCODER_G721_DECODE_BS_H
+
+#include <gr_sync_block.h>
+
+class vocoder_g721_decode_bs;
+
+typedef boost::shared_ptr<vocoder_g721_decode_bs> vocoder_g721_decode_bs_sptr;
+
+vocoder_g721_decode_bs_sptr vocoder_make_g721_decode_bs();
+
+/*!
+ * \brief This block performs g721 audio decoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_g721_decode_bs : virtual public gr_sync_block
+{
+};
+
+#endif /* INCLUDED_VOCODER_G721_DECODE_BS_H */
diff --git a/gr-vocoder/include/vocoder_g721_encode_sb.h b/gr-vocoder/include/vocoder_g721_encode_sb.h
new file mode 100644
index 000000000..5af980640
--- /dev/null
+++ b/gr-vocoder/include/vocoder_g721_encode_sb.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_G721_ENCODE_SB_H
+#define INCLUDED_VOCODER_G721_ENCODE_SB_H
+
+#include <gr_sync_block.h>
+
+class vocoder_g721_encode_sb;
+
+typedef boost::shared_ptr<vocoder_g721_encode_sb> vocoder_g721_encode_sb_sptr;
+
+vocoder_g721_encode_sb_sptr vocoder_make_g721_encode_sb();
+
+/*!
+ * \brief This block performs g721 audio encoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_g721_encode_sb : virtual public gr_sync_block
+{
+};
+
+#endif /* INCLUDED_VOCODER_G721_ENCODE_SB_H */
diff --git a/gr-vocoder/include/vocoder_g723_24_decode_bs.h b/gr-vocoder/include/vocoder_g723_24_decode_bs.h
new file mode 100644
index 000000000..8ca94f253
--- /dev/null
+++ b/gr-vocoder/include/vocoder_g723_24_decode_bs.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_G723_24_DECODE_BS_H
+#define INCLUDED_VOCODER_G723_24_DECODE_BS_H
+
+#include <gr_sync_block.h>
+
+class vocoder_g723_24_decode_bs;
+
+typedef boost::shared_ptr<vocoder_g723_24_decode_bs> vocoder_g723_24_decode_bs_sptr;
+
+vocoder_g723_24_decode_bs_sptr vocoder_make_g723_24_decode_bs();
+
+/*!
+ * \brief This block performs g723_24 audio decoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_g723_24_decode_bs : virtual public gr_sync_block
+{
+};
+
+#endif /* INCLUDED_VOCODER_G723_24_DECODE_BS_H */
diff --git a/gr-vocoder/include/vocoder_g723_24_encode_sb.h b/gr-vocoder/include/vocoder_g723_24_encode_sb.h
new file mode 100644
index 000000000..b55229980
--- /dev/null
+++ b/gr-vocoder/include/vocoder_g723_24_encode_sb.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_G723_24_ENCODE_SB_H
+#define INCLUDED_VOCODER_G723_24_ENCODE_SB_H
+
+#include <gr_sync_block.h>
+
+class vocoder_g723_24_encode_sb;
+
+typedef boost::shared_ptr<vocoder_g723_24_encode_sb> vocoder_g723_24_encode_sb_sptr;
+
+vocoder_g723_24_encode_sb_sptr vocoder_make_g723_24_encode_sb();
+
+/*!
+ * \brief This block performs g723_24 audio encoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_g723_24_encode_sb : virtual public gr_sync_block
+{
+};
+
+#endif /* INCLUDED_VOCODER_G723_24_ENCODE_SB_H */
diff --git a/gr-vocoder/include/vocoder_g723_40_decode_bs.h b/gr-vocoder/include/vocoder_g723_40_decode_bs.h
new file mode 100644
index 000000000..2299b8806
--- /dev/null
+++ b/gr-vocoder/include/vocoder_g723_40_decode_bs.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_G723_40_DECODE_BS_H
+#define INCLUDED_VOCODER_G723_40_DECODE_BS_H
+
+#include <gr_sync_block.h>
+
+class vocoder_g723_40_decode_bs;
+
+typedef boost::shared_ptr<vocoder_g723_40_decode_bs> vocoder_g723_40_decode_bs_sptr;
+
+vocoder_g723_40_decode_bs_sptr vocoder_make_g723_40_decode_bs();
+
+/*!
+ * \brief This block performs g723_40 audio decoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_g723_40_decode_bs : virtual public gr_sync_block
+{
+};
+
+#endif /* INCLUDED_VOCODER_G723_40_DECODE_BS_H */
diff --git a/gr-vocoder/include/vocoder_g723_40_encode_sb.h b/gr-vocoder/include/vocoder_g723_40_encode_sb.h
new file mode 100644
index 000000000..f349cf425
--- /dev/null
+++ b/gr-vocoder/include/vocoder_g723_40_encode_sb.h
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_G723_40_ENCODE_SB_H
+#define INCLUDED_VOCODER_G723_40_ENCODE_SB_H
+
+#include <gr_sync_block.h>
+
+class vocoder_g723_40_encode_sb;
+
+typedef boost::shared_ptr<vocoder_g723_40_encode_sb> vocoder_g723_40_encode_sb_sptr;
+
+vocoder_g723_40_encode_sb_sptr vocoder_make_g723_40_encode_sb();
+
+/*!
+ * \brief This block performs g723_40 audio encoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_g723_40_encode_sb : virtual public gr_sync_block
+{
+};
+
+#endif /* INCLUDED_VOCODER_G723_40_ENCODE_SB_H */
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.h b/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h
index 8002c2ce3..4c6248d39 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.h
+++ b/gr-vocoder/include/vocoder_gsm_fr_decode_ps.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,32 +19,33 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GSM_FR_DECODE_PS_H
-#define INCLUDED_GSM_FR_DECODE_PS_H
+
+#ifndef INCLUDED_VOCODER_GSM_FR_DECODE_PS_H
+#define INCLUDED_VOCODER_GSM_FR_DECODE_PS_H
#include <gr_sync_interpolator.h>
-class gsm_fr_decode_ps;
-typedef boost::shared_ptr<gsm_fr_decode_ps> gsm_fr_decode_ps_sptr;
+class vocoder_gsm_fr_decode_ps;
+typedef boost::shared_ptr<vocoder_gsm_fr_decode_ps> vocoder_gsm_fr_decode_ps_sptr;
-gsm_fr_decode_ps_sptr gsm_fr_make_decode_ps ();
+vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps ();
/*!
* \brief GSM 06.10 Full Rate Vocoder Decoder
* \ingroup vocoder_blk
*/
-class gsm_fr_decode_ps : public gr_sync_interpolator {
+class vocoder_gsm_fr_decode_ps : public gr_sync_interpolator {
struct gsm_state *d_gsm;
- friend gsm_fr_decode_ps_sptr gsm_fr_make_decode_ps ();
- gsm_fr_decode_ps ();
+ friend vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps ();
+ vocoder_gsm_fr_decode_ps ();
public:
- ~gsm_fr_decode_ps ();
+ ~vocoder_gsm_fr_decode_ps ();
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
-#endif /* INCLUDED_GSM_FR_DECODE_PS_H */
+#endif /* INCLUDED_VOCODER_GSM_FR_DECODE_PS_H */
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.h b/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h
index f158a3d02..d1803c82e 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.h
+++ b/gr-vocoder/include/vocoder_gsm_fr_encode_sp.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005 Free Software Foundation, Inc.
+ * Copyright 2005,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -19,15 +19,16 @@
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
-#ifndef INCLUDED_GSM_FR_ENCODE_SP_H
-#define INCLUDED_GSM_FR_ENCODE_SP_H
+
+#ifndef INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H
+#define INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H
#include <gr_sync_decimator.h>
-class gsm_fr_encode_sp;
-typedef boost::shared_ptr<gsm_fr_encode_sp> gsm_fr_encode_sp_sptr;
+class vocoder_gsm_fr_encode_sp;
+typedef boost::shared_ptr<vocoder_gsm_fr_encode_sp> vocoder_gsm_fr_encode_sp_sptr;
-gsm_fr_encode_sp_sptr gsm_fr_make_encode_sp ();
+vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp ();
/*!
* \brief GSM 06.10 Full Rate Vocoder Encoder
@@ -35,18 +36,18 @@ gsm_fr_encode_sp_sptr gsm_fr_make_encode_sp ();
*
* shorts in; 33 byte packets out
*/
-class gsm_fr_encode_sp : public gr_sync_decimator {
+class vocoder_gsm_fr_encode_sp : public gr_sync_decimator {
struct gsm_state *d_gsm;
- friend gsm_fr_encode_sp_sptr gsm_fr_make_encode_sp ();
- gsm_fr_encode_sp ();
+ friend vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp ();
+ vocoder_gsm_fr_encode_sp ();
public:
- ~gsm_fr_encode_sp ();
+ ~vocoder_gsm_fr_encode_sp ();
int work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
-#endif /* INCLUDED_GSM_FR_ENCODE_SP_H */
+#endif /* INCLUDED_VOCODER_GSM_FR_ENCODE_SP_H */
diff --git a/gr-vocoder/include/vocoder_ulaw_decode_bs.h b/gr-vocoder/include/vocoder_ulaw_decode_bs.h
new file mode 100644
index 000000000..1126c6cb3
--- /dev/null
+++ b/gr-vocoder/include/vocoder_ulaw_decode_bs.h
@@ -0,0 +1,55 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_ULAW_DECODE_BS_H
+#define INCLUDED_VOCODER_ULAW_DECODE_BS_H
+
+#include <gr_sync_block.h>
+
+class vocoder_ulaw_decode_bs;
+
+typedef boost::shared_ptr<vocoder_ulaw_decode_bs> vocoder_ulaw_decode_bs_sptr;
+
+vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs();
+
+/*!
+ * \brief This block performs ulaw audio decoding.
+ *
+ * \ingroup vocoder_blk
+ */
+
+class vocoder_ulaw_decode_bs : public gr_sync_block
+{
+private:
+ friend vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs();
+
+ vocoder_ulaw_decode_bs();
+
+ public:
+ ~vocoder_ulaw_decode_bs();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_VOCODER_ULAW_DECODE_BS_H */
diff --git a/gr-vocoder/include/vocoder_ulaw_encode_sb.h b/gr-vocoder/include/vocoder_ulaw_encode_sb.h
new file mode 100644
index 000000000..eddc4f4e5
--- /dev/null
+++ b/gr-vocoder/include/vocoder_ulaw_encode_sb.h
@@ -0,0 +1,54 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifndef INCLUDED_VOCODER_ULAW_ENCODER_SB_H
+#define INCLUDED_VOCODER_ULAW_ENCODER_SB_H
+
+#include <gr_sync_block.h>
+
+class vocoder_ulaw_encode_sb;
+
+typedef boost::shared_ptr<vocoder_ulaw_encode_sb> vocoder_ulaw_encode_sb_sptr;
+
+vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb();
+
+/*!
+ * \brief This block performs g.711 ulaw audio encoding.
+ *
+ * \ingroup vocoder_blk
+ */
+class vocoder_ulaw_encode_sb : public gr_sync_block
+{
+private:
+ friend vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb();
+
+ vocoder_ulaw_encode_sb();
+
+ public:
+ ~vocoder_ulaw_encode_sb();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+};
+
+#endif /* INCLUDED_VOCODER_ULAW_ENCODE_SB_H */
diff --git a/gcell/lib/general/spu/.gitignore b/gr-vocoder/lib/.gitignore
index 3531485fb..d2e2e9ce8 100644
--- a/gcell/lib/general/spu/.gitignore
+++ b/gr-vocoder/lib/.gitignore
@@ -1,8 +1,7 @@
/Makefile
/Makefile.in
-/.deps
/.libs
-/*.la
-/*.lo
-/*.a
-/*.o
+/.deps
+/gnuradio
+/guile
+/python
diff --git a/gr-vocoder/lib/Makefile.am b/gr-vocoder/lib/Makefile.am
new file mode 100644
index 000000000..158347ffe
--- /dev/null
+++ b/gr-vocoder/lib/Makefile.am
@@ -0,0 +1,55 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+SUBDIRS = codec2 g7xx gsm .
+
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES) \
+ -I$(top_srcdir)/gr-vocoder/include
+
+lib_LTLIBRARIES = libgnuradio-vocoder.la
+
+libgnuradio_vocoder_la_SOURCES = \
+ vocoder_alaw_decode_bs.cc \
+ vocoder_alaw_encode_sb.cc \
+ vocoder_codec2_decode_ps.cc \
+ vocoder_codec2_encode_sp.cc \
+ vocoder_cvsd_decode_bs.cc \
+ vocoder_cvsd_encode_sb.cc \
+ vocoder_g721_decode_bs.cc \
+ vocoder_g721_encode_sb.cc \
+ vocoder_g723_24_decode_bs.cc \
+ vocoder_g723_24_encode_sb.cc \
+ vocoder_g723_40_decode_bs.cc \
+ vocoder_g723_40_encode_sb.cc \
+ vocoder_gsm_fr_decode_ps.cc \
+ vocoder_gsm_fr_encode_sp.cc \
+ vocoder_ulaw_decode_bs.cc \
+ vocoder_ulaw_encode_sb.cc
+
+libgnuradio_vocoder_la_LIBADD = \
+ $(GNURADIO_CORE_LA) \
+ codec2/libcodec2.la \
+ g7xx/libg7xx.la \
+ gsm/libgsm.la
+
+libgnuradio_vocoder_la_LDFLAGS = $(NO_UNDEFINED) $(LTVERSIONFLAGS)
diff --git a/gr-gpio/src/fpga/rbf/.gitignore b/gr-vocoder/lib/codec2/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-gpio/src/fpga/rbf/.gitignore
+++ b/gr-vocoder/lib/codec2/.gitignore
diff --git a/gr-vocoder/lib/codec2/Makefile.am b/gr-vocoder/lib/codec2/Makefile.am
new file mode 100644
index 000000000..ae2094eff
--- /dev/null
+++ b/gr-vocoder/lib/codec2/Makefile.am
@@ -0,0 +1,125 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+
+AM_CFLAGS = -fPIC -O3
+
+# Helper program to create codebook source
+noinst_PROGRAMS = generate_codebook
+generate_codebook_LDFLAGS = -lm
+
+# lsp quantisers
+CODEBOOKS= \
+ $(srcdir)/codebook/lsp1.txt \
+ $(srcdir)/codebook/lsp2.txt \
+ $(srcdir)/codebook/lsp3.txt \
+ $(srcdir)/codebook/lsp4.txt \
+ $(srcdir)/codebook/lsp5.txt \
+ $(srcdir)/codebook/lsp6.txt \
+ $(srcdir)/codebook/lsp7.txt \
+ $(srcdir)/codebook/lsp8.txt \
+ $(srcdir)/codebook/lsp9.txt \
+ $(srcdir)/codebook/lsp10.txt
+
+# lspd quantisers
+CODEBOOKSD= \
+ $(srcdir)/codebook/dlsp1.txt \
+ $(srcdir)/codebook/dlsp2.txt \
+ $(srcdir)/codebook/dlsp3.txt \
+ $(srcdir)/codebook/dlsp4.txt \
+ $(srcdir)/codebook/dlsp5.txt \
+ $(srcdir)/codebook/dlsp6.txt \
+ $(srcdir)/codebook/dlsp7.txt \
+ $(srcdir)/codebook/dlsp8.txt \
+ $(srcdir)/codebook/dlsp9.txt \
+ $(srcdir)/codebook/dlsp10.txt
+
+# lspd VQ quantisers
+CODEBOOKSDVQ= \
+ $(srcdir)/codebook/dlsp1.txt \
+ $(srcdir)/codebook/dlsp2.txt \
+ $(srcdir)/codebook/dlsp3.txt \
+ $(srcdir)/codebook/dlsp4.txt \
+ $(srcdir)/codebook/dlsp5.txt
+
+# Generate codebook sources from text files
+GENERATED_C = \
+ codebook.c \
+ codebookd.c \
+ codebookdvq.c
+
+BUILT_SOURCES += $(GENERATED_C)
+
+codebook.c: $(builddir)/generate_codebook $(CODEBOOKS)
+ $(builddir)/generate_codebook lsp_cb $(CODEBOOKS) > codebook.c
+
+codebookd.c: $(builddir)/generate_codebook $(CODEBOOKSD)
+ $(builddir)/generate_codebook lsp_cbd $(CODEBOOKSD) > codebookd.c
+
+codebookdvq.c: $(builddir)/generate_codebook $(CODEBOOKSDVQ)
+ $(builddir)/generate_codebook lsp_cbdvq $(CODEBOOKSDVQ) > codebookdvq.c
+
+# Convenience library for linking into blocks
+noinst_LTLIBRARIES = libcodec2.la
+
+libcodec2_la_CFLAGS = $(AM_CFLAGS)
+
+libcodec2_la_SOURCES = \
+ dump.c \
+ lpc.c \
+ nlp.c \
+ postfilter.c \
+ sine.c \
+ codec2.c \
+ fft.c \
+ kiss_fft.c \
+ interp.c \
+ lsp.c \
+ phase.c \
+ quantise.c \
+ pack.c \
+ $(GENERATED_C)
+
+# Evil inclusion of glottal.c by phase.c
+EXTRA_DIST += glottal.c
+
+# Headers used locally but not installed in system
+noinst_HEADERS = \
+ codec2.h \
+ codec2_internal.h \
+ defines.h \
+ kiss_fft.h\
+ _kiss_fft_guts.h \
+ fft.h \
+ interp.h \
+ lsp.h \
+ phase.h \
+ quantise.h \
+ comp.h \
+ dump.h \
+ lpc.h \
+ nlp.h \
+ postfilter.h \
+ sine.h
+
+EXTRA_DIST += $(CODEBOOKS) $(CODEBOOKSD) $(CODEBOOKSDVQ)
+
diff --git a/gr-vocoder/lib/codec2/_kiss_fft_guts.h b/gr-vocoder/lib/codec2/_kiss_fft_guts.h
new file mode 100644
index 000000000..ba6614440
--- /dev/null
+++ b/gr-vocoder/lib/codec2/_kiss_fft_guts.h
@@ -0,0 +1,164 @@
+/*
+Copyright (c) 2003-2010, Mark Borgerding
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/* kiss_fft.h
+ defines kiss_fft_scalar as either short or a float type
+ and defines
+ typedef struct { kiss_fft_scalar r; kiss_fft_scalar i; }kiss_fft_cpx; */
+#include "kiss_fft.h"
+#include <limits.h>
+
+#define MAXFACTORS 32
+/* e.g. an fft of length 128 has 4 factors
+ as far as kissfft is concerned
+ 4*4*4*2
+ */
+
+struct kiss_fft_state{
+ int nfft;
+ int inverse;
+ int factors[2*MAXFACTORS];
+ kiss_fft_cpx twiddles[1];
+};
+
+/*
+ Explanation of macros dealing with complex math:
+
+ C_MUL(m,a,b) : m = a*b
+ C_FIXDIV( c , div ) : if a fixed point impl., c /= div. noop otherwise
+ C_SUB( res, a,b) : res = a - b
+ C_SUBFROM( res , a) : res -= a
+ C_ADDTO( res , a) : res += a
+ * */
+#ifdef FIXED_POINT
+#if (FIXED_POINT==32)
+# define FRACBITS 31
+# define SAMPPROD int64_t
+#define SAMP_MAX 2147483647
+#else
+# define FRACBITS 15
+# define SAMPPROD int32_t
+#define SAMP_MAX 32767
+#endif
+
+#define SAMP_MIN -SAMP_MAX
+
+#if defined(CHECK_OVERFLOW)
+# define CHECK_OVERFLOW_OP(a,op,b) \
+ if ( (SAMPPROD)(a) op (SAMPPROD)(b) > SAMP_MAX || (SAMPPROD)(a) op (SAMPPROD)(b) < SAMP_MIN ) { \
+ fprintf(stderr,"WARNING:overflow @ " __FILE__ "(%d): (%d " #op" %d) = %ld\n",__LINE__,(a),(b),(SAMPPROD)(a) op (SAMPPROD)(b) ); }
+#endif
+
+
+# define smul(a,b) ( (SAMPPROD)(a)*(b) )
+# define sround( x ) (kiss_fft_scalar)( ( (x) + (1<<(FRACBITS-1)) ) >> FRACBITS )
+
+# define S_MUL(a,b) sround( smul(a,b) )
+
+# define C_MUL(m,a,b) \
+ do{ (m).r = sround( smul((a).r,(b).r) - smul((a).i,(b).i) ); \
+ (m).i = sround( smul((a).r,(b).i) + smul((a).i,(b).r) ); }while(0)
+
+# define DIVSCALAR(x,k) \
+ (x) = sround( smul( x, SAMP_MAX/k ) )
+
+# define C_FIXDIV(c,div) \
+ do { DIVSCALAR( (c).r , div); \
+ DIVSCALAR( (c).i , div); }while (0)
+
+# define C_MULBYSCALAR( c, s ) \
+ do{ (c).r = sround( smul( (c).r , s ) ) ;\
+ (c).i = sround( smul( (c).i , s ) ) ; }while(0)
+
+#else /* not FIXED_POINT*/
+
+# define S_MUL(a,b) ( (a)*(b) )
+#define C_MUL(m,a,b) \
+ do{ (m).r = (a).r*(b).r - (a).i*(b).i;\
+ (m).i = (a).r*(b).i + (a).i*(b).r; }while(0)
+# define C_FIXDIV(c,div) /* NOOP */
+# define C_MULBYSCALAR( c, s ) \
+ do{ (c).r *= (s);\
+ (c).i *= (s); }while(0)
+#endif
+
+#ifndef CHECK_OVERFLOW_OP
+# define CHECK_OVERFLOW_OP(a,op,b) /* noop */
+#endif
+
+#define C_ADD( res, a,b)\
+ do { \
+ CHECK_OVERFLOW_OP((a).r,+,(b).r)\
+ CHECK_OVERFLOW_OP((a).i,+,(b).i)\
+ (res).r=(a).r+(b).r; (res).i=(a).i+(b).i; \
+ }while(0)
+#define C_SUB( res, a,b)\
+ do { \
+ CHECK_OVERFLOW_OP((a).r,-,(b).r)\
+ CHECK_OVERFLOW_OP((a).i,-,(b).i)\
+ (res).r=(a).r-(b).r; (res).i=(a).i-(b).i; \
+ }while(0)
+#define C_ADDTO( res , a)\
+ do { \
+ CHECK_OVERFLOW_OP((res).r,+,(a).r)\
+ CHECK_OVERFLOW_OP((res).i,+,(a).i)\
+ (res).r += (a).r; (res).i += (a).i;\
+ }while(0)
+
+#define C_SUBFROM( res , a)\
+ do {\
+ CHECK_OVERFLOW_OP((res).r,-,(a).r)\
+ CHECK_OVERFLOW_OP((res).i,-,(a).i)\
+ (res).r -= (a).r; (res).i -= (a).i; \
+ }while(0)
+
+
+#ifdef FIXED_POINT
+# define KISS_FFT_COS(phase) floor(.5+SAMP_MAX * cos (phase))
+# define KISS_FFT_SIN(phase) floor(.5+SAMP_MAX * sin (phase))
+# define HALF_OF(x) ((x)>>1)
+#elif defined(USE_SIMD)
+# define KISS_FFT_COS(phase) _mm_set1_ps( cos(phase) )
+# define KISS_FFT_SIN(phase) _mm_set1_ps( sin(phase) )
+# define HALF_OF(x) ((x)*_mm_set1_ps(.5))
+#else
+# define KISS_FFT_COS(phase) (kiss_fft_scalar) cos(phase)
+# define KISS_FFT_SIN(phase) (kiss_fft_scalar) sin(phase)
+# define HALF_OF(x) ((x)*.5)
+#endif
+
+#define kf_cexp(x,phase) \
+ do{ \
+ (x)->r = KISS_FFT_COS(phase);\
+ (x)->i = KISS_FFT_SIN(phase);\
+ }while(0)
+
+
+/* a debugging function */
+#define pcpx(c)\
+ fprintf(stderr,"%g + %gi\n",(double)((c)->r),(double)((c)->i) )
+
+
+#ifdef KISS_FFT_USE_ALLOCA
+// define this to allow use of alloca instead of malloc for temporary buffers
+// Temporary buffers are used in two case:
+// 1. FFT sizes that have "bad" factors. i.e. not 2,3 and 5
+// 2. "in-place" FFTs. Notice the quotes, since kissfft does not really do an in-place transform.
+#include <alloca.h>
+#define KISS_FFT_TMP_ALLOC(nbytes) alloca(nbytes)
+#define KISS_FFT_TMP_FREE(ptr)
+#else
+#define KISS_FFT_TMP_ALLOC(nbytes) KISS_FFT_MALLOC(nbytes)
+#define KISS_FFT_TMP_FREE(ptr) KISS_FFT_FREE(ptr)
+#endif
diff --git a/gr-vocoder/lib/codec2/c2dec.c b/gr-vocoder/lib/codec2/c2dec.c
new file mode 100644
index 000000000..b866d04d6
--- /dev/null
+++ b/gr-vocoder/lib/codec2/c2dec.c
@@ -0,0 +1,82 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: c2dec.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/8/2010
+
+ Decodes a file of bits to a file of raw speech samples using codec2.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2010 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "codec2.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#define BITS_SIZE ((CODEC2_BITS_PER_FRAME + 7) / 8)
+
+int main(int argc, char *argv[])
+{
+ void *codec2;
+ FILE *fin;
+ FILE *fout;
+ short buf[CODEC2_SAMPLES_PER_FRAME];
+ unsigned char bits[BITS_SIZE];
+
+ if (argc != 3) {
+ printf("usage: %s InputBitFile OutputRawSpeechFile\n", argv[0]);
+ exit(1);
+ }
+
+ if (strcmp(argv[1], "-") == 0) fin = stdin;
+ else if ( (fin = fopen(argv[1],"rb")) == NULL ) {
+ fprintf(stderr, "Error opening input bit file: %s: %s.\n",
+ argv[1], strerror(errno));
+ exit(1);
+ }
+
+ if (strcmp(argv[2], "-") == 0) fout = stdout;
+ else if ( (fout = fopen(argv[2],"wb")) == NULL ) {
+ fprintf(stderr, "Error opening output speech file: %s: %s.\n",
+ argv[2], strerror(errno));
+ exit(1);
+ }
+
+ codec2 = codec2_create();
+
+ while(fread(bits, sizeof(char), BITS_SIZE, fin) == BITS_SIZE) {
+ codec2_decode(codec2, buf, bits);
+ fwrite(buf, sizeof(short), CODEC2_SAMPLES_PER_FRAME, fout);
+ //if this is in a pipeline, we probably don't want the usual
+ //buffering to occur
+ if (fout == stdout) fflush(stdout);
+ if (fin == stdin) fflush(stdin);
+
+ }
+
+ codec2_destroy(codec2);
+
+ fclose(fin);
+ fclose(fout);
+
+ return 0;
+}
diff --git a/gr-vocoder/lib/codec2/c2demo.c b/gr-vocoder/lib/codec2/c2demo.c
new file mode 100644
index 000000000..efa8d6449
--- /dev/null
+++ b/gr-vocoder/lib/codec2/c2demo.c
@@ -0,0 +1,86 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: c2demo.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 15/11/2010
+
+ Encodes and decodes a file of raw speech samples using Codec 2.
+ Demonstrates use of Codec 2 function API.
+
+ Note to convert a wave file to raw and vice-versa:
+
+ $ sox file.wav -r 8000 -s -2 file.raw
+ $ sox -r 8000 -s -2 file.raw file.wav
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2010 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "codec2.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#define BITS_SIZE ((CODEC2_BITS_PER_FRAME + 7) / 8)
+
+int main(int argc, char *argv[])
+{
+ void *codec2;
+ FILE *fin;
+ FILE *fout;
+ short buf[CODEC2_SAMPLES_PER_FRAME];
+ unsigned char bits[BITS_SIZE];
+
+ if (argc != 3) {
+ printf("usage: %s InputRawSpeechFile OutputRawSpeechFile\n", argv[0]);
+ exit(1);
+ }
+
+ if ( (fin = fopen(argv[1],"rb")) == NULL ) {
+ fprintf(stderr, "Error opening input speech file: %s: %s.\n",
+ argv[1], strerror(errno));
+ exit(1);
+ }
+
+ if ( (fout = fopen(argv[2],"wb")) == NULL ) {
+ fprintf(stderr, "Error opening output speech file: %s: %s.\n",
+ argv[2], strerror(errno));
+ exit(1);
+ }
+
+ /* Note only one set of Codec 2 states is required for an encoder
+ and decoder pair. */
+
+ codec2 = codec2_create();
+
+ while(fread(buf, sizeof(short), CODEC2_SAMPLES_PER_FRAME, fin) ==
+ CODEC2_SAMPLES_PER_FRAME) {
+ codec2_encode(codec2, bits, buf);
+ codec2_decode(codec2, buf, bits);
+ fwrite(buf, sizeof(short), CODEC2_SAMPLES_PER_FRAME, fout);
+ }
+
+ codec2_destroy(codec2);
+
+ fclose(fin);
+ fclose(fout);
+
+ return 0;
+}
diff --git a/gr-vocoder/lib/codec2/c2enc.c b/gr-vocoder/lib/codec2/c2enc.c
new file mode 100644
index 000000000..4d1d019df
--- /dev/null
+++ b/gr-vocoder/lib/codec2/c2enc.c
@@ -0,0 +1,83 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: c2enc.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/8/2010
+
+ Encodes a file of raw speech samples using codec2 and outputs a file
+ of bits.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2010 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "codec2.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+#define BITS_SIZE ((CODEC2_BITS_PER_FRAME + 7) / 8)
+
+int main(int argc, char *argv[])
+{
+ void *codec2;
+ FILE *fin;
+ FILE *fout;
+ short buf[CODEC2_SAMPLES_PER_FRAME];
+ unsigned char bits[BITS_SIZE];
+
+ if (argc != 3) {
+ printf("usage: %s InputRawspeechFile OutputBitFile\n", argv[0]);
+ exit(1);
+ }
+
+ if (strcmp(argv[1], "-") == 0) fin = stdin;
+ else if ( (fin = fopen(argv[1],"rb")) == NULL ) {
+ fprintf(stderr, "Error opening input bit file: %s: %s.\n",
+ argv[1], strerror(errno));
+ exit(1);
+ }
+
+ if (strcmp(argv[2], "-") == 0) fout = stdout;
+ else if ( (fout = fopen(argv[2],"wb")) == NULL ) {
+ fprintf(stderr, "Error opening output speech file: %s: %s.\n",
+ argv[2], strerror(errno));
+ exit(1);
+ }
+
+ codec2 = codec2_create();
+
+ while(fread(buf, sizeof(short), CODEC2_SAMPLES_PER_FRAME, fin) ==
+ CODEC2_SAMPLES_PER_FRAME) {
+ codec2_encode(codec2, bits, buf);
+ fwrite(bits, sizeof(char), BITS_SIZE, fout);
+ //if this is in a pipeline, we probably don't want the usual
+ //buffering to occur
+ if (fout == stdout) fflush(stdout);
+ if (fin == stdin) fflush(stdin);
+ }
+
+ codec2_destroy(codec2);
+
+ fclose(fin);
+ fclose(fout);
+
+ return 0;
+}
diff --git a/gr-vocoder/lib/codec2/c2sim.c b/gr-vocoder/lib/codec2/c2sim.c
new file mode 100644
index 000000000..bb49c7899
--- /dev/null
+++ b/gr-vocoder/lib/codec2/c2sim.c
@@ -0,0 +1,469 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: c2sim.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 20/8/2010
+
+ Codec2 simulation. Combines encoder and decoder and allows switching in
+ out various algorithms and quantisation steps.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+
+#include "defines.h"
+#include "sine.h"
+#include "nlp.h"
+#include "dump.h"
+#include "lpc.h"
+#include "lsp.h"
+#include "quantise.h"
+#include "phase.h"
+#include "postfilter.h"
+#include "interp.h"
+
+/*---------------------------------------------------------------------------*\
+
+ switch_present()
+
+ Searches the command line arguments for a "switch". If the switch is
+ found, returns the command line argument where it ws found, else returns
+ NULL.
+
+\*---------------------------------------------------------------------------*/
+
+int switch_present(sw,argc,argv)
+register char sw[]; /* switch in string form */
+register int argc; /* number of command line arguments */
+register char *argv[]; /* array of command line arguments in string form */
+{
+ register int i; /* loop variable */
+
+ for(i=1; i<argc; i++)
+ if (!strcmp(sw,argv[i]))
+ return(i);
+
+ return 0;
+}
+
+void synth_one_frame(short buf[], MODEL *model, float Sn_[], float Pn[]);
+
+/*---------------------------------------------------------------------------*\
+
+ MAIN
+
+\*---------------------------------------------------------------------------*/
+
+int main(int argc, char *argv[])
+{
+ FILE *fout; /* output speech file */
+ FILE *fin; /* input speech file */
+ short buf[N]; /* input/output buffer */
+ float Sn[M]; /* float input speech samples */
+ COMP Sw[FFT_ENC]; /* DFT of Sn[] */
+ float w[M]; /* time domain hamming window */
+ COMP W[FFT_ENC]; /* DFT of w[] */
+ MODEL model;
+ float Pn[2*N]; /* trapezoidal synthesis window */
+ float Sn_[2*N]; /* synthesised speech */
+ int i; /* loop variable */
+ int frames;
+ float prev_Wo;
+ float pitch;
+ int voiced1 = 0;
+
+ char out_file[MAX_STR];
+ int arg;
+ float snr;
+ float sum_snr;
+
+ int lpc_model, order = LPC_ORD;
+ int lsp, lspd, lspdvq, lsp_quantiser;
+ float ak[LPC_MAX];
+ COMP Sw_[FFT_ENC];
+ COMP Ew[FFT_ENC];
+
+ int dump;
+
+ int phase0;
+ float ex_phase[MAX_AMP+1];
+
+ int postfilt;
+ float bg_est;
+
+ int hand_voicing;
+ FILE *fvoicing = 0;
+
+ MODEL prev_model, interp_model;
+ int decimate;
+ float lsps[LPC_ORD];
+ float prev_lsps[LPC_ORD];
+ float e, prev_e;
+ float ak_interp[LPC_MAX];
+
+ void *nlp_states;
+ float hpf_states[2];
+ int resample;
+ float AresdB_prev[MAX_AMP];
+
+ for(i=0; i<MAX_AMP; i++)
+ AresdB_prev[i] = 0.0;
+
+ for(i=0; i<M; i++)
+ Sn[i] = 1.0;
+ for(i=0; i<2*N; i++)
+ Sn_[i] = 0;
+
+ prev_Wo = TWO_PI/P_MAX;
+
+ prev_model.Wo = TWO_PI/P_MIN;
+ prev_model.L = floor(PI/prev_model.Wo);
+ for(i=1; i<=prev_model.L; i++) {
+ prev_model.A[i] = 0.0;
+ prev_model.phi[i] = 0.0;
+ }
+ for(i=1; i<=MAX_AMP; i++) {
+ ex_phase[i] = 0.0;
+ }
+ for(i=0; i<LPC_ORD; i++) {
+ prev_lsps[i] = i*PI/(LPC_ORD+1);
+ }
+ e = prev_e = 1;
+ hpf_states[0] = hpf_states[1] = 0.0;
+
+ nlp_states = nlp_create();
+
+ if (argc < 2) {
+ fprintf(stderr, "\nCodec2 - 2400 bit/s speech codec - Simulation Program\n"
+ "\thttp://rowetel.com/codec2.html\n\n"
+ "usage: %s InputFile [-o OutputFile]\n"
+ "\t[--lpc Order]\n"
+ "\t[--lsp]\n"
+ "\t[--lspd]\n"
+ "\t[--lspdvq]\n"
+ "\t[--phase0]\n"
+ "\t[--postfilter]\n"
+ "\t[--hand_voicing]\n"
+ "\t[--dec]\n"
+ "\t[--dump DumpFilePrefix]\n", argv[0]);
+ exit(1);
+ }
+
+ /* Interpret command line arguments -------------------------------------*/
+
+ /* Input file */
+
+ if ((fin = fopen(argv[1],"rb")) == NULL) {
+ fprintf(stderr, "Error opening input speech file: %s: %s.\n",
+ argv[1], strerror(errno));
+ exit(1);
+ }
+
+ /* Output file */
+
+ if ((arg = switch_present("-o",argc,argv))) {
+ if ((fout = fopen(argv[arg+1],"wb")) == NULL) {
+ fprintf(stderr, "Error opening output speech file: %s: %s.\n",
+ argv[arg+1], strerror(errno));
+ exit(1);
+ }
+ strcpy(out_file,argv[arg+1]);
+ }
+ else
+ fout = NULL;
+
+ lpc_model = 0;
+ if ((arg = switch_present("--lpc",argc,argv))) {
+ lpc_model = 1;
+ order = atoi(argv[arg+1]);
+ if ((order < 4) || (order > 20)) {
+ fprintf(stderr, "Error in lpc order: %d\n", order);
+ exit(1);
+ }
+ }
+
+ dump = switch_present("--dump",argc,argv);
+#ifdef DUMP
+ if (dump)
+ dump_on(argv[dump+1]);
+#endif
+
+ lsp = switch_present("--lsp",argc,argv);
+ lsp_quantiser = 0;
+ if (lsp)
+ assert(order == LPC_ORD);
+
+ lspd = switch_present("--lspd",argc,argv);
+ if (lspd)
+ assert(order == LPC_ORD);
+
+ lspdvq = switch_present("--lspdvq",argc,argv);
+ if (lspdvq)
+ assert(order == LPC_ORD);
+
+ phase0 = switch_present("--phase0",argc,argv);
+ if (phase0) {
+ ex_phase[0] = 0;
+ }
+
+ hand_voicing = switch_present("--hand_voicing",argc,argv);
+ if (hand_voicing) {
+ fvoicing = fopen(argv[hand_voicing+1],"rt");
+ assert(fvoicing != NULL);
+ }
+
+ bg_est = 0.0;
+ postfilt = switch_present("--postfilter",argc,argv);
+
+ decimate = switch_present("--dec",argc,argv);
+
+ arg = switch_present("--resample",argc,argv);
+ resample = atoi(argv[arg+1]);
+
+ /* Initialise ------------------------------------------------------------*/
+
+ make_analysis_window(w,W);
+ make_synthesis_window(Pn);
+ quantise_init();
+
+ /* Main loop ------------------------------------------------------------*/
+
+ frames = 0;
+ sum_snr = 0;
+ while(fread(buf,sizeof(short),N,fin)) {
+ frames++;
+ //printf("frame: %d", frames);
+
+ /* Read input speech */
+
+ for(i=0; i<M-N; i++)
+ Sn[i] = Sn[i+N];
+ for(i=0; i<N; i++) {
+ //Sn[i+M-N] = hpf((float)buf[i], hpf_states);
+ Sn[i+M-N] = (float)buf[i];
+ }
+
+ /* Estimate pitch */
+
+ nlp(nlp_states,Sn,N,M,P_MIN,P_MAX,&pitch,Sw,&prev_Wo);
+ model.Wo = TWO_PI/pitch;
+
+ /* estimate model parameters */
+
+ dft_speech(Sw, Sn, w);
+ two_stage_pitch_refinement(&model, Sw);
+ estimate_amplitudes(&model, Sw, W);
+#ifdef DUMP
+ dump_Sn(Sn); dump_Sw(Sw); dump_model(&model);
+#endif
+
+ /* optional zero-phase modelling */
+
+ if (phase0) {
+ float Wn[M]; /* windowed speech samples */
+ float Rk[LPC_MAX+1]; /* autocorrelation coeffs */
+
+#ifdef DUMP
+ dump_phase(&model.phi[0], model.L);
+#endif
+
+ /* find aks here, these are overwritten if LPC modelling is enabled */
+
+ for(i=0; i<M; i++)
+ Wn[i] = Sn[i]*w[i];
+ autocorrelate(Wn,Rk,M,order);
+ levinson_durbin(Rk,ak,order);
+
+#ifdef DUMP
+ dump_ak(ak, LPC_ORD);
+#endif
+
+ /* determine voicing */
+
+ snr = est_voicing_mbe(&model, Sw, W, Sw_, Ew, prev_Wo);
+#ifdef DUMP
+ dump_Sw_(Sw_);
+ dump_Ew(Ew);
+ dump_snr(snr);
+#endif
+
+ /* just to make sure we are not cheating - kill all phases */
+
+ for(i=0; i<MAX_AMP; i++)
+ model.phi[i] = 0;
+
+ if (hand_voicing) {
+ fscanf(fvoicing,"%d\n",&model.voiced);
+ }
+ }
+
+ /* optional LPC model amplitudes */
+
+ if (lpc_model) {
+ int lsp_indexes[LPC_MAX];
+
+ e = speech_to_uq_lsps(lsps, ak, Sn, w, order);
+
+ if (lsp) {
+ encode_lsps(lsp_indexes, lsps, LPC_ORD);
+ decode_lsps(lsps, lsp_indexes, LPC_ORD);
+ bw_expand_lsps(lsps, LPC_ORD);
+ lsp_to_lpc(lsps, ak, LPC_ORD);
+ }
+
+ if (lspd) {
+ float lsps_[LPC_ORD];
+
+ lspd_quantise(lsps, lsps_, LPC_ORD);
+ lsp_to_lpc(lsps_, ak, LPC_ORD);
+ }
+
+ if (lspdvq) {
+ float lsps_[LPC_ORD];
+
+ lspdvq_quantise(lsps, lsps_, LPC_ORD);
+ lsp_to_lpc(lsps_, ak, LPC_ORD);
+ }
+
+ e = decode_energy(encode_energy(e));
+ model.Wo = decode_Wo(encode_Wo(model.Wo));
+
+ aks_to_M2(ak, order, &model, e, &snr, 1);
+ apply_lpc_correction(&model);
+ sum_snr += snr;
+#ifdef DUMP
+ dump_quantised_model(&model);
+#endif
+ }
+
+ /* optional resampling of model amplitudes */
+
+ printf("frames=%d\n", frames);
+ if (resample) {
+ snr = resample_amp_nl(&model, resample, AresdB_prev);
+ sum_snr += snr;
+#ifdef DUMP
+ dump_quantised_model(&model);
+#endif
+ }
+
+ /* option decimation to 20ms rate, which enables interpolation
+ routine to synthesise in between frame */
+
+ if (decimate) {
+ if (!phase0) {
+ printf("needs --phase0 to resample phase for interpolated Wo\n");
+ exit(0);
+ }
+ if (!lpc_model) {
+ printf("needs --lpc 10 to resample amplitudes\n");
+ exit(0);
+ }
+
+ /* odd frame - interpolate */
+
+ if (frames%2) {
+
+ interp_model.voiced = voiced1;
+
+ #ifdef LOG_LIN_INTERP
+ interpolate(&interp_model, &prev_model, &model);
+ #else
+ interpolate_lsp(&interp_model, &prev_model, &model,
+ prev_lsps, prev_e, lsps, e, ak_interp);
+ apply_lpc_correction(&interp_model);
+ #endif
+
+ if (phase0)
+ phase_synth_zero_order(&interp_model, ak_interp, ex_phase,
+ order);
+ if (postfilt)
+ postfilter(&interp_model, &bg_est);
+ synth_one_frame(buf, &interp_model, Sn_, Pn);
+ if (fout != NULL) fwrite(buf,sizeof(short),N,fout);
+
+ if (phase0)
+ phase_synth_zero_order(&model, ak, ex_phase, order);
+ if (postfilt)
+ postfilter(&model, &bg_est);
+ synth_one_frame(buf, &model, Sn_, Pn);
+ if (fout != NULL) fwrite(buf,sizeof(short),N,fout);
+
+ prev_model = model;
+ for(i=0; i<LPC_ORD; i++)
+ prev_lsps[i] = lsps[i];
+ prev_e = e;
+ }
+ else {
+ voiced1 = model.voiced;
+ }
+ }
+ else {
+ if (phase0)
+ phase_synth_zero_order(&model, ak, ex_phase, order);
+ if (postfilt)
+ postfilter(&model, &bg_est);
+ synth_one_frame(buf, &model, Sn_, Pn);
+ if (fout != NULL) fwrite(buf,sizeof(short),N,fout);
+ }
+ prev_Wo = TWO_PI/pitch;
+ }
+ fclose(fin);
+
+ if (fout != NULL)
+ fclose(fout);
+
+ if (lpc_model || resample)
+ printf("SNR av = %5.2f dB\n", sum_snr/frames);
+
+#ifdef DUMP
+ if (dump)
+ dump_off();
+#endif
+
+ if (hand_voicing)
+ fclose(fvoicing);
+
+ nlp_destroy(nlp_states);
+
+ return 0;
+}
+
+void synth_one_frame(short buf[], MODEL *model, float Sn_[], float Pn[])
+{
+ int i;
+
+ synthesise(Sn_, model, Pn, 1);
+
+ for(i=0; i<N; i++) {
+ if (Sn_[i] > 32767.0)
+ buf[i] = 32767;
+ else if (Sn_[i] < -32767.0)
+ buf[i] = -32767;
+ else
+ buf[i] = Sn_[i];
+ }
+
+}
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp1.txt b/gr-vocoder/lib/codec2/codebook/dlsp1.txt
new file mode 100644
index 000000000..d126be771
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp1.txt
@@ -0,0 +1,17 @@
+1 16
+225
+250
+275
+300
+325
+350
+375
+400
+425
+450
+475
+500
+525
+550
+575
+600
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp10.txt b/gr-vocoder/lib/codec2/codebook/dlsp10.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp10.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp2.txt b/gr-vocoder/lib/codec2/codebook/dlsp2.txt
new file mode 100644
index 000000000..234bf2067
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp2.txt
@@ -0,0 +1,17 @@
+1 16
+25
+50
+75
+100
+125
+150
+175
+200
+225
+250
+275
+300
+325
+350
+375
+400
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp3.txt b/gr-vocoder/lib/codec2/codebook/dlsp3.txt
new file mode 100644
index 000000000..b2ee06da4
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp3.txt
@@ -0,0 +1,9 @@
+1 8
+50
+75
+100
+120
+150
+250
+350
+450
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp4.txt b/gr-vocoder/lib/codec2/codebook/dlsp4.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp4.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp5.txt b/gr-vocoder/lib/codec2/codebook/dlsp5.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp5.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp6.txt b/gr-vocoder/lib/codec2/codebook/dlsp6.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp6.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp7.txt b/gr-vocoder/lib/codec2/codebook/dlsp7.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp7.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp8.txt b/gr-vocoder/lib/codec2/codebook/dlsp8.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp8.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/dlsp9.txt b/gr-vocoder/lib/codec2/codebook/dlsp9.txt
new file mode 100644
index 000000000..dea9dd9d8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/dlsp9.txt
@@ -0,0 +1,9 @@
+1 8
+50
+100
+200
+300
+425
+550
+675
+800
diff --git a/gr-vocoder/lib/codec2/codebook/lsp1.txt b/gr-vocoder/lib/codec2/codebook/lsp1.txt
new file mode 100644
index 000000000..d126be771
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp1.txt
@@ -0,0 +1,17 @@
+1 16
+225
+250
+275
+300
+325
+350
+375
+400
+425
+450
+475
+500
+525
+550
+575
+600
diff --git a/gr-vocoder/lib/codec2/codebook/lsp10.txt b/gr-vocoder/lib/codec2/codebook/lsp10.txt
new file mode 100644
index 000000000..39aab7c56
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp10.txt
@@ -0,0 +1,6 @@
+1 4
+2900
+3100
+3300
+3500
+
diff --git a/gr-vocoder/lib/codec2/codebook/lsp2.txt b/gr-vocoder/lib/codec2/codebook/lsp2.txt
new file mode 100644
index 000000000..597f14965
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp2.txt
@@ -0,0 +1,17 @@
+1 16
+325
+350
+375
+400
+425
+450
+475
+500
+525
+550
+575
+600
+625
+650
+675
+700
diff --git a/gr-vocoder/lib/codec2/codebook/lsp3.txt b/gr-vocoder/lib/codec2/codebook/lsp3.txt
new file mode 100644
index 000000000..36a64b158
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp3.txt
@@ -0,0 +1,17 @@
+1 16
+500
+550
+600
+650
+700
+750
+800
+850
+900
+950
+1000
+1050
+1100
+1150
+1200
+1250
diff --git a/gr-vocoder/lib/codec2/codebook/lsp4.txt b/gr-vocoder/lib/codec2/codebook/lsp4.txt
new file mode 100644
index 000000000..53a90bd8c
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp4.txt
@@ -0,0 +1,17 @@
+1 16
+700
+800
+900
+1000
+1100
+1200
+1300
+1400
+1500
+1600
+1700
+1800
+1900
+2000
+2100
+2200
diff --git a/gr-vocoder/lib/codec2/codebook/lsp5.txt b/gr-vocoder/lib/codec2/codebook/lsp5.txt
new file mode 100644
index 000000000..94739b56e
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp5.txt
@@ -0,0 +1,19 @@
+1 16
+ 950
+1050
+1150
+1250
+1350
+1450
+1550
+1650
+1750
+1850
+1950
+2050
+2150
+2250
+2350
+2450
+
+
diff --git a/gr-vocoder/lib/codec2/codebook/lsp6.txt b/gr-vocoder/lib/codec2/codebook/lsp6.txt
new file mode 100644
index 000000000..992ea25c5
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp6.txt
@@ -0,0 +1,19 @@
+1 16
+1100
+1200
+1300
+1400
+1500
+1600
+1700
+1800
+1900
+2000
+2100
+2200
+2300
+2400
+2500
+2600
+
+
diff --git a/gr-vocoder/lib/codec2/codebook/lsp7.txt b/gr-vocoder/lib/codec2/codebook/lsp7.txt
new file mode 100644
index 000000000..839cbfdd5
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp7.txt
@@ -0,0 +1,19 @@
+1 16
+1500
+1600
+1700
+1800
+1900
+2000
+2100
+2200
+2300
+2400
+2500
+2600
+2700
+2800
+2900
+3000
+
+
diff --git a/gr-vocoder/lib/codec2/codebook/lsp8.txt b/gr-vocoder/lib/codec2/codebook/lsp8.txt
new file mode 100644
index 000000000..d9880c94e
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp8.txt
@@ -0,0 +1,11 @@
+1 8
+2300
+2400
+2500
+2600
+2700
+2800
+2900
+3000
+
+
diff --git a/gr-vocoder/lib/codec2/codebook/lsp8910.txt b/gr-vocoder/lib/codec2/codebook/lsp8910.txt
new file mode 100644
index 000000000..93cfdd81d
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp8910.txt
@@ -0,0 +1,65 @@
+3 64
+2.048073 2.534502 2.645915
+2.019670 2.269744 2.605462
+1.961101 2.329646 2.562857
+1.968573 2.532712 2.616918
+2.183480 2.514381 2.629582
+2.259379 2.516615 2.620410
+2.172791 2.462460 2.567064
+2.097666 2.303933 2.421685
+2.052990 2.353242 2.546992
+2.043642 2.232362 2.499262
+2.106151 2.393131 2.488401
+2.099167 2.437862 2.558655
+2.013877 2.422875 2.530071
+2.033848 2.483776 2.584598
+2.114474 2.516856 2.602372
+2.229214 2.584056 2.678855
+2.131151 2.584299 2.674845
+1.472721 2.477091 2.630241
+2.010907 2.598415 2.682989
+2.353653 2.524066 2.619773
+2.419897 2.623938 2.699605
+2.319080 2.602148 2.689044
+1.860342 2.503881 2.616576
+1.910517 2.386693 2.610126
+1.748689 2.371809 2.496542
+1.618495 2.403425 2.554956
+1.844073 2.437026 2.533443
+1.924810 2.388543 2.502698
+1.937227 2.258363 2.501697
+1.687554 2.209123 2.545239
+1.851950 2.278628 2.565632
+1.868154 2.330150 2.444883
+1.874180 2.213118 2.351940
+1.757311 2.030626 2.433836
+1.650306 2.152371 2.243421
+1.612794 1.884686 2.339313
+1.745431 2.278895 2.389449
+1.590923 2.304155 2.408510
+1.475982 2.275548 2.509897
+1.508695 2.045463 2.455520
+1.872054 2.061777 2.246202
+1.983947 2.159155 2.445535
+1.745180 2.483765 2.593698
+1.900116 2.079600 2.407479
+1.841672 2.167042 2.486827
+1.932912 2.148464 2.569850
+2.134174 2.363673 2.584252
+2.106094 2.450645 2.638417
+1.954135 2.460313 2.666512
+1.907634 2.573801 2.674025
+1.625579 2.539569 2.656363
+1.785866 2.572616 2.676082
+1.798447 2.376454 2.624298
+2.020033 2.397244 2.619868
+1.946581 2.468791 2.564185
+2.008920 2.342400 2.469132
+1.983846 2.271044 2.395408
+1.988039 2.154150 2.317920
+2.077197 2.216622 2.389101
+2.117255 2.283907 2.512242
+2.177233 2.334622 2.458268
+2.214655 2.425510 2.620013
+2.199931 2.390272 2.520731
+2.271755 2.448682 2.552649
diff --git a/gr-vocoder/lib/codec2/codebook/lsp9.txt b/gr-vocoder/lib/codec2/codebook/lsp9.txt
new file mode 100644
index 000000000..7e159af2f
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codebook/lsp9.txt
@@ -0,0 +1,11 @@
+1 8
+2500
+2600
+2700
+2800
+2900
+3000
+3100
+3200
+
+
diff --git a/gr-vocoder/lib/codec2/codec2.c b/gr-vocoder/lib/codec2/codec2.c
new file mode 100644
index 000000000..92708ee32
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codec2.c
@@ -0,0 +1,342 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: codec2.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 21/8/2010
+
+ Codec2 fully quantised encoder and decoder functions. If you want use
+ codec2, the codec2_xxx functions are for you.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2010 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "defines.h"
+#include "sine.h"
+#include "nlp.h"
+#include "dump.h"
+#include "lpc.h"
+#include "quantise.h"
+#include "phase.h"
+#include "interp.h"
+#include "postfilter.h"
+#include "codec2.h"
+#include "codec2_internal.h"
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTIONS
+
+\*---------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: codec2_create
+ AUTHOR......: David Rowe
+ DATE CREATED: 21/8/2010
+
+ Create and initialise an instance of the codec. Returns a pointer
+ to the codec states or NULL on failure. One set of states is
+ sufficient for a full duuplex codec (i.e. an encoder and decoder).
+ You don't need separate states for encoders and decoders. See
+ c2enc.c and c2dec.c for examples.
+
+\*---------------------------------------------------------------------------*/
+
+void *codec2_create()
+{
+ CODEC2 *c2;
+ int i,l;
+
+ c2 = (CODEC2*)malloc(sizeof(CODEC2));
+ if (c2 == NULL)
+ return NULL;
+
+ for(i=0; i<M; i++)
+ c2->Sn[i] = 1.0;
+ c2->hpf_states[0] = c2->hpf_states[1] = 0.0;
+ for(i=0; i<2*N; i++)
+ c2->Sn_[i] = 0;
+ make_analysis_window(c2->w,c2->W);
+ make_synthesis_window(c2->Pn);
+ quantise_init();
+ c2->prev_Wo = 0.0;
+ c2->bg_est = 0.0;
+ c2->ex_phase = 0.0;
+
+ for(l=1; l<MAX_AMP; l++)
+ c2->prev_model.A[l] = 0.0;
+ c2->prev_model.Wo = TWO_PI/P_MAX;
+ c2->prev_model.L = PI/c2->prev_model.Wo;
+ c2->prev_model.voiced = 0;
+
+ for(i=0; i<LPC_ORD; i++) {
+ c2->prev_lsps[i] = i*PI/(LPC_ORD+1);
+ }
+ c2->prev_energy = 1;
+
+ c2->nlp = nlp_create();
+ if (c2->nlp == NULL) {
+ free (c2);
+ return NULL;
+ }
+
+ return (void*)c2;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: codec2_create
+ AUTHOR......: David Rowe
+ DATE CREATED: 21/8/2010
+
+ Destroy an instance of the codec.
+
+\*---------------------------------------------------------------------------*/
+
+void codec2_destroy(void *codec2_state)
+{
+ CODEC2 *c2;
+
+ assert(codec2_state != NULL);
+ c2 = (CODEC2*)codec2_state;
+ nlp_destroy(c2->nlp);
+ free(codec2_state);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: codec2_encode
+ AUTHOR......: David Rowe
+ DATE CREATED: 21/8/2010
+
+ Encodes 160 speech samples (20ms of speech) into 51 bits.
+
+ The codec2 algorithm actually operates internally on 10ms (80
+ sample) frames, so we run the encoding algorithm twice. On the
+ first frame we just send the voicing bit. One the second frame we
+ send all model parameters.
+
+ The bit allocation is:
+
+ Parameter bits/frame
+ --------------------------------------
+ Harmonic magnitudes (LSPs) 36
+ Low frequency LPC correction 1
+ Energy 5
+ Wo (fundamental frequnecy) 7
+ Voicing (10ms update) 2
+ TOTAL 51
+
+\*---------------------------------------------------------------------------*/
+
+void codec2_encode(void *codec2_state, unsigned char * bits, short speech[])
+{
+ CODEC2 *c2;
+ MODEL model;
+ int voiced1, voiced2;
+ int lsp_indexes[LPC_ORD];
+ int energy_index;
+ int Wo_index;
+ int i;
+ unsigned int nbit = 0;
+
+ assert(codec2_state != NULL);
+ c2 = (CODEC2*)codec2_state;
+
+ /* first 10ms analysis frame - we just want voicing */
+
+ analyse_one_frame(c2, &model, speech);
+ voiced1 = model.voiced;
+
+ /* second 10ms analysis frame */
+
+ analyse_one_frame(c2, &model, &speech[N]);
+ voiced2 = model.voiced;
+
+ Wo_index = encode_Wo(model.Wo);
+ encode_amplitudes(lsp_indexes,
+ &energy_index,
+ &model,
+ c2->Sn,
+ c2->w);
+ memset(bits, '\0', ((CODEC2_BITS_PER_FRAME + 7) / 8));
+ pack(bits, &nbit, Wo_index, WO_BITS);
+ for(i=0; i<LPC_ORD; i++) {
+ pack(bits, &nbit, lsp_indexes[i], lsp_bits(i));
+ }
+ pack(bits, &nbit, energy_index, E_BITS);
+ pack(bits, &nbit, voiced1, 1);
+ pack(bits, &nbit, voiced2, 1);
+
+ assert(nbit == CODEC2_BITS_PER_FRAME);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: codec2_decode
+ AUTHOR......: David Rowe
+ DATE CREATED: 21/8/2010
+
+ Decodes frames of 51 bits into 160 samples (20ms) of speech.
+
+\*---------------------------------------------------------------------------*/
+
+void codec2_decode(void *codec2_state, short speech[],
+ const unsigned char * bits)
+{
+ CODEC2 *c2;
+ MODEL model;
+ int voiced1, voiced2;
+ int lsp_indexes[LPC_ORD];
+ float lsps[LPC_ORD];
+ int energy_index;
+ float energy;
+ int Wo_index;
+ float ak[LPC_ORD+1];
+ float ak_interp[LPC_ORD+1];
+ int i;
+ unsigned int nbit = 0;
+ MODEL model_interp;
+
+ assert(codec2_state != NULL);
+ c2 = (CODEC2*)codec2_state;
+
+ /* unpack bit stream to integer codes */
+
+ Wo_index = unpack(bits, &nbit, WO_BITS);
+ for(i=0; i<LPC_ORD; i++) {
+ lsp_indexes[i] = unpack(bits, &nbit, lsp_bits(i));
+ }
+ energy_index = unpack(bits, &nbit, E_BITS);
+ voiced1 = unpack(bits, &nbit, 1);
+ voiced2 = unpack(bits, &nbit, 1);
+ assert(nbit == CODEC2_BITS_PER_FRAME);
+
+ /* decode integer codes to model parameters */
+
+ model.Wo = decode_Wo(Wo_index);
+ model.L = PI/model.Wo;
+ memset(&model.A, 0, (model.L+1)*sizeof(model.A[0]));
+ decode_amplitudes(&model,
+ ak,
+ lsp_indexes,
+ energy_index,
+ lsps,
+ &energy);
+
+ model.voiced = voiced2;
+ model_interp.voiced = voiced1;
+ model_interp.Wo = P_MAX/2;
+ memset(&model_interp.A, 0, MAX_AMP*sizeof(model_interp.A[0]));
+
+ /* interpolate middle frame's model parameters for adjacent frames */
+
+ interpolate_lsp(&model_interp, &c2->prev_model, &model,
+ c2->prev_lsps, c2->prev_energy, lsps, energy, ak_interp);
+ apply_lpc_correction(&model_interp);
+
+ /* synthesis two 10ms frames */
+
+ synthesise_one_frame(c2, speech, &model_interp, ak_interp);
+ synthesise_one_frame(c2, &speech[N], &model, ak);
+
+ /* update memories (decode states) for next time */
+
+ memcpy(&c2->prev_model, &model, sizeof(MODEL));
+ memcpy(c2->prev_lsps, lsps, sizeof(lsps));
+ c2->prev_energy = energy;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: synthesise_one_frame()
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/8/2010
+
+ Synthesise 80 speech samples (10ms) from model parameters.
+
+\*---------------------------------------------------------------------------*/
+
+void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model, float ak[])
+{
+ int i;
+
+ phase_synth_zero_order(model, ak, &c2->ex_phase, LPC_ORD);
+ postfilter(model, &c2->bg_est);
+ synthesise(c2->Sn_, model, c2->Pn, 1);
+
+ for(i=0; i<N; i++) {
+ if (c2->Sn_[i] > 32767.0)
+ speech[i] = 32767;
+ else if (c2->Sn_[i] < -32767.0)
+ speech[i] = -32767;
+ else
+ speech[i] = c2->Sn_[i];
+ }
+
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: analyse_one_frame()
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/8/2010
+
+ Extract sinusoidal model parameters from 80 speech samples (10ms of
+ speech).
+
+\*---------------------------------------------------------------------------*/
+
+void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[])
+{
+ COMP Sw[FFT_ENC];
+ COMP Sw_[FFT_ENC];
+ COMP Ew[FFT_ENC];
+ float pitch;
+ int i;
+
+ /* Read input speech */
+
+ for(i=0; i<M-N; i++)
+ c2->Sn[i] = c2->Sn[i+N];
+ for(i=0; i<N; i++)
+ c2->Sn[i+M-N] = speech[i];
+
+ dft_speech(Sw, c2->Sn, c2->w);
+
+ /* Estimate pitch */
+
+ nlp(c2->nlp,c2->Sn,N,M,P_MIN,P_MAX,&pitch,Sw,&c2->prev_Wo);
+ model->Wo = TWO_PI/pitch;
+ model->L = PI/model->Wo;
+
+ /* estimate model parameters */
+
+ two_stage_pitch_refinement(model, Sw);
+ estimate_amplitudes(model, Sw, c2->W);
+ est_voicing_mbe(model, Sw, c2->W, Sw_, Ew, c2->prev_Wo);
+
+ c2->prev_Wo = model->Wo;
+}
diff --git a/gr-vocoder/lib/codec2/codec2.h b/gr-vocoder/lib/codec2/codec2.h
new file mode 100644
index 000000000..946dedca5
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codec2.h
@@ -0,0 +1,41 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: codec2.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 21/8/2010
+
+ Codec2 fully quantised encoder and decoder functions. If you want use
+ codec2, these are the functions you need to call.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2010 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CODEC2__
+#define __CODEC2__
+
+#define CODEC2_SAMPLES_PER_FRAME 160
+#define CODEC2_BITS_PER_FRAME 50
+
+void *codec2_create();
+void codec2_destroy(void *codec2_state);
+void codec2_encode(void *codec2_state, unsigned char * bits, short speech_in[]);
+void codec2_decode(void *codec2_state, short speech_out[],
+ const unsigned char * bits);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/codec2_internal.h b/gr-vocoder/lib/codec2/codec2_internal.h
new file mode 100644
index 000000000..3943ac29d
--- /dev/null
+++ b/gr-vocoder/lib/codec2/codec2_internal.h
@@ -0,0 +1,63 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: codec2_internal.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 22 March 2011
+
+ Some internal structures and states broken out here as they are useful for
+ testing and development.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2011 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __CODEC2_INTERNAL__
+#define __CODEC2_INTERNAL__
+
+/*---------------------------------------------------------------------------*\
+
+ STATES
+
+\*---------------------------------------------------------------------------*/
+
+typedef struct {
+ float w[M]; /* time domain hamming window */
+ COMP W[FFT_ENC]; /* DFT of w[] */
+ float Pn[2*N]; /* trapezoidal synthesis window */
+ float Sn[M]; /* input speech */
+ float hpf_states[2]; /* high pass filter states */
+ void *nlp; /* pitch predictor states */
+ float Sn_[2*N]; /* synthesised output speech */
+ float ex_phase; /* excitation model phase track */
+ float bg_est; /* background noise estimate for post filter */
+ float prev_Wo; /* previous frame's pitch estimate */
+ MODEL prev_model; /* previous frame's model parameters */
+ float prev_lsps[LPC_ORD]; /* previous frame's LSPs */
+ float prev_energy; /* previous frame's LPC energy */
+} CODEC2;
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION HEADERS
+
+\*---------------------------------------------------------------------------*/
+
+void analyse_one_frame(CODEC2 *c2, MODEL *model, short speech[]);
+void synthesise_one_frame(CODEC2 *c2, short speech[], MODEL *model,float ak[]);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/comp.h b/gr-vocoder/lib/codec2/comp.h
new file mode 100644
index 000000000..cedcab37f
--- /dev/null
+++ b/gr-vocoder/lib/codec2/comp.h
@@ -0,0 +1,38 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: comp.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/08/09
+
+ Complex number definition.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __COMP__
+#define __COMP__
+
+/* Complex number */
+
+typedef struct {
+ float real;
+ float imag;
+} COMP;
+
+#endif
diff --git a/gr-vocoder/lib/codec2/defines.h b/gr-vocoder/lib/codec2/defines.h
new file mode 100644
index 000000000..2dcd527d3
--- /dev/null
+++ b/gr-vocoder/lib/codec2/defines.h
@@ -0,0 +1,88 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: defines.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/4/93
+
+ Defines and structures used throughout the codec.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __DEFINES__
+#define __DEFINES__
+
+/*---------------------------------------------------------------------------*\
+
+ DEFINES
+
+\*---------------------------------------------------------------------------*/
+
+/* General defines */
+
+#define N 80 /* number of samples per frame */
+#define MAX_AMP 80 /* maximum number of harmonics */
+#define PI 3.141592654 /* mathematical constant */
+#define TWO_PI 6.283185307 /* mathematical constant */
+#define FS 8000 /* sample rate in Hz */
+#define MAX_STR 256 /* maximum string size */
+
+#define NW 279 /* analysis window size */
+#define FFT_ENC 512 /* size of FFT used for encoder */
+#define FFT_DEC 512 /* size of FFT used in decoder */
+#define TW 40 /* Trapezoidal synthesis window overlap */
+#define V_THRESH 6.0 /* voicing threshold in dB */
+#define LPC_MAX 20 /* maximum LPC order */
+#define LPC_ORD 10 /* phase modelling LPC order */
+
+/* Pitch estimation defines */
+
+#define M 320 /* pitch analysis frame size */
+#define P_MIN 20 /* minimum pitch */
+#define P_MAX 160 /* maximum pitch */
+
+/*---------------------------------------------------------------------------*\
+
+ TYPEDEFS
+
+\*---------------------------------------------------------------------------*/
+
+/* Structure to hold model parameters for one frame */
+
+typedef struct {
+ float Wo; /* fundamental frequency estimate in radians */
+ int L; /* number of harmonics */
+ float A[MAX_AMP]; /* amplitiude of each harmonic */
+ float phi[MAX_AMP]; /* phase of each harmonic */
+ int voiced; /* non-zero if this frame is voiced */
+} MODEL;
+
+/* describes each codebook */
+
+struct lsp_codebook {
+ int k; /* dimension of vector */
+ int log2m; /* number of bits in m */
+ int m; /* elements in codebook */
+ const float * cb; /* The elements */
+};
+extern const struct lsp_codebook lsp_cb[];
+extern const struct lsp_codebook lsp_cbd[];
+extern const struct lsp_codebook lsp_cbdvq[];
+
+#endif
diff --git a/gr-vocoder/lib/codec2/dump.c b/gr-vocoder/lib/codec2/dump.c
new file mode 100644
index 000000000..73a378e23
--- /dev/null
+++ b/gr-vocoder/lib/codec2/dump.c
@@ -0,0 +1,469 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: dump.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 25/8/09
+
+ Routines to dump data to text files for Octave analysis.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "defines.h"
+#include "comp.h"
+#include "dump.h"
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#ifdef DUMP
+static int dumpon = 0;
+
+static FILE *fsn = NULL;
+static FILE *fsw = NULL;
+static FILE *few = NULL;
+static FILE *fsw_ = NULL;
+static FILE *fmodel = NULL;
+static FILE *fqmodel = NULL;
+static FILE *fpw = NULL;
+static FILE *flsp = NULL;
+static FILE *fphase = NULL;
+static FILE *fphase_ = NULL;
+static FILE *ffw = NULL;
+static FILE *fe = NULL;
+static FILE *fsq = NULL;
+static FILE *fdec = NULL;
+static FILE *fsnr = NULL;
+static FILE *fak = NULL;
+static FILE *fbg = NULL;
+static FILE *fE = NULL;
+static FILE *frk = NULL;
+static FILE *fres = NULL;
+
+static char prefix[MAX_STR];
+
+void dump_on(char p[]) {
+ dumpon = 1;
+ strcpy(prefix, p);
+}
+
+void dump_off(){
+ if (fsn != NULL)
+ fclose(fsn);
+ if (fsw != NULL)
+ fclose(fsw);
+ if (fsw_ != NULL)
+ fclose(fsw_);
+ if (few != NULL)
+ fclose(few);
+ if (fmodel != NULL)
+ fclose(fmodel);
+ if (fqmodel != NULL)
+ fclose(fqmodel);
+ if (fpw != NULL)
+ fclose(fpw);
+ if (flsp != NULL)
+ fclose(flsp);
+ if (fphase != NULL)
+ fclose(fphase);
+ if (fphase_ != NULL)
+ fclose(fphase_);
+ if (ffw != NULL)
+ fclose(ffw);
+ if (fe != NULL)
+ fclose(fe);
+ if (fsq != NULL)
+ fclose(fsq);
+ if (fdec != NULL)
+ fclose(fdec);
+ if (fsnr != NULL)
+ fclose(fsnr);
+ if (fak != NULL)
+ fclose(fak);
+ if (fbg != NULL)
+ fclose(fbg);
+ if (fE != NULL)
+ fclose(fE);
+ if (frk != NULL)
+ fclose(frk);
+ if (fres != NULL)
+ fclose(fres);
+}
+
+void dump_Sn(float Sn[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fsn == NULL) {
+ sprintf(s,"%s_sn.txt", prefix);
+ fsn = fopen(s, "wt");
+ assert(fsn != NULL);
+ }
+
+ /* split across two lines to avoid max line length problems */
+ /* reconstruct in Octave */
+
+ for(i=0; i<M/2; i++)
+ fprintf(fsn,"%f\t",Sn[i]);
+ fprintf(fsn,"\n");
+ for(i=M/2; i<M; i++)
+ fprintf(fsn,"%f\t",Sn[i]);
+ fprintf(fsn,"\n");
+}
+
+void dump_Sw(COMP Sw[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fsw == NULL) {
+ sprintf(s,"%s_sw.txt", prefix);
+ fsw = fopen(s, "wt");
+ assert(fsw != NULL);
+ }
+
+ for(i=0; i<FFT_ENC/2; i++)
+ fprintf(fsw,"%f\t",
+ 10.0*log10(Sw[i].real*Sw[i].real + Sw[i].imag*Sw[i].imag));
+ fprintf(fsw,"\n");
+}
+
+void dump_Sw_(COMP Sw_[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fsw_ == NULL) {
+ sprintf(s,"%s_sw_.txt", prefix);
+ fsw_ = fopen(s, "wt");
+ assert(fsw_ != NULL);
+ }
+
+ for(i=0; i<FFT_ENC/2; i++)
+ fprintf(fsw_,"%f\t",
+ 10.0*log10(Sw_[i].real*Sw_[i].real + Sw_[i].imag*Sw_[i].imag));
+ fprintf(fsw_,"\n");
+}
+
+void dump_Ew(COMP Ew[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (few == NULL) {
+ sprintf(s,"%s_ew.txt", prefix);
+ few = fopen(s, "wt");
+ assert(few != NULL);
+ }
+
+ for(i=0; i<FFT_ENC/2; i++)
+ fprintf(few,"%f\t",
+ 10.0*log10(Ew[i].real*Ew[i].real + Ew[i].imag*Ew[i].imag));
+ fprintf(few,"\n");
+}
+
+void dump_model(MODEL *model) {
+ int l;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fmodel == NULL) {
+ sprintf(s,"%s_model.txt", prefix);
+ fmodel = fopen(s, "wt");
+ assert(fmodel != NULL);
+ }
+
+ fprintf(fmodel,"%f\t%d\t", model->Wo, model->L);
+ for(l=1; l<=model->L; l++)
+ fprintf(fmodel,"%f\t",model->A[l]);
+ for(l=model->L+1; l<MAX_AMP; l++)
+ fprintf(fmodel,"0.0\t");
+ fprintf(fmodel,"%d\t",model->voiced);
+ fprintf(fmodel,"\n");
+}
+
+void dump_quantised_model(MODEL *model) {
+ int l;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fqmodel == NULL) {
+ sprintf(s,"%s_qmodel.txt", prefix);
+ fqmodel = fopen(s, "wt");
+ assert(fqmodel != NULL);
+ }
+
+ fprintf(fqmodel,"%f\t%d\t", model->Wo, model->L);
+ for(l=1; l<=model->L; l++)
+ fprintf(fqmodel,"%f\t",model->A[l]);
+ for(l=model->L+1; l<MAX_AMP; l++)
+ fprintf(fqmodel,"0.0\t");
+ fprintf(fqmodel,"\n");
+}
+
+void dump_resample(float w[], float A[], int n) {
+ int l;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fres == NULL) {
+ sprintf(s,"%s_res.txt", prefix);
+ fres = fopen(s, "wt");
+ assert(fres != NULL);
+ }
+
+ fprintf(fres,"%d\t",n);
+ for(l=0; l<n; l++)
+ fprintf(fres,"%f\t",w[l]);
+ for(l=0; l<n; l++)
+ fprintf(fres,"%f\t",A[l]);
+ fprintf(fres,"\n");
+}
+
+void dump_phase(float phase[], int L) {
+ int l;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fphase == NULL) {
+ sprintf(s,"%s_phase.txt", prefix);
+ fphase = fopen(s, "wt");
+ assert(fphase != NULL);
+ }
+
+ for(l=1; l<=L; l++)
+ fprintf(fphase,"%f\t",phase[l]);
+ for(l=L+1; l<MAX_AMP; l++)
+ fprintf(fphase,"%f\t",0.0);
+ fprintf(fphase,"\n");
+}
+
+void dump_phase_(float phase_[], int L) {
+ int l;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fphase_ == NULL) {
+ sprintf(s,"%s_phase_.txt", prefix);
+ fphase_ = fopen(s, "wt");
+ assert(fphase_ != NULL);
+ }
+
+ for(l=1; l<=L; l++)
+ fprintf(fphase_,"%f\t",phase_[l]);
+ for(l=L+1; l<MAX_AMP; l++)
+ fprintf(fphase_,"%f\t",0.0);
+ fprintf(fphase_,"\n");
+}
+
+void dump_snr(float snr) {
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fsnr == NULL) {
+ sprintf(s,"%s_snr.txt", prefix);
+ fsnr = fopen(s, "wt");
+ assert(fsnr != NULL);
+ }
+
+ fprintf(fsnr,"%f\n",snr);
+}
+
+void dump_Pw(COMP Pw[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fpw == NULL) {
+ sprintf(s,"%s_pw.txt", prefix);
+ fpw = fopen(s, "wt");
+ assert(fpw != NULL);
+ }
+
+ for(i=0; i<FFT_DEC/2; i++)
+ fprintf(fpw,"%f\t",Pw[i].real);
+ fprintf(fpw,"\n");
+}
+
+void dump_lsp(float lsp[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (flsp == NULL) {
+ sprintf(s,"%s_lsp.txt", prefix);
+ flsp = fopen(s, "wt");
+ assert(flsp != NULL);
+ }
+
+ for(i=0; i<10; i++)
+ fprintf(flsp,"%f\t",lsp[i]);
+ fprintf(flsp,"\n");
+}
+
+void dump_ak(float ak[], int order) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fak == NULL) {
+ sprintf(s,"%s_ak.txt", prefix);
+ fak = fopen(s, "wt");
+ assert(fak != NULL);
+ }
+
+ for(i=0; i<=order; i++)
+ fprintf(fak,"%f\t",ak[i]);
+ fprintf(fak,"\n");
+}
+
+void dump_Fw(COMP Fw[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (ffw == NULL) {
+ sprintf(s,"%s_fw.txt", prefix);
+ ffw = fopen(s, "wt");
+ assert(ffw != NULL);
+ }
+
+ for(i=0; i<256; i++)
+ fprintf(ffw,"%f\t",Fw[i].real);
+ fprintf(ffw,"\n");
+}
+
+void dump_e(float e_hz[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fe == NULL) {
+ sprintf(s,"%s_e.txt", prefix);
+ fe = fopen(s, "wt");
+ assert(fe != NULL);
+ }
+
+ for(i=0; i<500/2; i++)
+ fprintf(fe,"%f\t",e_hz[i]);
+ fprintf(fe,"\n");
+ for(i=500/2; i<500; i++)
+ fprintf(fe,"%f\t",e_hz[i]);
+ fprintf(fe,"\n");
+}
+
+void dump_sq(float sq[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fsq == NULL) {
+ sprintf(s,"%s_sq.txt", prefix);
+ fsq = fopen(s, "wt");
+ assert(fsq != NULL);
+ }
+
+ for(i=0; i<M/2; i++)
+ fprintf(fsq,"%f\t",sq[i]);
+ fprintf(fsq,"\n");
+ for(i=M/2; i<M; i++)
+ fprintf(fsq,"%f\t",sq[i]);
+ fprintf(fsq,"\n");
+}
+
+void dump_dec(COMP Fw[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fdec == NULL) {
+ sprintf(s,"%s_dec.txt", prefix);
+ fdec = fopen(s, "wt");
+ assert(fdec != NULL);
+ }
+
+ for(i=0; i<320/5; i++)
+ fprintf(fdec,"%f\t",Fw[i].real);
+ fprintf(fdec,"\n");
+}
+
+void dump_bg(float e, float bg_est, float percent_uv) {
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fbg == NULL) {
+ sprintf(s,"%s_bg.txt", prefix);
+ fbg = fopen(s, "wt");
+ assert(fbg != NULL);
+ }
+
+ fprintf(fbg,"%f\t%f\t%f\n", e, bg_est, percent_uv);
+}
+
+void dump_E(float E) {
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (fE == NULL) {
+ sprintf(s,"%s_E.txt", prefix);
+ fE = fopen(s, "wt");
+ assert(fE != NULL);
+ }
+
+ fprintf(fE,"%f\n", 10.0*log10(E));
+}
+
+void dump_Rk(float Rk[]) {
+ int i;
+ char s[MAX_STR];
+
+ if (!dumpon) return;
+
+ if (frk == NULL) {
+ sprintf(s,"%s_rk.txt", prefix);
+ frk = fopen(s, "wt");
+ assert(frk != NULL);
+ }
+
+ for(i=0; i<P_MAX; i++)
+ fprintf(frk,"%f\t",Rk[i]);
+ fprintf(frk,"\n");
+}
+
+#endif
diff --git a/gr-vocoder/lib/codec2/dump.h b/gr-vocoder/lib/codec2/dump.h
new file mode 100644
index 000000000..eeddd3406
--- /dev/null
+++ b/gr-vocoder/lib/codec2/dump.h
@@ -0,0 +1,67 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: dump.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 25/8/09
+
+ Routines to dump data to text files for Octave analysis.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __DUMP__
+#define __DUMP__
+
+#include "comp.h"
+
+void dump_on(char filename_prefix[]);
+void dump_off();
+
+void dump_Sn(float Sn[]);
+void dump_Sw(COMP Sw[]);
+void dump_Sw_(COMP Sw_[]);
+void dump_Ew(COMP Ew[]);
+
+/* amplitude modelling */
+
+void dump_model(MODEL *m);
+void dump_quantised_model(MODEL *m);
+void dump_Pw(COMP Pw[]);
+void dump_lsp(float lsp[]);
+void dump_ak(float ak[], int order);
+void dump_E(float E);
+void dump_resample(float w[], float A[], int n);
+
+/* phase modelling */
+
+void dump_snr(float snr);
+void dump_phase(float phase[], int L);
+void dump_phase_(float phase[], int L);
+
+/* NLP states */
+
+void dump_sq(float sq[]);
+void dump_dec(COMP Fw[]);
+void dump_Fw(COMP Fw[]);
+void dump_e(float e_hz[]);
+void dump_Rk(float Rk[]);
+
+/* post filter */
+
+void dump_bg(float e, float bg_est, float percent_uv);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/fft.c b/gr-vocoder/lib/codec2/fft.c
new file mode 100644
index 000000000..a33e4d2c8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/fft.c
@@ -0,0 +1,101 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: fft.c
+ AUTHOR......: Bruce Robertson
+ DATE CREATED: 20/11/2010
+
+ Bridging function to the kiss_fft package.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2010 Bruce Robertson
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <assert.h>
+#include "kiss_fft.h"
+
+/*---------------------------------------------------------------------------*\
+
+ GLOBALS
+
+\*---------------------------------------------------------------------------*/
+
+kiss_fft_cpx *fin;
+kiss_fft_cpx *fout;
+kiss_fft_cfg cfg_forward;
+kiss_fft_cfg cfg_reverse;
+
+/*---------------------------------------------------------------------------*\
+
+ initialize_fft(int n)
+
+ Initialisation function for kiss_fft. This assumes that all calls to fft()
+ use the same datatypes and are one arrays of the same size.
+
+\*---------------------------------------------------------------------------*/
+
+void
+initialize_fft (int n)
+{
+ fin = KISS_FFT_MALLOC (n * sizeof (kiss_fft_cpx));
+ assert(fin != NULL);
+ fout = KISS_FFT_MALLOC (n * sizeof (kiss_fft_cpx));
+ assert(fout != NULL);
+ cfg_forward = kiss_fft_alloc (n, 0, NULL, NULL);
+ assert(cfg_forward != NULL);
+ cfg_reverse = kiss_fft_alloc (n, 1, NULL, NULL);
+ assert(cfg_reverse != NULL);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ fft(float x[], int n, int isign)
+ Function that calls kiss_fft with the signature of four1 from NRC.
+
+\*---------------------------------------------------------------------------*/
+
+
+void
+fft (float x[], int n, int isign)
+{
+ int isReverse = 0;
+ int c;
+ kiss_fft_cfg cfg;
+ if (cfg_forward == NULL)
+ {
+ initialize_fft (n);
+ }
+ for (c = 0; c < n * 2; c += 2)
+ {
+ fin[c / 2].r = x[c];
+ fin[c / 2].i = -x[c + 1];
+ }
+ if (isign == -1)
+ {
+ cfg = cfg_reverse;
+ }
+ else
+ {
+ cfg = cfg_forward;
+ }
+ kiss_fft (cfg, fin, fout);
+ for (c = 0; c < n * 2; c += 2)
+ {
+ x[c] = fout[(c) / 2].r;
+ x[c + 1] = -fout[(c) / 2].i;
+ }
+}
diff --git a/gr-vocoder/lib/codec2/fft.h b/gr-vocoder/lib/codec2/fft.h
new file mode 100644
index 000000000..84c6737bd
--- /dev/null
+++ b/gr-vocoder/lib/codec2/fft.h
@@ -0,0 +1,16 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: fft.h
+ AUTHOR......: Bruce Robertson
+ DATE CREATED: 29/11/2010
+
+ Bridge between existing code and kiss_fft.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef __FFT__
+#define __FFT__
+void fft(float x[], int n, int isign);
+
+#endif /* __FFT__ */
+
diff --git a/gr-vocoder/lib/codec2/fq20.sh b/gr-vocoder/lib/codec2/fq20.sh
new file mode 100755
index 000000000..b83784b43
--- /dev/null
+++ b/gr-vocoder/lib/codec2/fq20.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# fq20.shsh
+# David Rowe 27 July 2010
+#
+# Decode a file with fully quantised codec at 20ms frame rate
+
+../src/sinedec ../raw/$1.raw $1.mdl -o $1_phase0_lsp_20_EWo2.raw --phase 0 --lpc 10 --lsp --postfilter --dec
+
diff --git a/gr-vocoder/lib/codec2/generate_codebook.c b/gr-vocoder/lib/codec2/generate_codebook.c
new file mode 100644
index 000000000..0bea80d85
--- /dev/null
+++ b/gr-vocoder/lib/codec2/generate_codebook.c
@@ -0,0 +1,179 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: generate_codebook.c
+ AUTHOR......: Bruce Perens
+ DATE CREATED: 29 Sep 2010
+
+ Generate header files containing LSP quantisers, runs at compile time.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+
+static const char usage[] =
+"Usage: %s filename array_name [filename ...]\n"
+"\tCreate C code for codebook tables.\n";
+
+static const char format[] =
+"The table format must be:\n"
+"\tTwo integers describing the dimensions of the codebook.\n"
+"\tThen, enough numbers to fill the specified dimensions.\n";
+
+static const char header[] =
+"/* THIS IS A GENERATED FILE. Edit generate_codebook.c and its input */\n\n"
+"/*\n"
+" * This intermediary file and the files that used to create it are under \n"
+" * The LGPL. See the file COPYING.\n"
+" */\n\n"
+"#include \"defines.h\"\n\n";
+
+struct codebook {
+ unsigned int k;
+ unsigned int log2m;
+ unsigned int m;
+ float * cb;
+};
+
+static void
+dump_array(const struct codebook * b, int index)
+{
+ int limit = b->k * b->m;
+ int i;
+
+ printf("static const float codes%d[] = {\n", index);
+ for ( i = 0; i < limit; i++ ) {
+ printf(" %g", b->cb[i]);
+ if ( i < limit - 1 )
+ printf(",");
+
+ /* organise VQs by rows, looks prettier */
+ if ( ((i+1) % b->k) == 0 )
+ printf("\n");
+ }
+ printf("};\n");
+}
+
+static void
+dump_structure(const struct codebook * b, int index)
+{
+ printf(" {\n");
+ printf(" %d,\n", b->k);
+ printf(" %g,\n", log(b->m) / log(2));
+ printf(" %d,\n", b->m);
+ printf(" codes%d\n", index);
+ printf(" }");
+}
+
+float
+get_float(FILE * in, const char * name, char * * cursor, char * buffer,
+ int size)
+{
+ for ( ; ; ) {
+ char * s = *cursor;
+ char c;
+
+ while ( (c = *s) != '\0' && !isdigit(c) && c != '-' && c != '.' )
+ s++;
+
+ /* Comments start with "#" and continue to the end of the line. */
+ if ( c != '\0' && c != '#' ) {
+ char * end = 0;
+ float f = 0;
+
+ f = strtod(s, &end);
+
+ if ( end != s )
+ *cursor = end;
+ return f;
+ }
+
+ if ( fgets(buffer, size, in) == NULL ) {
+ fprintf(stderr, "%s: Format error. %s\n", name, format);
+ exit(1);
+ }
+ *cursor = buffer;
+ }
+}
+
+static struct codebook *
+load(FILE * file, const char * name)
+{
+ char line[1024];
+ char * cursor = line;
+ struct codebook * b = malloc(sizeof(struct codebook));
+ int i;
+ int size;
+
+ *cursor = '\0';
+
+ b->k = (int)get_float(file, name, &cursor, line, sizeof(line));
+ b->m = (int)get_float(file, name ,&cursor, line, sizeof(line));
+ size = b->k * b->m;
+
+ b->cb = (float *)malloc(size * sizeof(float));
+
+ for ( i = 0; i < size; i++ )
+ b->cb[i] = get_float(file, name, &cursor, line, sizeof(line));
+
+ return b;
+}
+
+int
+main(int argc, char * * argv)
+{
+ struct codebook * * cb = malloc(argc * sizeof(struct codebook *));
+ int i;
+
+ if ( argc < 2 ) {
+ fprintf(stderr, usage, argv[0]);
+ fprintf(stderr, format);
+ exit(1);
+ }
+
+ for ( i = 0; i < argc - 2; i++ ) {
+ FILE * in = fopen(argv[i + 2], "r");
+
+ if ( in == NULL ) {
+ perror(argv[i + 2]);
+ exit(1);
+ }
+
+ cb[i] = load(in, argv[i + 2]);
+
+ fclose(in);
+ }
+
+ printf(header);
+ for ( i = 0; i < argc - 2; i++ ) {
+ printf(" /* %s */\n", argv[i + 2]);
+ dump_array(cb[i], i);
+ }
+ printf("\nconst struct lsp_codebook %s[] = {\n", argv[1]);
+ for ( i = 0; i < argc - 2; i++ ) {
+ printf(" /* %s */\n", argv[i + 2]);
+ dump_structure(cb[i], i);
+ printf(",\n");
+ }
+ printf(" { 0, 0, 0, 0 }\n");
+ printf("};\n");
+
+ return 0;
+}
diff --git a/gr-vocoder/lib/codec2/globals.c b/gr-vocoder/lib/codec2/globals.c
new file mode 100644
index 000000000..f2182f79a
--- /dev/null
+++ b/gr-vocoder/lib/codec2/globals.c
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: globals.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 11/5/94
+
+ Globals for sinusoidal speech coder.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "sine.h" /* global defines for coder */
+
+/* Globals used in encoder and decoder */
+
+int frames; /* number of frames processed so far */
+float Sn[M]; /* float input speech samples */
+MODEL model; /* model parameters for the current frame */
+int Nw; /* number of samples in analysis window */
+float sig; /* energy of current frame */
+
+/* Globals used in encoder */
+
+float w[M]; /* time domain hamming window */
+COMP W[FFT_ENC]; /* DFT of w[] */
+COMP Sw[FFT_ENC]; /* DFT of current frame */
+
+/* Globals used in decoder */
+
+COMP Sw_[FFT_ENC]; /* DFT of all voiced synthesised signal */
+float Sn_[AW_DEC]; /* synthesised speech */
+float Pn[AW_DEC]; /* time domain Parzen (trapezoidal) window */
+
diff --git a/gr-vocoder/lib/codec2/globals.h b/gr-vocoder/lib/codec2/globals.h
new file mode 100644
index 000000000..cef720344
--- /dev/null
+++ b/gr-vocoder/lib/codec2/globals.h
@@ -0,0 +1,47 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: globals.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 1/11/94
+
+ Globals for sinusoidal speech coder.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+/* Globals used in encoder and decoder */
+
+extern int frames; /* number of frames processed so far */
+extern float Sn[]; /* float input speech samples */
+extern MODEL model; /* model parameters for the current frame */
+extern int Nw; /* number of samples in analysis window */
+extern float sig; /* energy of current frame */
+
+/* Globals used in encoder */
+
+extern float w[]; /* time domain hamming window */
+extern COMP W[]; /* frequency domain hamming window */
+extern COMP Sw[]; /* DFT of current frame */
+extern COMP Sw_[]; /* DFT of all voiced synthesised signal */
+
+/* Globals used in decoder */
+
+extern float Sn_[]; /* output synthesised speech samples */
+extern float Pn[]; /* time domain Parzen (trapezoidal) window */
+
diff --git a/gr-vocoder/lib/codec2/glottal.c b/gr-vocoder/lib/codec2/glottal.c
new file mode 100644
index 000000000..8ac3ff4a9
--- /dev/null
+++ b/gr-vocoder/lib/codec2/glottal.c
@@ -0,0 +1,257 @@
+const float glottal[]={
+ 0.000000,
+ -0.057687,
+ -0.115338,
+ -0.172917,
+ -0.230385,
+ -0.287707,
+ -0.344845,
+ -0.401762,
+ -0.458419,
+ -0.514781,
+ -0.570809,
+ -0.626467,
+ -0.681721,
+ -0.736537,
+ -0.790884,
+ -0.844733,
+ -0.898057,
+ -0.950834,
+ -1.003044,
+ -1.054670,
+ -1.105700,
+ -1.156124,
+ -1.205936,
+ -1.255132,
+ -1.303711,
+ -1.351675,
+ -1.399026,
+ -1.445769,
+ -1.491908,
+ -1.537448,
+ -1.582393,
+ -1.626747,
+ -1.670514,
+ -1.713693,
+ -1.756285,
+ -1.798288,
+ -1.839697,
+ -1.880507,
+ -1.920712,
+ -1.960302,
+ -1.999269,
+ -2.037603,
+ -2.075295,
+ -2.112335,
+ -2.148716,
+ -2.184430,
+ -2.219472,
+ -2.253839,
+ -2.287531,
+ -2.320550,
+ -2.352900,
+ -2.384588,
+ -2.415623,
+ -2.446019,
+ -2.475788,
+ -2.504946,
+ -2.533512,
+ -2.561501,
+ -2.588934,
+ -2.615827,
+ -2.642198,
+ -2.668064,
+ -2.693439,
+ -2.718337,
+ -2.742767,
+ -2.766738,
+ -2.790256,
+ -2.813322,
+ -2.835936,
+ -2.858094,
+ -2.879790,
+ -2.901016,
+ -2.921759,
+ -2.942008,
+ -2.961747,
+ -2.980961,
+ -2.999632,
+ -3.017745,
+ -3.035282,
+ -3.052228,
+ -3.068567,
+ -3.084285,
+ -3.099371,
+ -3.113813,
+ -3.127605,
+ -3.140738,
+ 3.129975,
+ 3.118167,
+ 3.107022,
+ 3.096537,
+ 3.086709,
+ 3.077531,
+ 3.068996,
+ 3.061096,
+ 3.053821,
+ 3.047159,
+ 3.041102,
+ 3.035636,
+ 3.030753,
+ 3.026441,
+ 3.022690,
+ 3.019491,
+ 3.016836,
+ 3.014718,
+ 3.013132,
+ 3.012072,
+ 3.011535,
+ 3.011521,
+ 3.012028,
+ 3.013057,
+ 3.014612,
+ 3.016695,
+ 3.019310,
+ 3.022463,
+ 3.026160,
+ 3.030407,
+ 3.035212,
+ 3.040580,
+ 3.046520,
+ 3.053038,
+ 3.060141,
+ 3.067836,
+ 3.076128,
+ 3.085023,
+ 3.094525,
+ 3.104639,
+ 3.115367,
+ 3.126712,
+ 3.138674,
+ -3.131930,
+ -3.118731,
+ -3.104915,
+ -3.090485,
+ -3.075444,
+ -3.059795,
+ -3.043543,
+ -3.026695,
+ -3.009254,
+ -2.991229,
+ -2.972625,
+ -2.953449,
+ -2.933710,
+ -2.913414,
+ -2.892567,
+ -2.871176,
+ -2.849248,
+ -2.826787,
+ -2.803798,
+ -2.780284,
+ -2.756247,
+ -2.731689,
+ -2.706609,
+ -2.681005,
+ -2.654875,
+ -2.628213,
+ -2.601015,
+ -2.573272,
+ -2.544977,
+ -2.516121,
+ -2.486694,
+ -2.456686,
+ -2.426084,
+ -2.394879,
+ -2.363060,
+ -2.330616,
+ -2.297538,
+ -2.263816,
+ -2.229444,
+ -2.194416,
+ -2.158727,
+ -2.122375,
+ -2.085359,
+ -2.047682,
+ -2.009347,
+ -1.970361,
+ -1.930732,
+ -1.890470,
+ -1.849587,
+ -1.808098,
+ -1.766017,
+ -1.723360,
+ -1.680145,
+ -1.636388,
+ -1.592105,
+ -1.547313,
+ -1.502025,
+ -1.456256,
+ -1.410016,
+ -1.363314,
+ -1.316157,
+ -1.268547,
+ -1.220486,
+ -1.171971,
+ -1.122997,
+ -1.073555,
+ -1.023636,
+ -0.973227,
+ -0.922312,
+ -0.870875,
+ -0.818899,
+ -0.766366,
+ -0.713257,
+ -0.659554,
+ -0.605242,
+ -0.550303,
+ -0.494723,
+ -0.438492,
+ -0.381598,
+ -0.324036,
+ -0.265800,
+ -0.206889,
+ -0.147303,
+ -0.087046,
+ -0.026121,
+ 0.035463,
+ 0.097698,
+ 0.160576,
+ 0.224087,
+ 0.288221,
+ 0.352969,
+ 0.418323,
+ 0.484276,
+ 0.550822,
+ 0.617958,
+ 0.685681,
+ 0.753991,
+ 0.822889,
+ 0.892378,
+ 0.962462,
+ 1.033144,
+ 1.104430,
+ 1.176325,
+ 1.248833,
+ 1.321956,
+ 1.395696,
+ 1.470051,
+ 1.545019,
+ 1.620593,
+ 1.696763,
+ 1.773516,
+ 1.850837,
+ 1.928705,
+ 2.007097,
+ 2.085987,
+ 2.165347,
+ 2.245145,
+ 2.325347,
+ 2.405919,
+ 2.486824,
+ 2.568025,
+ 2.649485,
+ 2.731167,
+ 2.813033,
+ 2.895045,
+ 2.977167,
+ 3.059362};
diff --git a/gr-vocoder/lib/codec2/interp.c b/gr-vocoder/lib/codec2/interp.c
new file mode 100644
index 000000000..135d8c9e7
--- /dev/null
+++ b/gr-vocoder/lib/codec2/interp.c
@@ -0,0 +1,472 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: interp.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 9/10/09
+
+ Interpolation of 20ms frames to 10ms frames.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <assert.h>
+#include <math.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "defines.h"
+#include "interp.h"
+#include "lsp.h"
+#include "quantise.h"
+#include "dump.h"
+
+float sample_log_amp(MODEL *model, float w);
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: interp()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/10
+
+ Given two frames decribed by model parameters 20ms apart, determines
+ the model parameters of the 10ms frame between them. Assumes
+ voicing is available for middle (interpolated) frame. Outputs are
+ amplitudes and Wo for the interpolated frame.
+
+ This version can interpolate the amplitudes between two frames of
+ different Wo and L.
+
+ This version works by log linear interpolation, but listening tests
+ showed it creates problems in background noise, e.g. hts2a and mmt1.
+ When this function is used (--dec mode) bg noise appears to be
+ amplitude modulated, and gets louder. The interp_lsp() function
+ below seems to do a better job.
+
+\*---------------------------------------------------------------------------*/
+
+void interpolate(
+ MODEL *interp, /* interpolated model params */
+ MODEL *prev, /* previous frames model params */
+ MODEL *next /* next frames model params */
+)
+{
+ int l;
+ float w,log_amp;
+
+ /* Wo depends on voicing of this and adjacent frames */
+
+ if (interp->voiced) {
+ if (prev->voiced && next->voiced)
+ interp->Wo = (prev->Wo + next->Wo)/2.0;
+ if (!prev->voiced && next->voiced)
+ interp->Wo = next->Wo;
+ if (prev->voiced && !next->voiced)
+ interp->Wo = prev->Wo;
+ }
+ else {
+ interp->Wo = TWO_PI/P_MAX;
+ }
+ interp->L = PI/interp->Wo;
+
+ /* Interpolate amplitudes using linear interpolation in log domain */
+
+ for(l=1; l<=interp->L; l++) {
+ w = l*interp->Wo;
+ log_amp = (sample_log_amp(prev, w) + sample_log_amp(next, w))/2.0;
+ interp->A[l] = pow(10.0, log_amp);
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: sample_log_amp()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/10
+
+ Samples the amplitude envelope at an arbitrary frequency w. Uses
+ linear interpolation in the log domain to sample between harmonic
+ amplitudes.
+
+\*---------------------------------------------------------------------------*/
+
+float sample_log_amp(MODEL *model, float w)
+{
+ int m;
+ float f, log_amp;
+
+ assert(w > 0.0); assert (w <= PI);
+
+ m = 0;
+ while ((m+1)*model->Wo < w) m++;
+ f = (w - m*model->Wo)/model->Wo;
+ assert(f <= 1.0);
+
+ if (m < 1) {
+ log_amp = f*log10(model->A[1] + 1E-6);
+ }
+ else if ((m+1) > model->L) {
+ log_amp = (1.0-f)*log10(model->A[model->L] + 1E-6);
+ }
+ else {
+ log_amp = (1.0-f)*log10(model->A[m] + 1E-6) +
+ f*log10(model->A[m+1] + 1E-6);
+ //printf("m=%d A[m] %f A[m+1] %f x %f %f %f\n", m, model->A[m],
+ // model->A[m+1], pow(10.0, log_amp),
+ // (1-f), f);
+ }
+
+ return log_amp;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: sample_log_amp_quad()
+ AUTHOR......: David Rowe
+ DATE CREATED: 9 March 2011
+
+ Samples the amplitude envelope at an arbitrary frequency w. Uses
+ quadratic interpolation in the log domain to sample between harmonic
+ amplitudes.
+
+ y(x) = ax*x + bx + c
+
+ We assume three points are x=-1, x=0, x=1, which we map to m-1,m,m+1
+
+ c = y(0)
+ b = (y(1) - y(-1))/2
+ a = y(-1) + b - y(0)
+
+\*---------------------------------------------------------------------------*/
+
+float sample_log_amp_quad(MODEL *model, float w)
+{
+ int m;
+ float a,b,c,x, log_amp;
+
+ assert(w > 0.0); assert (w <= PI);
+
+ m = floor(w/model->Wo + 0.5);
+ if (m < 2) m = 2;
+ if (m > (model->L-1)) m = model->L-1;
+ c = log10(model->A[m]+1E-6);
+ b = (log10(model->A[m+1]+1E-6) - log10(model->A[m-1]+1E-6))/2.0;
+ a = log10(model->A[m-1]+1E-6) + b - c;
+ x = (w - m*model->Wo)/model->Wo;
+
+ log_amp = a*x*x + b*x + c;
+ //printf("m=%d A[m-1] %f A[m] %f A[m+1] %f w %f x %f log_amp %f\n", m,
+ // model->A[m-1],
+ // model->A[m], model->A[m+1], w, x, pow(10.0, log_amp));
+ return log_amp;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: sample_log_amp_quad_nl()
+ AUTHOR......: David Rowe
+ DATE CREATED: 10 March 2011
+
+ Samples the amplitude envelope at an arbitrary frequency w. Uses
+ quadratic interpolation in the log domain to sample between harmonic
+ amplitudes. This version can handle non-linear steps along a freq
+ axis defined by arbitrary steps.
+
+ y(x) = ax*x + bx + c
+
+ We assume three points are (x_1,y_1), (0,y0) and (x1,y1).
+
+\*---------------------------------------------------------------------------*/
+
+float sample_log_amp_quad_nl(
+ float w[], /* frequency points */
+ float A[], /* for these amplitude samples */
+ int np, /* number of frequency points */
+ float w_sample /* frequency of new samples */
+)
+{
+ int m,i;
+ float a,b,c,x, log_amp, best_dist;
+ float x_1, x1;
+ float y_1, y0, y1;
+
+ //printf("w_sample %f\n", w_sample);
+ assert(w_sample >= 0.0); assert (w_sample <= 1.1*PI);
+
+ /* find closest point to centre quadratic interpolator */
+
+ best_dist = 1E32;
+ for (i=0; i<np; i++)
+ if (fabs(w[i] - w_sample) < best_dist) {
+ best_dist = fabs(w[i] - w_sample);
+ m = i;
+ }
+
+ /* stay one point away from edge of array */
+
+ if (m < 1) m = 1;
+ if (m > (np-2)) m = np - 2;
+
+ /* find polynomial coeffs */
+
+ x_1 = w[m-1]- w[m]; x1 = w[m+1] - w[m];
+ y_1 = log10(A[m-1]+1E-6);
+ y0 = log10(A[m]+1E-6);
+ y1 = log10(A[m+1]+1E-6);
+
+ c = y0;
+ a = (y_1*x1 - y1*x_1 + c*x_1 - c*x1)/(x_1*x_1*x1 - x1*x1*x_1);
+ b = (y1 -a*x1*x1 - c)/x1;
+ x = w_sample - w[m];
+
+ //printf("%f %f %f\n", w[0], w[1], w[2]);
+ //printf("%f %f %f %f %f %f\n", x_1, y_1, 0.0, y0, x1, y1);
+ log_amp = a*x*x + b*x + c;
+ //printf("a %f b %f c %f\n", a, b, c);
+ //printf("m=%d A[m-1] %f A[m] %f A[m+1] %f w_sample %f w[m] %f x %f log_amp %f\n", m,
+ // A[m-1],
+ // A[m], A[m+1], w_sample, w[m], x, log_amp);
+ //exit(0);
+ return log_amp;
+}
+
+#define M_MAX 40
+
+float fres[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
+ 1200, 1400, 1600, 1850, 2100, 2350, 2600, 2900, 3400, 3800};
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: resample_amp_nl()
+ AUTHOR......: David Rowe
+ DATE CREATED: 7 March 2011
+
+ Converts the current model with L {Am} samples spaced Wo apart to
+ RES_POINTS samples spaced Wo/RES_POINTS apart. Then subtracts
+ from the previous frames samples to get the delta.
+
+\*---------------------------------------------------------------------------*/
+
+void resample_amp_fixed(MODEL *model,
+ float w[], float A[],
+ float wres[], float Ares[],
+ float AresdB_prev[],
+ float AresdB[],
+ float deltat[])
+{
+ int i;
+
+ for(i=1; i<=model->L; i++) {
+ w[i-1] = i*model->Wo;
+ A[i-1] = model->A[i];
+ }
+
+ for(i=0; i<RES_POINTS; i++) {
+ wres[i] = fres[i]*PI/4000.0;
+ }
+
+ for(i=0; i<RES_POINTS; i++) {
+ Ares[i] = pow(10.0,sample_log_amp_quad_nl(w, A, model->L, wres[i]));
+ }
+
+ /* work out delta T vector for this frame */
+
+ for(i=0; i<RES_POINTS; i++) {
+ AresdB[i] = 20.0*log10(Ares[i]);
+ deltat[i] = AresdB[i] - AresdB_prev[i];
+ }
+
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: resample_amp_nl()
+ AUTHOR......: David Rowe
+ DATE CREATED: 7 March 2011
+
+ Converts the current model with L {Am} samples spaced Wo apart to M
+ samples spaced Wo/M apart. Then converts back to L {Am} samples.
+ used to prototype constant rate Amplitude encoding ideas.
+
+ Returns the SNR in dB.
+
+\*---------------------------------------------------------------------------*/
+
+float resample_amp_nl(MODEL *model, int m, float AresdB_prev[])
+{
+ int i;
+ float w[MAX_AMP], A[MAX_AMP];
+ float wres[MAX_AMP], Ares[MAX_AMP], AresdB[MAX_AMP];
+ float signal, noise, snr;
+ float new_A;
+ float deltat[MAX_AMP], deltat_q[MAX_AMP], AresdB_q[MAX_AMP];
+
+ resample_amp_fixed(model, w, A, wres, Ares, AresdB_prev, AresdB, deltat);
+
+ /* quantise delta T vector */
+
+ for(i=0; i<RES_POINTS; i++) {
+ noise = 3.0*(1.0 - 2.0*rand()/RAND_MAX);
+ //noise = 0.0;
+ deltat_q[i] = deltat[i] + noise;
+ }
+
+ /* recover Ares vector */
+
+ for(i=0; i<RES_POINTS; i++) {
+ AresdB_q[i] = AresdB_prev[i] + deltat_q[i];
+ Ares[i] = pow(10.0, AresdB_q[i]/20.0);
+ //printf("%d %f %f\n", i, AresdB[i], AresdB_q[i]);
+ }
+
+ /* update memory based on version at decoder */
+
+ for(i=0; i<RES_POINTS; i++) {
+ AresdB_prev[i] = AresdB_q[i];
+ }
+
+#ifdef DUMP
+ dump_resample(wres,Ares,M_MAX);
+#endif
+
+ signal = noise = 0.0;
+
+ for(i=1; i<model->L; i++) {
+ new_A = pow(10.0,sample_log_amp_quad_nl(wres, Ares, RES_POINTS, model->Wo*i));
+ signal += pow(model->A[i], 2.0);
+ noise += pow(model->A[i] - new_A, 2.0);
+ //printf("%f %f\n", model->A[i], new_A);
+ model->A[i] = new_A;
+ }
+
+ snr = 10.0*log10(signal/noise);
+ printf("snr = %3.2f\n", snr);
+ //exit(0);
+ return snr;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: resample_amp()
+ AUTHOR......: David Rowe
+ DATE CREATED: 10 March 2011
+
+ Converts the current model with L {Am} samples spaced Wo apart to M
+ samples with a non-linear spacing. Then converts back to L {Am}
+ samples. used to prototype constant rate Amplitude encoding ideas.
+
+ Returns the SNR in dB.
+
+\*---------------------------------------------------------------------------*/
+
+float resample_amp(MODEL *model, int m)
+{
+ int i;
+ MODEL model_m;
+ float new_A, signal, noise, snr, log_amp_dB;
+ float n_db = 0.0;
+
+ model_m.Wo = PI/(float)m;
+ model_m.L = PI/model_m.Wo;
+
+ for(i=1; i<=model_m.L; i++) {
+ log_amp_dB = 20.0*sample_log_amp_quad(model, i*model_m.Wo);
+ log_amp_dB += n_db*(1.0 - 2.0*rand()/RAND_MAX);
+ model_m.A[i] = pow(10,log_amp_dB/20.0);
+ }
+
+ //dump_resample(&model_m);
+
+ signal = noise = 0.0;
+
+ for(i=1; i<model->L/4; i++) {
+ new_A = pow(10,sample_log_amp_quad(&model_m, i*model->Wo));
+ signal += pow(model->A[i], 2.0);
+ noise += pow(model->A[i] - new_A, 2.0);
+ //printf("%f %f\n", model->A[i], new_A);
+ model->A[i] = new_A;
+ }
+
+ snr = 10.0*log10(signal/noise);
+ //printf("snr = %3.2f\n", snr);
+ //exit(0);
+ return snr;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: interp_lsp()
+ AUTHOR......: David Rowe
+ DATE CREATED: 10 Nov 2010
+
+ Given two frames decribed by model parameters 20ms apart, determines
+ the model parameters of the 10ms frame between them. Assumes
+ voicing is available for middle (interpolated) frame. Outputs are
+ amplitudes and Wo for the interpolated frame.
+
+ This version uses interpolation of LSPs, seems to do a better job
+ with bg noise.
+
+\*---------------------------------------------------------------------------*/
+
+void interpolate_lsp(
+ MODEL *interp, /* interpolated model params */
+ MODEL *prev, /* previous frames model params */
+ MODEL *next, /* next frames model params */
+ float *prev_lsps, /* previous frames LSPs */
+ float prev_e, /* previous frames LPC energy */
+ float *next_lsps, /* next frames LSPs */
+ float next_e, /* next frames LPC energy */
+ float *ak_interp /* interpolated aks for this frame */
+ )
+{
+ int l,i;
+ float lsps[LPC_ORD],e;
+ float snr;
+
+ /* Wo depends on voicing of this and adjacent frames */
+
+ if (interp->voiced) {
+ if (prev->voiced && next->voiced)
+ interp->Wo = (prev->Wo + next->Wo)/2.0;
+ if (!prev->voiced && next->voiced)
+ interp->Wo = next->Wo;
+ if (prev->voiced && !next->voiced)
+ interp->Wo = prev->Wo;
+ }
+ else {
+ interp->Wo = TWO_PI/P_MAX;
+ }
+ interp->L = PI/interp->Wo;
+
+ /* interpolate LSPs */
+
+ for(i=0; i<LPC_ORD; i++) {
+ lsps[i] = (prev_lsps[i] + next_lsps[i])/2.0;
+ }
+
+ /* Interpolate LPC energy in log domain */
+
+ e = pow(10.0, (log10(prev_e) + log10(next_e))/2.0);
+
+ /* convert back to amplitudes */
+
+ lsp_to_lpc(lsps, ak_interp, LPC_ORD);
+ aks_to_M2(ak_interp, LPC_ORD, interp, e, &snr, 0);
+}
diff --git a/gr-vocoder/lib/codec2/interp.h b/gr-vocoder/lib/codec2/interp.h
new file mode 100644
index 000000000..d41eac3f8
--- /dev/null
+++ b/gr-vocoder/lib/codec2/interp.h
@@ -0,0 +1,41 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: interp.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 9/10/09
+
+ Interpolation of 20ms frames to 10ms frames.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __INTERP__
+#define __INTERP__
+
+#define RES_POINTS 20
+
+void interpolate(MODEL *interp, MODEL *prev, MODEL *next);
+void interpolate_lsp(MODEL *interp, MODEL *prev, MODEL *next,
+ float *prev_lsps, float prev_e,
+ float *next_lsps, float next_e,
+ float *ak_interp);
+float resample_amp(MODEL *model, int m);
+float resample_amp_nl(MODEL *model, int m, float Ares_prev[]);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/kiss_fft.c b/gr-vocoder/lib/codec2/kiss_fft.c
new file mode 100644
index 000000000..465d6c97a
--- /dev/null
+++ b/gr-vocoder/lib/codec2/kiss_fft.c
@@ -0,0 +1,408 @@
+/*
+Copyright (c) 2003-2010, Mark Borgerding
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#include "_kiss_fft_guts.h"
+/* The guts header contains all the multiplication and addition macros that are defined for
+ fixed or floating point complex numbers. It also delares the kf_ internal functions.
+ */
+
+static void kf_bfly2(
+ kiss_fft_cpx * Fout,
+ const size_t fstride,
+ const kiss_fft_cfg st,
+ int m
+ )
+{
+ kiss_fft_cpx * Fout2;
+ kiss_fft_cpx * tw1 = st->twiddles;
+ kiss_fft_cpx t;
+ Fout2 = Fout + m;
+ do{
+ C_FIXDIV(*Fout,2); C_FIXDIV(*Fout2,2);
+
+ C_MUL (t, *Fout2 , *tw1);
+ tw1 += fstride;
+ C_SUB( *Fout2 , *Fout , t );
+ C_ADDTO( *Fout , t );
+ ++Fout2;
+ ++Fout;
+ }while (--m);
+}
+
+static void kf_bfly4(
+ kiss_fft_cpx * Fout,
+ const size_t fstride,
+ const kiss_fft_cfg st,
+ const size_t m
+ )
+{
+ kiss_fft_cpx *tw1,*tw2,*tw3;
+ kiss_fft_cpx scratch[6];
+ size_t k=m;
+ const size_t m2=2*m;
+ const size_t m3=3*m;
+
+
+ tw3 = tw2 = tw1 = st->twiddles;
+
+ do {
+ C_FIXDIV(*Fout,4); C_FIXDIV(Fout[m],4); C_FIXDIV(Fout[m2],4); C_FIXDIV(Fout[m3],4);
+
+ C_MUL(scratch[0],Fout[m] , *tw1 );
+ C_MUL(scratch[1],Fout[m2] , *tw2 );
+ C_MUL(scratch[2],Fout[m3] , *tw3 );
+
+ C_SUB( scratch[5] , *Fout, scratch[1] );
+ C_ADDTO(*Fout, scratch[1]);
+ C_ADD( scratch[3] , scratch[0] , scratch[2] );
+ C_SUB( scratch[4] , scratch[0] , scratch[2] );
+ C_SUB( Fout[m2], *Fout, scratch[3] );
+ tw1 += fstride;
+ tw2 += fstride*2;
+ tw3 += fstride*3;
+ C_ADDTO( *Fout , scratch[3] );
+
+ if(st->inverse) {
+ Fout[m].r = scratch[5].r - scratch[4].i;
+ Fout[m].i = scratch[5].i + scratch[4].r;
+ Fout[m3].r = scratch[5].r + scratch[4].i;
+ Fout[m3].i = scratch[5].i - scratch[4].r;
+ }else{
+ Fout[m].r = scratch[5].r + scratch[4].i;
+ Fout[m].i = scratch[5].i - scratch[4].r;
+ Fout[m3].r = scratch[5].r - scratch[4].i;
+ Fout[m3].i = scratch[5].i + scratch[4].r;
+ }
+ ++Fout;
+ }while(--k);
+}
+
+static void kf_bfly3(
+ kiss_fft_cpx * Fout,
+ const size_t fstride,
+ const kiss_fft_cfg st,
+ size_t m
+ )
+{
+ size_t k=m;
+ const size_t m2 = 2*m;
+ kiss_fft_cpx *tw1,*tw2;
+ kiss_fft_cpx scratch[5];
+ kiss_fft_cpx epi3;
+ epi3 = st->twiddles[fstride*m];
+
+ tw1=tw2=st->twiddles;
+
+ do{
+ C_FIXDIV(*Fout,3); C_FIXDIV(Fout[m],3); C_FIXDIV(Fout[m2],3);
+
+ C_MUL(scratch[1],Fout[m] , *tw1);
+ C_MUL(scratch[2],Fout[m2] , *tw2);
+
+ C_ADD(scratch[3],scratch[1],scratch[2]);
+ C_SUB(scratch[0],scratch[1],scratch[2]);
+ tw1 += fstride;
+ tw2 += fstride*2;
+
+ Fout[m].r = Fout->r - HALF_OF(scratch[3].r);
+ Fout[m].i = Fout->i - HALF_OF(scratch[3].i);
+
+ C_MULBYSCALAR( scratch[0] , epi3.i );
+
+ C_ADDTO(*Fout,scratch[3]);
+
+ Fout[m2].r = Fout[m].r + scratch[0].i;
+ Fout[m2].i = Fout[m].i - scratch[0].r;
+
+ Fout[m].r -= scratch[0].i;
+ Fout[m].i += scratch[0].r;
+
+ ++Fout;
+ }while(--k);
+}
+
+static void kf_bfly5(
+ kiss_fft_cpx * Fout,
+ const size_t fstride,
+ const kiss_fft_cfg st,
+ int m
+ )
+{
+ kiss_fft_cpx *Fout0,*Fout1,*Fout2,*Fout3,*Fout4;
+ int u;
+ kiss_fft_cpx scratch[13];
+ kiss_fft_cpx * twiddles = st->twiddles;
+ kiss_fft_cpx *tw;
+ kiss_fft_cpx ya,yb;
+ ya = twiddles[fstride*m];
+ yb = twiddles[fstride*2*m];
+
+ Fout0=Fout;
+ Fout1=Fout0+m;
+ Fout2=Fout0+2*m;
+ Fout3=Fout0+3*m;
+ Fout4=Fout0+4*m;
+
+ tw=st->twiddles;
+ for ( u=0; u<m; ++u ) {
+ C_FIXDIV( *Fout0,5); C_FIXDIV( *Fout1,5); C_FIXDIV( *Fout2,5); C_FIXDIV( *Fout3,5); C_FIXDIV( *Fout4,5);
+ scratch[0] = *Fout0;
+
+ C_MUL(scratch[1] ,*Fout1, tw[u*fstride]);
+ C_MUL(scratch[2] ,*Fout2, tw[2*u*fstride]);
+ C_MUL(scratch[3] ,*Fout3, tw[3*u*fstride]);
+ C_MUL(scratch[4] ,*Fout4, tw[4*u*fstride]);
+
+ C_ADD( scratch[7],scratch[1],scratch[4]);
+ C_SUB( scratch[10],scratch[1],scratch[4]);
+ C_ADD( scratch[8],scratch[2],scratch[3]);
+ C_SUB( scratch[9],scratch[2],scratch[3]);
+
+ Fout0->r += scratch[7].r + scratch[8].r;
+ Fout0->i += scratch[7].i + scratch[8].i;
+
+ scratch[5].r = scratch[0].r + S_MUL(scratch[7].r,ya.r) + S_MUL(scratch[8].r,yb.r);
+ scratch[5].i = scratch[0].i + S_MUL(scratch[7].i,ya.r) + S_MUL(scratch[8].i,yb.r);
+
+ scratch[6].r = S_MUL(scratch[10].i,ya.i) + S_MUL(scratch[9].i,yb.i);
+ scratch[6].i = -S_MUL(scratch[10].r,ya.i) - S_MUL(scratch[9].r,yb.i);
+
+ C_SUB(*Fout1,scratch[5],scratch[6]);
+ C_ADD(*Fout4,scratch[5],scratch[6]);
+
+ scratch[11].r = scratch[0].r + S_MUL(scratch[7].r,yb.r) + S_MUL(scratch[8].r,ya.r);
+ scratch[11].i = scratch[0].i + S_MUL(scratch[7].i,yb.r) + S_MUL(scratch[8].i,ya.r);
+ scratch[12].r = - S_MUL(scratch[10].i,yb.i) + S_MUL(scratch[9].i,ya.i);
+ scratch[12].i = S_MUL(scratch[10].r,yb.i) - S_MUL(scratch[9].r,ya.i);
+
+ C_ADD(*Fout2,scratch[11],scratch[12]);
+ C_SUB(*Fout3,scratch[11],scratch[12]);
+
+ ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4;
+ }
+}
+
+/* perform the butterfly for one stage of a mixed radix FFT */
+static void kf_bfly_generic(
+ kiss_fft_cpx * Fout,
+ const size_t fstride,
+ const kiss_fft_cfg st,
+ int m,
+ int p
+ )
+{
+ int u,k,q1,q;
+ kiss_fft_cpx * twiddles = st->twiddles;
+ kiss_fft_cpx t;
+ int Norig = st->nfft;
+
+ kiss_fft_cpx * scratch = (kiss_fft_cpx*)KISS_FFT_TMP_ALLOC(sizeof(kiss_fft_cpx)*p);
+
+ for ( u=0; u<m; ++u ) {
+ k=u;
+ for ( q1=0 ; q1<p ; ++q1 ) {
+ scratch[q1] = Fout[ k ];
+ C_FIXDIV(scratch[q1],p);
+ k += m;
+ }
+
+ k=u;
+ for ( q1=0 ; q1<p ; ++q1 ) {
+ int twidx=0;
+ Fout[ k ] = scratch[0];
+ for (q=1;q<p;++q ) {
+ twidx += fstride * k;
+ if (twidx>=Norig) twidx-=Norig;
+ C_MUL(t,scratch[q] , twiddles[twidx] );
+ C_ADDTO( Fout[ k ] ,t);
+ }
+ k += m;
+ }
+ }
+ KISS_FFT_TMP_FREE(scratch);
+}
+
+static
+void kf_work(
+ kiss_fft_cpx * Fout,
+ const kiss_fft_cpx * f,
+ const size_t fstride,
+ int in_stride,
+ int * factors,
+ const kiss_fft_cfg st
+ )
+{
+ kiss_fft_cpx * Fout_beg=Fout;
+ const int p=*factors++; /* the radix */
+ const int m=*factors++; /* stage's fft length/p */
+ const kiss_fft_cpx * Fout_end = Fout + p*m;
+
+#ifdef _OPENMP
+ // use openmp extensions at the
+ // top-level (not recursive)
+ if (fstride==1 && p<=5)
+ {
+ int k;
+
+ // execute the p different work units in different threads
+# pragma omp parallel for
+ for (k=0;k<p;++k)
+ kf_work( Fout +k*m, f+ fstride*in_stride*k,fstride*p,in_stride,factors,st);
+ // all threads have joined by this point
+
+ switch (p) {
+ case 2: kf_bfly2(Fout,fstride,st,m); break;
+ case 3: kf_bfly3(Fout,fstride,st,m); break;
+ case 4: kf_bfly4(Fout,fstride,st,m); break;
+ case 5: kf_bfly5(Fout,fstride,st,m); break;
+ default: kf_bfly_generic(Fout,fstride,st,m,p); break;
+ }
+ return;
+ }
+#endif
+
+ if (m==1) {
+ do{
+ *Fout = *f;
+ f += fstride*in_stride;
+ }while(++Fout != Fout_end );
+ }else{
+ do{
+ // recursive call:
+ // DFT of size m*p performed by doing
+ // p instances of smaller DFTs of size m,
+ // each one takes a decimated version of the input
+ kf_work( Fout , f, fstride*p, in_stride, factors,st);
+ f += fstride*in_stride;
+ }while( (Fout += m) != Fout_end );
+ }
+
+ Fout=Fout_beg;
+
+ // recombine the p smaller DFTs
+ switch (p) {
+ case 2: kf_bfly2(Fout,fstride,st,m); break;
+ case 3: kf_bfly3(Fout,fstride,st,m); break;
+ case 4: kf_bfly4(Fout,fstride,st,m); break;
+ case 5: kf_bfly5(Fout,fstride,st,m); break;
+ default: kf_bfly_generic(Fout,fstride,st,m,p); break;
+ }
+}
+
+/* facbuf is populated by p1,m1,p2,m2, ...
+ where
+ p[i] * m[i] = m[i-1]
+ m0 = n */
+static
+void kf_factor(int n,int * facbuf)
+{
+ int p=4;
+ double floor_sqrt;
+ floor_sqrt = floor( sqrt((double)n) );
+
+ /*factor out powers of 4, powers of 2, then any remaining primes */
+ do {
+ while (n % p) {
+ switch (p) {
+ case 4: p = 2; break;
+ case 2: p = 3; break;
+ default: p += 2; break;
+ }
+ if (p > floor_sqrt)
+ p = n; /* no more factors, skip to end */
+ }
+ n /= p;
+ *facbuf++ = p;
+ *facbuf++ = n;
+ } while (n > 1);
+}
+
+/*
+ *
+ * User-callable function to allocate all necessary storage space for the fft.
+ *
+ * The return value is a contiguous block of memory, allocated with malloc. As such,
+ * It can be freed with free(), rather than a kiss_fft-specific function.
+ * */
+kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem )
+{
+ kiss_fft_cfg st=NULL;
+ size_t memneeded = sizeof(struct kiss_fft_state)
+ + sizeof(kiss_fft_cpx)*(nfft-1); /* twiddle factors*/
+
+ if ( lenmem==NULL ) {
+ st = ( kiss_fft_cfg)KISS_FFT_MALLOC( memneeded );
+ }else{
+ if (mem != NULL && *lenmem >= memneeded)
+ st = (kiss_fft_cfg)mem;
+ *lenmem = memneeded;
+ }
+ if (st) {
+ int i;
+ st->nfft=nfft;
+ st->inverse = inverse_fft;
+
+ for (i=0;i<nfft;++i) {
+ const double pi=3.141592653589793238462643383279502884197169399375105820974944;
+ double phase = -2*pi*i / nfft;
+ if (st->inverse)
+ phase *= -1;
+ kf_cexp(st->twiddles+i, phase );
+ }
+
+ kf_factor(nfft,st->factors);
+ }
+ return st;
+}
+
+
+void kiss_fft_stride(kiss_fft_cfg st,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int in_stride)
+{
+ if (fin == fout) {
+ //NOTE: this is not really an in-place FFT algorithm.
+ //It just performs an out-of-place FFT into a temp buffer
+ kiss_fft_cpx * tmpbuf = (kiss_fft_cpx*)KISS_FFT_TMP_ALLOC( sizeof(kiss_fft_cpx)*st->nfft);
+ kf_work(tmpbuf,fin,1,in_stride, st->factors,st);
+ memcpy(fout,tmpbuf,sizeof(kiss_fft_cpx)*st->nfft);
+ KISS_FFT_TMP_FREE(tmpbuf);
+ }else{
+ kf_work( fout, fin, 1,in_stride, st->factors,st );
+ }
+}
+
+void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout)
+{
+ kiss_fft_stride(cfg,fin,fout,1);
+}
+
+
+void kiss_fft_cleanup(void)
+{
+ // nothing needed any more
+}
+
+int kiss_fft_next_fast_size(int n)
+{
+ while(1) {
+ int m=n;
+ while ( (m%2) == 0 ) m/=2;
+ while ( (m%3) == 0 ) m/=3;
+ while ( (m%5) == 0 ) m/=5;
+ if (m<=1)
+ break; /* n is completely factorable by twos, threes, and fives */
+ n++;
+ }
+ return n;
+}
diff --git a/gr-vocoder/lib/codec2/kiss_fft.h b/gr-vocoder/lib/codec2/kiss_fft.h
new file mode 100644
index 000000000..64c50f4aa
--- /dev/null
+++ b/gr-vocoder/lib/codec2/kiss_fft.h
@@ -0,0 +1,124 @@
+#ifndef KISS_FFT_H
+#define KISS_FFT_H
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ ATTENTION!
+ If you would like a :
+ -- a utility that will handle the caching of fft objects
+ -- real-only (no imaginary time component ) FFT
+ -- a multi-dimensional FFT
+ -- a command-line utility to perform ffts
+ -- a command-line utility to perform fast-convolution filtering
+
+ Then see kfc.h kiss_fftr.h kiss_fftnd.h fftutil.c kiss_fastfir.c
+ in the tools/ directory.
+*/
+
+#ifdef USE_SIMD
+# include <xmmintrin.h>
+# define kiss_fft_scalar __m128
+#define KISS_FFT_MALLOC(nbytes) _mm_malloc(nbytes,16)
+#define KISS_FFT_FREE _mm_free
+#else
+#define KISS_FFT_MALLOC malloc
+#define KISS_FFT_FREE free
+#endif
+
+
+#ifdef FIXED_POINT
+#include <sys/types.h>
+# if (FIXED_POINT == 32)
+# define kiss_fft_scalar int32_t
+# else
+# define kiss_fft_scalar int16_t
+# endif
+#else
+# ifndef kiss_fft_scalar
+/* default is float */
+# define kiss_fft_scalar float
+# endif
+#endif
+
+typedef struct {
+ kiss_fft_scalar r;
+ kiss_fft_scalar i;
+}kiss_fft_cpx;
+
+typedef struct kiss_fft_state* kiss_fft_cfg;
+
+/*
+ * kiss_fft_alloc
+ *
+ * Initialize a FFT (or IFFT) algorithm's cfg/state buffer.
+ *
+ * typical usage: kiss_fft_cfg mycfg=kiss_fft_alloc(1024,0,NULL,NULL);
+ *
+ * The return value from fft_alloc is a cfg buffer used internally
+ * by the fft routine or NULL.
+ *
+ * If lenmem is NULL, then kiss_fft_alloc will allocate a cfg buffer using malloc.
+ * The returned value should be free()d when done to avoid memory leaks.
+ *
+ * The state can be placed in a user supplied buffer 'mem':
+ * If lenmem is not NULL and mem is not NULL and *lenmem is large enough,
+ * then the function places the cfg in mem and the size used in *lenmem
+ * and returns mem.
+ *
+ * If lenmem is not NULL and ( mem is NULL or *lenmem is not large enough),
+ * then the function returns NULL and places the minimum cfg
+ * buffer size in *lenmem.
+ * */
+
+kiss_fft_cfg kiss_fft_alloc(int nfft,int inverse_fft,void * mem,size_t * lenmem);
+
+/*
+ * kiss_fft(cfg,in_out_buf)
+ *
+ * Perform an FFT on a complex input buffer.
+ * for a forward FFT,
+ * fin should be f[0] , f[1] , ... ,f[nfft-1]
+ * fout will be F[0] , F[1] , ... ,F[nfft-1]
+ * Note that each element is complex and can be accessed like
+ f[k].r and f[k].i
+ * */
+void kiss_fft(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout);
+
+/*
+ A more generic version of the above function. It reads its input from every Nth sample.
+ * */
+void kiss_fft_stride(kiss_fft_cfg cfg,const kiss_fft_cpx *fin,kiss_fft_cpx *fout,int fin_stride);
+
+/* If kiss_fft_alloc allocated a buffer, it is one contiguous
+ buffer and can be simply free()d when no longer needed*/
+#define kiss_fft_free free
+
+/*
+ Cleans up some memory that gets managed internally. Not necessary to call, but it might clean up
+ your compiler output to call this before you exit.
+*/
+void kiss_fft_cleanup(void);
+
+
+/*
+ * Returns the smallest integer k, such that k>=n and k has only "fast" factors (2,3,5)
+ */
+int kiss_fft_next_fast_size(int n);
+
+/* for real ffts, we need an even size */
+#define kiss_fftr_next_fast_size_real(n) \
+ (kiss_fft_next_fast_size( ((n)+1)>>1)<<1)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/gr-vocoder/lib/codec2/listensim.sh b/gr-vocoder/lib/codec2/listensim.sh
new file mode 100755
index 000000000..0b27a1b0c
--- /dev/null
+++ b/gr-vocoder/lib/codec2/listensim.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# listensim.sh
+# David Rowe 10 Sep 2009
+#
+# Listen to files processed with sim.sh
+
+../script/menu.sh ../raw/$1.raw $1_uq.raw $1_phase0.raw $1_lpc10.raw $1_phase0_lpc10.raw $1_phase0_lpc10_dec.raw $1_phase0_lsp_dec.raw $2 $3
+
+
diff --git a/gr-vocoder/lib/codec2/lpc.c b/gr-vocoder/lib/codec2/lpc.c
new file mode 100644
index 000000000..ba8011377
--- /dev/null
+++ b/gr-vocoder/lib/codec2/lpc.c
@@ -0,0 +1,279 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: lpc.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 30/9/90
+
+ Linear Prediction functions written in C.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#define LPC_MAX_N 512 /* maximum no. of samples in frame */
+#define PI 3.141592654 /* mathematical constant */
+
+#include <assert.h>
+#include <math.h>
+#include "defines.h"
+#include "lpc.h"
+
+/*---------------------------------------------------------------------------*\
+
+ hanning_window()
+
+ Hanning windows a frame of speech samples.
+
+\*---------------------------------------------------------------------------*/
+
+void hanning_window(
+ float Sn[], /* input frame of speech samples */
+ float Wn[], /* output frame of windowed samples */
+ int Nsam /* number of samples */
+)
+{
+ int i; /* loop variable */
+
+ for(i=0; i<Nsam; i++)
+ Wn[i] = Sn[i]*(0.5 - 0.5*cos(2*PI*(float)i/(Nsam-1)));
+}
+
+/*---------------------------------------------------------------------------*\
+
+ autocorrelate()
+
+ Finds the first P autocorrelation values of an array of windowed speech
+ samples Sn[].
+
+\*---------------------------------------------------------------------------*/
+
+void autocorrelate(
+ float Sn[], /* frame of Nsam windowed speech samples */
+ float Rn[], /* array of P+1 autocorrelation coefficients */
+ int Nsam, /* number of windowed samples to use */
+ int order /* order of LPC analysis */
+)
+{
+ int i,j; /* loop variables */
+
+ for(j=0; j<order+1; j++) {
+ Rn[j] = 0.0;
+ for(i=0; i<Nsam-j; i++)
+ Rn[j] += Sn[i]*Sn[i+j];
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ autocorrelate_freq()
+
+ Finds the first P autocorrelation values from an array of frequency domain
+ power samples.
+
+\*---------------------------------------------------------------------------*/
+
+void autocorrelate_freq(
+ float Pw[], /* Nsam frequency domain power spectrum samples */
+ float w[], /* frequency of each sample in Pw[] */
+ float R[], /* array of order+1 autocorrelation coefficients */
+ int Nsam, /* number of windowed samples to use */
+ int order /* order of LPC analysis */
+)
+{
+ int i,j; /* loop variables */
+
+ for(j=0; j<order+1; j++) {
+ R[j] = 0.0;
+ for(i=0; i<Nsam; i++)
+ R[j] += Pw[i]*cos(j*w[i]);
+ }
+ R[j] /= Nsam;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ levinson_durbin()
+
+ Given P+1 autocorrelation coefficients, finds P Linear Prediction Coeff.
+ (LPCs) where P is the order of the LPC all-pole model. The Levinson-Durbin
+ algorithm is used, and is described in:
+
+ J. Makhoul
+ "Linear prediction, a tutorial review"
+ Proceedings of the IEEE
+ Vol-63, No. 4, April 1975
+
+\*---------------------------------------------------------------------------*/
+
+void levinson_durbin(
+ float R[], /* order+1 autocorrelation coeff */
+ float lpcs[], /* order+1 LPC's */
+ int order /* order of the LPC analysis */
+)
+{
+ float E[LPC_MAX+1];
+ float k[LPC_MAX+1];
+ float a[LPC_MAX+1][LPC_MAX+1];
+ float sum;
+ int i,j; /* loop variables */
+
+ E[0] = R[0]; /* Equation 38a, Makhoul */
+
+ for(i=1; i<=order; i++) {
+ sum = 0.0;
+ for(j=1; j<=i-1; j++)
+ sum += a[i-1][j]*R[i-j];
+ k[i] = -1.0*(R[i] + sum)/E[i-1]; /* Equation 38b, Makhoul */
+ if (fabs(k[i]) > 1.0)
+ k[i] = 0.0;
+
+ a[i][i] = k[i];
+
+ for(j=1; j<=i-1; j++)
+ a[i][j] = a[i-1][j] + k[i]*a[i-1][i-j]; /* Equation 38c, Makhoul */
+
+ E[i] = (1-k[i]*k[i])*E[i-1]; /* Equation 38d, Makhoul */
+ }
+
+ for(i=1; i<=order; i++)
+ lpcs[i] = a[order][i];
+ lpcs[0] = 1.0;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ inverse_filter()
+
+ Inverse Filter, A(z). Produces an array of residual samples from an array
+ of input samples and linear prediction coefficients.
+
+ The filter memory is stored in the first order samples of the input array.
+
+\*---------------------------------------------------------------------------*/
+
+void inverse_filter(
+ float Sn[], /* Nsam input samples */
+ float a[], /* LPCs for this frame of samples */
+ int Nsam, /* number of samples */
+ float res[], /* Nsam residual samples */
+ int order /* order of LPC */
+)
+{
+ int i,j; /* loop variables */
+
+ for(i=0; i<Nsam; i++) {
+ res[i] = 0.0;
+ for(j=0; j<=order; j++)
+ res[i] += Sn[i-j]*a[j];
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ synthesis_filter()
+
+ C version of the Speech Synthesis Filter, 1/A(z). Given an array of
+ residual or excitation samples, and the the LP filter coefficients, this
+ function will produce an array of speech samples. This filter structure is
+ IIR.
+
+ The synthesis filter has memory as well, this is treated in the same way
+ as the memory for the inverse filter (see inverse_filter() notes above).
+ The difference is that the memory for the synthesis filter is stored in
+ the output array, wheras the memory of the inverse filter is stored in the
+ input array.
+
+ Note: the calling function must update the filter memory.
+
+\*---------------------------------------------------------------------------*/
+
+void synthesis_filter(
+ float res[], /* Nsam input residual (excitation) samples */
+ float a[], /* LPCs for this frame of speech samples */
+ int Nsam, /* number of speech samples */
+ int order, /* LPC order */
+ float Sn_[] /* Nsam output synthesised speech samples */
+)
+{
+ int i,j; /* loop variables */
+
+ /* Filter Nsam samples */
+
+ for(i=0; i<Nsam; i++) {
+ Sn_[i] = res[i]*a[0];
+ for(j=1; j<=order; j++)
+ Sn_[i] -= Sn_[i-j]*a[j];
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ find_aks()
+
+ This function takes a frame of samples, and determines the linear
+ prediction coefficients for that frame of samples.
+
+\*---------------------------------------------------------------------------*/
+
+void find_aks(
+ float Sn[], /* Nsam samples with order sample memory */
+ float a[], /* order+1 LPCs with first coeff 1.0 */
+ int Nsam, /* number of input speech samples */
+ int order, /* order of the LPC analysis */
+ float *E /* residual energy */
+)
+{
+ float Wn[LPC_MAX_N]; /* windowed frame of Nsam speech samples */
+ float R[LPC_MAX+1]; /* order+1 autocorrelation values of Sn[] */
+ int i;
+
+ assert(order < LPC_MAX);
+ assert(Nsam < LPC_MAX_N);
+
+ hanning_window(Sn,Wn,Nsam);
+ autocorrelate(Wn,R,Nsam,order);
+ levinson_durbin(R,a,order);
+
+ *E = 0.0;
+ for(i=0; i<=order; i++)
+ *E += a[i]*R[i];
+ if (*E < 0.0)
+ *E = 1E-12;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ weight()
+
+ Weights a vector of LPCs.
+
+\*---------------------------------------------------------------------------*/
+
+void weight(
+ float ak[], /* vector of order+1 LPCs */
+ float gamma, /* weighting factor */
+ int order, /* num LPCs (excluding leading 1.0) */
+ float akw[] /* weighted vector of order+1 LPCs */
+)
+{
+ int i;
+
+ for(i=1; i<=order; i++)
+ akw[i] = ak[i]*pow(gamma,(float)i);
+}
+
diff --git a/gr-vocoder/lib/codec2/lpc.h b/gr-vocoder/lib/codec2/lpc.h
new file mode 100644
index 000000000..ead05e1ba
--- /dev/null
+++ b/gr-vocoder/lib/codec2/lpc.h
@@ -0,0 +1,42 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: lpc.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/8/09
+
+ Linear Prediction functions written in C.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __LPC__
+#define __LPC__
+
+#define LPC_MAX_ORDER 20
+
+void hanning_window(float Sn[], float Wn[], int Nsam);
+void autocorrelate(float Sn[], float Rn[], int Nsam, int order);
+void autocorrelate_freq(float Pw[], float w[], float R[], int Nsam, int order);
+void levinson_durbin(float R[], float lpcs[], int order);
+void inverse_filter(float Sn[], float a[], int Nsam, float res[], int order);
+void synthesis_filter(float res[], float a[], int Nsam, int order, float Sn_[]);
+void find_aks(float Sn[], float a[], int Nsam, int order, float *E);
+void weight(float ak[], float gamma, int order, float akw[]);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/lsp.c b/gr-vocoder/lib/codec2/lsp.c
new file mode 100644
index 000000000..47001c1ef
--- /dev/null
+++ b/gr-vocoder/lib/codec2/lsp.c
@@ -0,0 +1,325 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: lsp.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/2/93
+
+
+ This file contains functions for LPC to LSP conversion and LSP to
+ LPC conversion. Note that the LSP coefficients are not in radians
+ format but in the x domain of the unit circle.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "defines.h"
+#include "lsp.h"
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Only 10 gets used, so far. */
+#define LSP_MAX_ORDER 20
+
+/*---------------------------------------------------------------------------*\
+
+ Introduction to Line Spectrum Pairs (LSPs)
+ ------------------------------------------
+
+ LSPs are used to encode the LPC filter coefficients {ak} for
+ transmission over the channel. LSPs have several properties (like
+ less sensitivity to quantisation noise) that make them superior to
+ direct quantisation of {ak}.
+
+ A(z) is a polynomial of order lpcrdr with {ak} as the coefficients.
+
+ A(z) is transformed to P(z) and Q(z) (using a substitution and some
+ algebra), to obtain something like:
+
+ A(z) = 0.5[P(z)(z+z^-1) + Q(z)(z-z^-1)] (1)
+
+ As you can imagine A(z) has complex zeros all over the z-plane. P(z)
+ and Q(z) have the very neat property of only having zeros _on_ the
+ unit circle. So to find them we take a test point z=exp(jw) and
+ evaluate P (exp(jw)) and Q(exp(jw)) using a grid of points between 0
+ and pi.
+
+ The zeros (roots) of P(z) also happen to alternate, which is why we
+ swap coefficients as we find roots. So the process of finding the
+ LSP frequencies is basically finding the roots of 5th order
+ polynomials.
+
+ The root so P(z) and Q(z) occur in symmetrical pairs at +/-w, hence
+ the name Line Spectrum Pairs (LSPs).
+
+ To convert back to ak we just evaluate (1), "clocking" an impulse
+ thru it lpcrdr times gives us the impulse response of A(z) which is
+ {ak}.
+
+\*---------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: cheb_poly_eva()
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/2/93
+
+ This function evalutes a series of chebyshev polynomials
+
+ FIXME: performing memory allocation at run time is very inefficient,
+ replace with stack variables of MAX_P size.
+
+\*---------------------------------------------------------------------------*/
+
+
+static float
+cheb_poly_eva(float *coef,float x,int m)
+/* float coef[] coefficients of the polynomial to be evaluated */
+/* float x the point where polynomial is to be evaluated */
+/* int m order of the polynomial */
+{
+ int i;
+ float *t,*u,*v,sum;
+ float T[(LSP_MAX_ORDER / 2) + 1];
+
+ /* Initialise pointers */
+
+ t = T; /* T[i-2] */
+ *t++ = 1.0;
+ u = t--; /* T[i-1] */
+ *u++ = x;
+ v = u--; /* T[i] */
+
+ /* Evaluate chebyshev series formulation using iterative approach */
+
+ for(i=2;i<=m/2;i++)
+ *v++ = (2*x)*(*u++) - *t++; /* T[i] = 2*x*T[i-1] - T[i-2] */
+
+ sum=0.0; /* initialise sum to zero */
+ t = T; /* reset pointer */
+
+ /* Evaluate polynomial and return value also free memory space */
+
+ for(i=0;i<=m/2;i++)
+ sum+=coef[(m/2)-i]**t++;
+
+ return sum;
+}
+
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: lpc_to_lsp()
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/2/93
+
+ This function converts LPC coefficients to LSP coefficients.
+
+\*---------------------------------------------------------------------------*/
+
+int lpc_to_lsp (float *a, int lpcrdr, float *freq, int nb, float delta)
+/* float *a lpc coefficients */
+/* int lpcrdr order of LPC coefficients (10) */
+/* float *freq LSP frequencies in radians */
+/* int nb number of sub-intervals (4) */
+/* float delta grid spacing interval (0.02) */
+{
+ float psuml,psumr,psumm,temp_xr,xl,xr,xm = 0;
+ float temp_psumr;
+ int i,j,m,flag,k;
+ float *px; /* ptrs of respective P'(z) & Q'(z) */
+ float *qx;
+ float *p;
+ float *q;
+ float *pt; /* ptr used for cheb_poly_eval()
+ whether P' or Q' */
+ int roots=0; /* number of roots found */
+ float Q[LSP_MAX_ORDER + 1];
+ float P[LSP_MAX_ORDER + 1];
+
+ flag = 1;
+ m = lpcrdr/2; /* order of P'(z) & Q'(z) polynimials */
+
+ /* Allocate memory space for polynomials */
+
+ /* determine P'(z)'s and Q'(z)'s coefficients where
+ P'(z) = P(z)/(1 + z^(-1)) and Q'(z) = Q(z)/(1-z^(-1)) */
+
+ px = P; /* initilaise ptrs */
+ qx = Q;
+ p = px;
+ q = qx;
+ *px++ = 1.0;
+ *qx++ = 1.0;
+ for(i=1;i<=m;i++){
+ *px++ = a[i]+a[lpcrdr+1-i]-*p++;
+ *qx++ = a[i]-a[lpcrdr+1-i]+*q++;
+ }
+ px = P;
+ qx = Q;
+ for(i=0;i<m;i++){
+ *px = 2**px;
+ *qx = 2**qx;
+ px++;
+ qx++;
+ }
+ px = P; /* re-initialise ptrs */
+ qx = Q;
+
+ /* Search for a zero in P'(z) polynomial first and then alternate to Q'(z).
+ Keep alternating between the two polynomials as each zero is found */
+
+ xr = 0; /* initialise xr to zero */
+ xl = 1.0; /* start at point xl = 1 */
+
+
+ for(j=0;j<lpcrdr;j++){
+ if(j%2) /* determines whether P' or Q' is eval. */
+ pt = qx;
+ else
+ pt = px;
+
+ psuml = cheb_poly_eva(pt,xl,lpcrdr); /* evals poly. at xl */
+ flag = 1;
+ while(flag && (xr >= -1.0)){
+ xr = xl - delta ; /* interval spacing */
+ psumr = cheb_poly_eva(pt,xr,lpcrdr);/* poly(xl-delta_x) */
+ temp_psumr = psumr;
+ temp_xr = xr;
+
+ /* if no sign change increment xr and re-evaluate
+ poly(xr). Repeat til sign change. if a sign change has
+ occurred the interval is bisected and then checked again
+ for a sign change which determines in which interval the
+ zero lies in. If there is no sign change between poly(xm)
+ and poly(xl) set interval between xm and xr else set
+ interval between xl and xr and repeat till root is located
+ within the specified limits */
+
+ if((psumr*psuml)<0.0){
+ roots++;
+
+ psumm=psuml;
+ for(k=0;k<=nb;k++){
+ xm = (xl+xr)/2; /* bisect the interval */
+ psumm=cheb_poly_eva(pt,xm,lpcrdr);
+ if(psumm*psuml>0.){
+ psuml=psumm;
+ xl=xm;
+ }
+ else{
+ psumr=psumm;
+ xr=xm;
+ }
+ }
+
+ /* once zero is found, reset initial interval to xr */
+ freq[j] = (xm);
+ xl = xm;
+ flag = 0; /* reset flag for next search */
+ }
+ else{
+ psuml=temp_psumr;
+ xl=temp_xr;
+ }
+ }
+ }
+
+ /* convert from x domain to radians */
+
+ for(i=0; i<lpcrdr; i++) {
+ freq[i] = acos(freq[i]);
+ }
+
+ return(roots);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: lsp_to_lpc()
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/2/93
+
+ This function converts LSP coefficients to LPC coefficients. In the
+ Speex code we worked out a way to simplify this significantly.
+
+\*---------------------------------------------------------------------------*/
+
+void lsp_to_lpc(float *lsp, float *ak, int lpcrdr)
+/* float *freq array of LSP frequencies in radians */
+/* float *ak array of LPC coefficients */
+/* int lpcrdr order of LPC coefficients */
+
+
+{
+ int i,j;
+ float xout1,xout2,xin1,xin2;
+ float *pw,*n1,*n2,*n3,*n4 = 0;
+ int m = lpcrdr/2;
+ float freq[LSP_MAX_ORDER];
+ float Wp[(LSP_MAX_ORDER * 4) + 2];
+
+ /* convert from radians to the x=cos(w) domain */
+
+ for(i=0; i<lpcrdr; i++)
+ freq[i] = cos(lsp[i]);
+
+ pw = Wp;
+
+ /* initialise contents of array */
+
+ for(i=0;i<=4*m+1;i++){ /* set contents of buffer to 0 */
+ *pw++ = 0.0;
+ }
+
+ /* Set pointers up */
+
+ pw = Wp;
+ xin1 = 1.0;
+ xin2 = 1.0;
+
+ /* reconstruct P(z) and Q(z) by cascading second order polynomials
+ in form 1 - 2xz(-1) +z(-2), where x is the LSP coefficient */
+
+ for(j=0;j<=lpcrdr;j++){
+ for(i=0;i<m;i++){
+ n1 = pw+(i*4);
+ n2 = n1 + 1;
+ n3 = n2 + 1;
+ n4 = n3 + 1;
+ xout1 = xin1 - 2*(freq[2*i]) * *n1 + *n2;
+ xout2 = xin2 - 2*(freq[2*i+1]) * *n3 + *n4;
+ *n2 = *n1;
+ *n4 = *n3;
+ *n1 = xin1;
+ *n3 = xin2;
+ xin1 = xout1;
+ xin2 = xout2;
+ }
+ xout1 = xin1 + *(n4+1);
+ xout2 = xin2 - *(n4+2);
+ ak[j] = (xout1 + xout2)*0.5;
+ *(n4+1) = xin1;
+ *(n4+2) = xin2;
+
+ xin1 = 0.0;
+ xin2 = 0.0;
+ }
+}
+
diff --git a/gr-vocoder/lib/codec2/lsp.h b/gr-vocoder/lib/codec2/lsp.h
new file mode 100644
index 000000000..5acef0184
--- /dev/null
+++ b/gr-vocoder/lib/codec2/lsp.h
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: lsp.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 24/2/93
+
+
+ This file contains functions for LPC to LSP conversion and LSP to
+ LPC conversion. Note that the LSP coefficients are not in radians
+ format but in the x domain of the unit circle.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __LSP__
+#define __LSP__
+
+int lpc_to_lsp (float *a, int lpcrdr, float *freq, int nb, float delta);
+void lsp_to_lpc(float *freq, float *ak, int lpcrdr);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/nlp.c b/gr-vocoder/lib/codec2/nlp.c
new file mode 100644
index 000000000..42ae90919
--- /dev/null
+++ b/gr-vocoder/lib/codec2/nlp.c
@@ -0,0 +1,364 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: nlp.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/3/93
+
+ Non Linear Pitch (NLP) estimation functions.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "defines.h"
+#include "nlp.h"
+#include "dump.h"
+#include "fft.h"
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+
+/*---------------------------------------------------------------------------*\
+
+ DEFINES
+
+\*---------------------------------------------------------------------------*/
+
+#define PMAX_M 600 /* maximum NLP analysis window size */
+#define COEFF 0.95 /* notch filter parameter */
+#define PE_FFT_SIZE 512 /* DFT size for pitch estimation */
+#define DEC 5 /* decimation factor */
+#define SAMPLE_RATE 8000
+#define PI 3.141592654 /* mathematical constant */
+#define T 0.1 /* threshold for local minima candidate */
+#define F0_MAX 500
+#define CNLP 0.3 /* post processor constant */
+#define NLP_NTAP 48 /* Decimation LPF order */
+
+/*---------------------------------------------------------------------------*\
+
+ GLOBALS
+
+\*---------------------------------------------------------------------------*/
+
+/* 48 tap 600Hz low pass FIR filter coefficients */
+
+const float nlp_fir[] = {
+ -1.0818124e-03,
+ -1.1008344e-03,
+ -9.2768838e-04,
+ -4.2289438e-04,
+ 5.5034190e-04,
+ 2.0029849e-03,
+ 3.7058509e-03,
+ 5.1449415e-03,
+ 5.5924666e-03,
+ 4.3036754e-03,
+ 8.0284511e-04,
+ -4.8204610e-03,
+ -1.1705810e-02,
+ -1.8199275e-02,
+ -2.2065282e-02,
+ -2.0920610e-02,
+ -1.2808831e-02,
+ 3.2204775e-03,
+ 2.6683811e-02,
+ 5.5520624e-02,
+ 8.6305944e-02,
+ 1.1480192e-01,
+ 1.3674206e-01,
+ 1.4867556e-01,
+ 1.4867556e-01,
+ 1.3674206e-01,
+ 1.1480192e-01,
+ 8.6305944e-02,
+ 5.5520624e-02,
+ 2.6683811e-02,
+ 3.2204775e-03,
+ -1.2808831e-02,
+ -2.0920610e-02,
+ -2.2065282e-02,
+ -1.8199275e-02,
+ -1.1705810e-02,
+ -4.8204610e-03,
+ 8.0284511e-04,
+ 4.3036754e-03,
+ 5.5924666e-03,
+ 5.1449415e-03,
+ 3.7058509e-03,
+ 2.0029849e-03,
+ 5.5034190e-04,
+ -4.2289438e-04,
+ -9.2768838e-04,
+ -1.1008344e-03,
+ -1.0818124e-03
+};
+
+typedef struct {
+ float sq[PMAX_M]; /* squared speech samples */
+ float mem_x,mem_y; /* memory for notch filter */
+ float mem_fir[NLP_NTAP]; /* decimation FIR filter memory */
+} NLP;
+
+float post_process_mbe(COMP Fw[], int pmin, int pmax, float gmax);
+float post_process_sub_multiples(COMP Fw[],
+ int pmin, int pmax, float gmax, int gmax_bin,
+ float *prev_Wo);
+
+/*---------------------------------------------------------------------------*\
+
+ nlp_create()
+
+ Initialisation function for NLP pitch estimator.
+
+\*---------------------------------------------------------------------------*/
+
+void *nlp_create()
+{
+ NLP *nlp;
+ int i;
+
+ nlp = (NLP*)malloc(sizeof(NLP));
+ if (nlp == NULL)
+ return NULL;
+
+ for(i=0; i<PMAX_M; i++)
+ nlp->sq[i] = 0.0;
+ nlp->mem_x = 0.0;
+ nlp->mem_y = 0.0;
+ for(i=0; i<NLP_NTAP; i++)
+ nlp->mem_fir[i] = 0.0;
+
+ return (void*)nlp;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ nlp_destory()
+
+ Initialisation function for NLP pitch estimator.
+
+\*---------------------------------------------------------------------------*/
+
+void nlp_destroy(void *nlp_state)
+{
+ assert(nlp_state != NULL);
+ free(nlp_state);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ nlp()
+
+ Determines the pitch in samples using the Non Linear Pitch (NLP)
+ algorithm [1]. Returns the fundamental in Hz. Note that the actual
+ pitch estimate is for the centre of the M sample Sn[] vector, not
+ the current N sample input vector. This is (I think) a delay of 2.5
+ frames with N=80 samples. You should align further analysis using
+ this pitch estimate to be centred on the middle of Sn[].
+
+ Two post processors have been tried, the MBE version (as discussed
+ in [1]), and a post processor that checks sub-multiples. Both
+ suffer occasional gross pitch errors (i.e. neither are perfect). In
+ the presence of background noise the sub-multiple algorithm tends
+ towards low F0 which leads to better sounding background noise than
+ the MBE post processor.
+
+ A good way to test and develop the NLP pitch estimator is using the
+ tnlp (codec2/unittest) and the codec2/octave/plnlp.m Octave script.
+
+ A pitch tracker searching a few frames forward and backward in time
+ would be a useful addition.
+
+ References:
+
+ [1] http://www.itr.unisa.edu.au/~steven/thesis/dgr.pdf Chapter 4
+
+\*---------------------------------------------------------------------------*/
+
+float nlp(
+ void *nlp_state,
+ float Sn[], /* input speech vector */
+ int n, /* frames shift (no. new samples in Sn[]) */
+ int m, /* analysis window size */
+ int pmin, /* minimum pitch value */
+ int pmax, /* maximum pitch value */
+ float *pitch, /* estimated pitch period in samples */
+ COMP Sw[], /* Freq domain version of Sn[] */
+ float *prev_Wo
+)
+{
+ NLP *nlp;
+ float notch; /* current notch filter output */
+ COMP Fw[PE_FFT_SIZE]; /* DFT of squared signal */
+ float gmax;
+ int gmax_bin;
+ int i,j;
+ float best_f0;
+
+ assert(nlp_state != NULL);
+ nlp = (NLP*)nlp_state;
+
+ /* Square, notch filter at DC, and LP filter vector */
+
+ for(i=m-n; i<M; i++) /* square latest speech samples */
+ nlp->sq[i] = Sn[i]*Sn[i];
+
+ for(i=m-n; i<m; i++) { /* notch filter at DC */
+ notch = nlp->sq[i] - nlp->mem_x;
+ notch += COEFF*nlp->mem_y;
+ nlp->mem_x = nlp->sq[i];
+ nlp->mem_y = notch;
+ nlp->sq[i] = notch;
+ }
+
+ for(i=m-n; i<m; i++) { /* FIR filter vector */
+
+ for(j=0; j<NLP_NTAP-1; j++)
+ nlp->mem_fir[j] = nlp->mem_fir[j+1];
+ nlp->mem_fir[NLP_NTAP-1] = nlp->sq[i];
+
+ nlp->sq[i] = 0.0;
+ for(j=0; j<NLP_NTAP; j++)
+ nlp->sq[i] += nlp->mem_fir[j]*nlp_fir[j];
+ }
+
+ /* Decimate and DFT */
+
+ for(i=0; i<PE_FFT_SIZE; i++) {
+ Fw[i].real = 0.0;
+ Fw[i].imag = 0.0;
+ }
+ for(i=0; i<m/DEC; i++) {
+ Fw[i].real = nlp->sq[i*DEC]*(0.5 - 0.5*cos(2*PI*i/(m/DEC-1)));
+ }
+#ifdef DUMP
+ dump_dec(Fw);
+#endif
+ fft(&Fw[0].real,PE_FFT_SIZE,1);
+ for(i=0; i<PE_FFT_SIZE; i++)
+ Fw[i].real = Fw[i].real*Fw[i].real + Fw[i].imag*Fw[i].imag;
+
+#ifdef DUMP
+ dump_sq(nlp->sq);
+ dump_Fw(Fw);
+#endif
+
+ /* find global peak */
+
+ gmax = 0.0;
+ gmax_bin = PE_FFT_SIZE*DEC/pmax;
+ for(i=PE_FFT_SIZE*DEC/pmax; i<=PE_FFT_SIZE*DEC/pmin; i++) {
+ if (Fw[i].real > gmax) {
+ gmax = Fw[i].real;
+ gmax_bin = i;
+ }
+ }
+
+ best_f0 = post_process_sub_multiples(Fw, pmin, pmax, gmax, gmax_bin,
+ prev_Wo);
+
+ /* Shift samples in buffer to make room for new samples */
+
+ for(i=0; i<m-n; i++)
+ nlp->sq[i] = nlp->sq[i+n];
+
+ /* return pitch and F0 estimate */
+
+ *pitch = (float)SAMPLE_RATE/best_f0;
+ return(best_f0);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ post_process_sub_multiples()
+
+ Given the global maximma of Fw[] we search interger submultiples for
+ local maxima. If local maxima exist and they are above an
+ experimentally derived threshold (OK a magic number I pulled out of
+ the air) we choose the submultiple as the F0 estimate.
+
+ The rational for this is that the lowest frequency peak of Fw[]
+ should be F0, as Fw[] can be considered the autocorrelation function
+ of Sw[] (the speech spectrum). However sometimes due to phase
+ effects the lowest frequency maxima may not be the global maxima.
+
+ This works OK in practice and favours low F0 values in the presence
+ of background noise which means the sinusoidal codec does an OK job
+ of synthesising the background noise. High F0 in background noise
+ tends to sound more periodic introducing annoying artifacts.
+
+\*---------------------------------------------------------------------------*/
+
+float post_process_sub_multiples(COMP Fw[],
+ int pmin, int pmax, float gmax, int gmax_bin,
+ float *prev_Wo)
+{
+ int min_bin, cmax_bin;
+ int mult;
+ float thresh, best_f0;
+ int b, bmin, bmax, lmax_bin;
+ float lmax, cmax;
+ int prev_f0_bin;
+
+ /* post process estimate by searching submultiples */
+
+ mult = 2;
+ min_bin = PE_FFT_SIZE*DEC/pmax;
+ cmax_bin = gmax_bin;
+ prev_f0_bin = *prev_Wo*(4000.0/PI)*(PE_FFT_SIZE*DEC)/SAMPLE_RATE;
+
+ while(gmax_bin/mult >= min_bin) {
+
+ b = gmax_bin/mult; /* determine search interval */
+ bmin = 0.8*b;
+ bmax = 1.2*b;
+ if (bmin < min_bin)
+ bmin = min_bin;
+
+ /* lower threshold to favour previous frames pitch estimate,
+ this is a form of pitch tracking */
+
+ if ((prev_f0_bin > bmin) && (prev_f0_bin < bmax))
+ thresh = CNLP*0.5*gmax;
+ else
+ thresh = CNLP*gmax;
+
+ lmax = 0;
+ lmax_bin = bmin;
+ for (b=bmin; b<=bmax; b++) /* look for maximum in interval */
+ if (Fw[b].real > lmax) {
+ lmax = Fw[b].real;
+ lmax_bin = b;
+ }
+
+ if (lmax > thresh)
+ if ((lmax > Fw[lmax_bin-1].real) && (lmax > Fw[lmax_bin+1].real)) {
+ cmax = lmax;
+ cmax_bin = lmax_bin;
+ }
+
+ mult++;
+ }
+
+ best_f0 = (float)cmax_bin*SAMPLE_RATE/(PE_FFT_SIZE*DEC);
+
+ return best_f0;
+}
+
diff --git a/gr-vocoder/lib/codec2/nlp.h b/gr-vocoder/lib/codec2/nlp.h
new file mode 100644
index 000000000..88a3733dc
--- /dev/null
+++ b/gr-vocoder/lib/codec2/nlp.h
@@ -0,0 +1,39 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: nlp.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 23/3/93
+
+ Non Linear Pitch (NLP) estimation functions.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __NLP__
+#define __NLP__
+
+#include "comp.h"
+
+void *nlp_create();
+void nlp_destroy(void *nlp_state);
+float nlp(void *nlp_state, float Sn[], int n, int m, int pmin, int pmax,
+ float *pitch, COMP Sw[], float *prev_Wo);
+float test_candidate_mbe(COMP Sw[], float f0, COMP Sw_[]);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/pack.c b/gr-vocoder/lib/codec2/pack.c
new file mode 100644
index 000000000..31551dfc4
--- /dev/null
+++ b/gr-vocoder/lib/codec2/pack.c
@@ -0,0 +1,105 @@
+/*
+ Copyright (C) 2010 Perens LLC <bruce@perens.com>
+
+ This program 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 of the License, or
+ (at your option) any later version.
+
+ This program 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, see <http://www.gnu.org/licenses/>.
+
+ */
+#include "defines.h"
+#include "quantise.h"
+#include <stdio.h>
+
+/* Compile-time constants */
+/* Size of unsigned char in bits. Assumes 8 bits-per-char. */
+static const unsigned int WordSize = 8;
+
+/* Mask to pick the bit component out of bitIndex. */
+static const unsigned int IndexMask = 0x7;
+
+/* Used to pick the word component out of bitIndex. */
+static const unsigned int ShiftRight = 3;
+
+/** Pack a bit field into a bit string, encoding the field in Gray code.
+ *
+ * The output is an array of unsigned char data. The fields are efficiently
+ * packed into the bit string. The Gray coding is a naive attempt to reduce
+ * the effect of single-bit errors, we expect to do a better job as the
+ * codec develops.
+ *
+ * This code would be simpler if it just set one bit at a time in the string,
+ * but would hit the same cache line more often. I'm not sure the complexity
+ * gains us anything here.
+ *
+ * Although field is currently of int type rather than unsigned for
+ * compatibility with the rest of the code, indices are always expected to
+ * be >= 0.
+ */
+void
+pack(
+ unsigned char * bitArray, /* The output bit string. */
+ unsigned int * bitIndex, /* Index into the string in BITS, not bytes.*/
+ int field, /* The bit field to be packed. */
+ unsigned int fieldWidth/* Width of the field in BITS, not bytes. */
+ )
+{
+ /* Convert the field to Gray code */
+ field = (field >> 1) ^ field;
+
+ do {
+ unsigned int bI = *bitIndex;
+ unsigned int bitsLeft = WordSize - (bI & IndexMask);
+ unsigned int sliceWidth =
+ bitsLeft < fieldWidth ? bitsLeft : fieldWidth;
+ unsigned int wordIndex = bI >> ShiftRight;
+
+ bitArray[wordIndex] |=
+ ((unsigned char)((field >> (fieldWidth - sliceWidth))
+ << (bitsLeft - sliceWidth)));
+
+ *bitIndex = bI + sliceWidth;
+ fieldWidth -= sliceWidth;
+ } while ( fieldWidth != 0 );
+}
+
+/** Unpack a field from a bit string, converting from Gray code to binary.
+ *
+ */
+int
+unpack(
+ const unsigned char * bitArray, /* The input bit string. */
+ unsigned int * bitIndex, /* Index into the string in BITS, not bytes.*/
+ unsigned int fieldWidth/* Width of the field in BITS, not bytes. */
+ )
+{
+ unsigned int field = 0;
+ unsigned int t;
+
+ do {
+ unsigned int bI = *bitIndex;
+ unsigned int bitsLeft = WordSize - (bI & IndexMask);
+ unsigned int sliceWidth =
+ bitsLeft < fieldWidth ? bitsLeft : fieldWidth;
+
+ field |= (((bitArray[bI >> ShiftRight] >> (bitsLeft - sliceWidth)) & ((1 << sliceWidth) - 1)) << (fieldWidth - sliceWidth));
+
+ *bitIndex = bI + sliceWidth;
+ fieldWidth -= sliceWidth;
+ } while ( fieldWidth != 0 );
+
+ /* Convert from Gray code to binary. Works for maximum 8-bit fields. */
+ t = field ^ (field >> 8);
+ t ^= (t >> 4);
+ t ^= (t >> 2);
+ t ^= (t >> 1);
+ return t;
+}
diff --git a/gr-vocoder/lib/codec2/phase.c b/gr-vocoder/lib/codec2/phase.c
new file mode 100644
index 000000000..0e1a14a60
--- /dev/null
+++ b/gr-vocoder/lib/codec2/phase.c
@@ -0,0 +1,262 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: phase.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 1/2/09
+
+ Functions for modelling and synthesising phase.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not,see <http://www.gnu.org/licenses/>.
+*/
+
+#include "defines.h"
+#include "phase.h"
+#include "fft.h"
+#include "comp.h"
+#include "glottal.c"
+
+#include <assert.h>
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define GLOTTAL_FFT_SIZE 512
+
+/*---------------------------------------------------------------------------*\
+
+ aks_to_H()
+
+ Samples the complex LPC synthesis filter spectrum at the harmonic
+ frequencies.
+
+\*---------------------------------------------------------------------------*/
+
+void aks_to_H(
+ MODEL *model, /* model parameters */
+ float aks[], /* LPC's */
+ float G, /* energy term */
+ COMP H[], /* complex LPC spectral samples */
+ int order
+)
+{
+ COMP Pw[FFT_DEC]; /* power spectrum */
+ int i,m; /* loop variables */
+ int am,bm; /* limits of current band */
+ float r; /* no. rads/bin */
+ float Em; /* energy in band */
+ float Am; /* spectral amplitude sample */
+ int b; /* centre bin of harmonic */
+ float phi_; /* phase of LPC spectra */
+
+ r = TWO_PI/(FFT_DEC);
+
+ /* Determine DFT of A(exp(jw)) ------------------------------------------*/
+
+ for(i=0; i<FFT_DEC; i++) {
+ Pw[i].real = 0.0;
+ Pw[i].imag = 0.0;
+ }
+
+ for(i=0; i<=order; i++)
+ Pw[i].real = aks[i];
+
+ fft(&Pw[0].real,FFT_DEC,-1);
+
+ /* Sample magnitude and phase at harmonics */
+
+ for(m=1; m<=model->L; m++) {
+ am = floor((m - 0.5)*model->Wo/r + 0.5);
+ bm = floor((m + 0.5)*model->Wo/r + 0.5);
+ b = floor(m*model->Wo/r + 0.5);
+
+ Em = 0.0;
+ for(i=am; i<bm; i++)
+ Em += G/(Pw[i].real*Pw[i].real + Pw[i].imag*Pw[i].imag);
+ Am = sqrt(fabs(Em/(bm-am)));
+
+ phi_ = -atan2(Pw[b].imag,Pw[b].real);
+ H[m].real = Am*cos(phi_);
+ H[m].imag = Am*sin(phi_);
+ }
+}
+
+
+/*---------------------------------------------------------------------------*\
+
+ phase_synth_zero_order()
+
+ Synthesises phases based on SNR and a rule based approach. No phase
+ parameters are required apart from the SNR (which can be reduced to a
+ 1 bit V/UV decision per frame).
+
+ The phase of each harmonic is modelled as the phase of a LPC
+ synthesis filter excited by an impulse. Unlike the first order
+ model the position of the impulse is not transmitted, so we create
+ an excitation pulse train using a rule based approach.
+
+ Consider a pulse train with a pulse starting time n=0, with pulses
+ repeated at a rate of Wo, the fundamental frequency. A pulse train
+ in the time domain is equivalent to harmonics in the frequency
+ domain. We can make an excitation pulse train using a sum of
+ sinsusoids:
+
+ for(m=1; m<=L; m++)
+ ex[n] = cos(m*Wo*n)
+
+ Note: the Octave script ../octave/phase.m is an example of this if
+ you would like to try making a pulse train.
+
+ The phase of each excitation harmonic is:
+
+ arg(E[m]) = mWo
+
+ where E[m] are the complex excitation (freq domain) samples,
+ arg(x), just returns the phase of a complex sample x.
+
+ As we don't transmit the pulse position for this model, we need to
+ synthesise it. Now the excitation pulses occur at a rate of Wo.
+ This means the phase of the first harmonic advances by N samples
+ over a synthesis frame of N samples. For example if Wo is pi/20
+ (200 Hz), then over a 10ms frame (N=80 samples), the phase of the
+ first harmonic would advance (pi/20)*80 = 4*pi or two complete
+ cycles.
+
+ We generate the excitation phase of the fundamental (first
+ harmonic):
+
+ arg[E[1]] = Wo*N;
+
+ We then relate the phase of the m-th excitation harmonic to the
+ phase of the fundamental as:
+
+ arg(E[m]) = m*arg(E[1])
+
+ This E[m] then gets passed through the LPC synthesis filter to
+ determine the final harmonic phase.
+
+ Comparing to speech synthesised using original phases:
+
+ - Through headphones speech synthesised with this model is not as
+ good. Through a loudspeaker it is very close to original phases.
+
+ - If there are voicing errors, the speech can sound clicky or
+ staticy. If V speech is mistakenly declared UV, this model tends to
+ synthesise impulses or clicks, as there is usually very little shift or
+ dispersion through the LPC filter.
+
+ - When combined with LPC amplitude modelling there is an additional
+ drop in quality. I am not sure why, theory is interformant energy
+ is raised making any phase errors more obvious.
+
+ NOTES:
+
+ 1/ This synthesis model is effectively the same as a simple LPC-10
+ vocoders, and yet sounds much better. Why? Conventional wisdom
+ (AMBE, MELP) says mixed voicing is required for high quality
+ speech.
+
+ 2/ I am pretty sure the Lincoln Lab sinusoidal coding guys (like xMBE
+ also from MIT) first described this zero phase model, I need to look
+ up the paper.
+
+ 3/ Note that this approach could cause some discontinuities in
+ the phase at the edge of synthesis frames, as no attempt is made
+ to make sure that the phase tracks are continuous (the excitation
+ phases are continuous, but not the final phases after filtering
+ by the LPC spectra). Technically this is a bad thing. However
+ this may actually be a good thing, disturbing the phase tracks a
+ bit. More research needed, e.g. test a synthesis model that adds
+ a small delta-W to make phase tracks line up for voiced
+ harmonics.
+
+\*---------------------------------------------------------------------------*/
+
+void phase_synth_zero_order(
+ MODEL *model,
+ float aks[],
+ float *ex_phase, /* excitation phase of fundamental */
+ int order
+)
+{
+ int m;
+ float new_phi;
+ COMP Ex[MAX_AMP]; /* excitation samples */
+ COMP A_[MAX_AMP]; /* synthesised harmonic samples */
+ COMP H[MAX_AMP]; /* LPC freq domain samples */
+ float G;
+ float jitter = 0.0;
+ float r;
+ int b;
+
+ G = 1.0;
+ aks_to_H(model, aks, G, H, order);
+
+ /*
+ Update excitation fundamental phase track, this sets the position
+ of each pitch pulse during voiced speech. After much experiment
+ I found that using just this frame's Wo improved quality for UV
+ sounds compared to interpolating two frames Wo like this:
+
+ ex_phase[0] += (*prev_Wo+mode->Wo)*N/2;
+ */
+
+ ex_phase[0] += (model->Wo)*N;
+ ex_phase[0] -= TWO_PI*floor(ex_phase[0]/TWO_PI + 0.5);
+ r = TWO_PI/GLOTTAL_FFT_SIZE;
+
+ for(m=1; m<=model->L; m++) {
+
+ /* generate excitation */
+
+ if (model->voiced) {
+ /* I think adding a little jitter helps improve low pitch
+ males like hts1a. This moves the onset of each harmonic
+ over at +/- 0.25 of a sample.
+ */
+ jitter = 0.25*(1.0 - 2.0*rand()/RAND_MAX);
+ b = floor(m*model->Wo/r + 0.5);
+ if (b > ((GLOTTAL_FFT_SIZE/2)-1)) {
+ b = (GLOTTAL_FFT_SIZE/2)-1;
+ }
+ Ex[m].real = cos(ex_phase[0]*m - jitter*model->Wo*m + glottal[b]);
+ Ex[m].imag = sin(ex_phase[0]*m - jitter*model->Wo*m + glottal[b]);
+ }
+ else {
+
+ /* When a few samples were tested I found that LPC filter
+ phase is not needed in the unvoiced case, but no harm in
+ keeping it.
+ */
+ float phi = TWO_PI*(float)rand()/RAND_MAX;
+ Ex[m].real = cos(phi);
+ Ex[m].imag = sin(phi);
+ }
+
+ /* filter using LPC filter */
+
+ A_[m].real = H[m].real*Ex[m].real - H[m].imag*Ex[m].imag;
+ A_[m].imag = H[m].imag*Ex[m].real + H[m].real*Ex[m].imag;
+
+ /* modify sinusoidal phase */
+
+ new_phi = atan2(A_[m].imag, A_[m].real+1E-12);
+ model->phi[m] = new_phi;
+ }
+
+}
diff --git a/gr-vocoder/lib/codec2/phase.h b/gr-vocoder/lib/codec2/phase.h
new file mode 100644
index 000000000..833bc7cdc
--- /dev/null
+++ b/gr-vocoder/lib/codec2/phase.h
@@ -0,0 +1,34 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: phase.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 1/2/09
+
+ Functions for modelling phase.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __PHASE__
+#define __PHASE__
+
+void phase_synth_zero_order(MODEL *model, float aks[], float *ex_phase,
+ int order);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/postfilter.c b/gr-vocoder/lib/codec2/postfilter.c
new file mode 100644
index 000000000..6e17eeb87
--- /dev/null
+++ b/gr-vocoder/lib/codec2/postfilter.c
@@ -0,0 +1,133 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: postfilter.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 13/09/09
+
+ Postfilter to improve sound quality for speech with high levels of
+ background noise. Unlike mixed-excitation models requires no bits
+ to be transmitted to handle background noise.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "defines.h"
+#include "comp.h"
+#include "dump.h"
+#include "postfilter.h"
+
+/*---------------------------------------------------------------------------*\
+
+ DEFINES
+
+\*---------------------------------------------------------------------------*/
+
+#define BG_THRESH 40.0 /* only consider low levels signals for bg_est */
+#define BG_BETA 0.1 /* averaging filter constant */
+
+/*---------------------------------------------------------------------------*\
+
+ postfilter()
+
+ The post filter is designed to help with speech corrupted by
+ background noise. The zero phase model tends to make speech with
+ background noise sound "clicky". With high levels of background
+ noise the low level inter-formant parts of the spectrum will contain
+ noise rather than speech harmonics, so modelling them as voiced
+ (i.e. a continuous, non-random phase track) is inaccurate.
+
+ Some codecs (like MBE) have a mixed voicing model that breaks the
+ spectrum into voiced and unvoiced regions. Several bits/frame
+ (5-12) are required to transmit the frequency selective voicing
+ information. Mixed excitation also requires accurate voicing
+ estimation (parameter estimators always break occasionally under
+ exceptional condition).
+
+ In our case we use a post filter approach which requires no
+ additional bits to be transmitted. The decoder measures the average
+ level of the background noise during unvoiced frames. If a harmonic
+ is less than this level it is made unvoiced by randomising it's
+ phases.
+
+ This idea is rather experimental. Some potential problems that may
+ happen:
+
+ 1/ If someone says "aaaaaaaahhhhhhhhh" will background estimator track
+ up to speech level? This would be a bad thing.
+
+ 2/ If background noise suddenly dissapears from the source speech does
+ estimate drop quickly? What is noise suddenly re-appears?
+
+ 3/ Background noise with a non-flat sepctrum. Current algorithm just
+ comsiders scpetrum as a whole, but this could be broken up into
+ bands, each with their own estimator.
+
+ 4/ Males and females with the same level of background noise. Check
+ performance the same. Changing Wo affects width of each band, may
+ affect bg energy estimates.
+
+ 5/ Not sure what happens during long periods of voiced speech
+ e.g. "sshhhhhhh"
+
+\*---------------------------------------------------------------------------*/
+
+void postfilter(
+ MODEL *model,
+ float *bg_est
+)
+{
+ int m, uv;
+ float e;
+
+ /* determine average energy across spectrum */
+
+ e = 0.0;
+ for(m=1; m<=model->L; m++)
+ e += model->A[m]*model->A[m];
+
+ e = 10.0*log10(e/model->L);
+
+ /* If beneath threhold, update bg estimate. The idea
+ of the threshold is to prevent updating during high level
+ speech. */
+
+ if ((e < BG_THRESH) && !model->voiced)
+ *bg_est = *bg_est*(1.0 - BG_BETA) + e*BG_BETA;
+
+ /* now mess with phases during voiced frames to make any harmonics
+ less then our background estimate unvoiced.
+ */
+
+ uv = 0;
+ if (model->voiced)
+ for(m=1; m<=model->L; m++)
+ if (20.0*log10(model->A[m]) < *bg_est) {
+ model->phi[m] = TWO_PI*(float)rand()/RAND_MAX;
+ uv++;
+ }
+
+#ifdef DUMP
+ dump_bg(e, *bg_est, 100.0*uv/model->L);
+#endif
+
+}
diff --git a/gr-vocoder/lib/codec2/postfilter.h b/gr-vocoder/lib/codec2/postfilter.h
new file mode 100644
index 000000000..bf080b1b6
--- /dev/null
+++ b/gr-vocoder/lib/codec2/postfilter.h
@@ -0,0 +1,33 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: postfilter.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 13/09/09
+
+ Postfilter header file.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __POSTFILTER__
+#define __POSTFILTER__
+
+void postfilter(MODEL *model, float *bg_est);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/quantise.c b/gr-vocoder/lib/codec2/quantise.c
new file mode 100644
index 000000000..ff8d156b5
--- /dev/null
+++ b/gr-vocoder/lib/codec2/quantise.c
@@ -0,0 +1,851 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: quantise.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 31/5/92
+
+ Quantisation functions for the sinusoidal coder.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include <assert.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "defines.h"
+#include "dump.h"
+#include "quantise.h"
+#include "lpc.h"
+#include "lsp.h"
+#include "fft.h"
+
+#define LSP_DELTA1 0.01 /* grid spacing for LSP root searches */
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION HEADERS
+
+\*---------------------------------------------------------------------------*/
+
+float speech_to_uq_lsps(float lsp[], float ak[], float Sn[], float w[],
+ int order);
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTIONS
+
+\*---------------------------------------------------------------------------*/
+
+int lsp_bits(int i) {
+ return lsp_cb[i].log2m;
+}
+
+#if VECTOR_QUANTISATION
+/*---------------------------------------------------------------------------*\
+
+ quantise_uniform
+
+ Simulates uniform quantising of a float.
+
+\*---------------------------------------------------------------------------*/
+
+void quantise_uniform(float *val, float min, float max, int bits)
+{
+ int levels = 1 << (bits-1);
+ float norm;
+ int index;
+
+ /* hard limit to quantiser range */
+
+ printf("min: %f max: %f val: %f ", min, max, val[0]);
+ if (val[0] < min) val[0] = min;
+ if (val[0] > max) val[0] = max;
+
+ norm = (*val - min)/(max-min);
+ printf("%f norm: %f ", val[0], norm);
+ index = fabs(levels*norm + 0.5);
+
+ *val = min + index*(max-min)/levels;
+
+ printf("index %d val_: %f\n", index, val[0]);
+}
+
+#endif
+
+/*---------------------------------------------------------------------------*\
+
+ quantise_init
+
+ Loads the entire LSP quantiser comprised of several vector quantisers
+ (codebooks).
+
+\*---------------------------------------------------------------------------*/
+
+void quantise_init()
+{
+}
+
+/*---------------------------------------------------------------------------*\
+
+ quantise
+
+ Quantises vec by choosing the nearest vector in codebook cb, and
+ returns the vector index. The squared error of the quantised vector
+ is added to se.
+
+\*---------------------------------------------------------------------------*/
+
+long quantise(const float * cb, float vec[], float w[], int k, int m, float *se)
+/* float cb[][K]; current VQ codebook */
+/* float vec[]; vector to quantise */
+/* float w[]; weighting vector */
+/* int k; dimension of vectors */
+/* int m; size of codebook */
+/* float *se; accumulated squared error */
+{
+ float e; /* current error */
+ long besti; /* best index so far */
+ float beste; /* best error so far */
+ long j;
+ int i;
+
+ besti = 0;
+ beste = 1E32;
+ for(j=0; j<m; j++) {
+ e = 0.0;
+ for(i=0; i<k; i++)
+ e += pow((cb[j*k+i]-vec[i])*w[i],2.0);
+ if (e < beste) {
+ beste = e;
+ besti = j;
+ }
+ }
+
+ *se += beste;
+
+ return(besti);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ lspd_quantise
+
+ Scalar lsp difference quantiser.
+
+\*---------------------------------------------------------------------------*/
+
+void lspd_quantise(
+ float lsp[],
+ float lsp_[],
+ int order
+)
+{
+ int i,k,m;
+ float lsp_hz[LPC_MAX];
+ float lsp__hz[LPC_MAX];
+ float dlsp[LPC_MAX];
+ float dlsp_[LPC_MAX];
+ float wt[1];
+ const float *cb;
+ float se;
+ int indexes[LPC_MAX];
+
+ /* convert from radians to Hz so we can use human readable
+ frequencies */
+
+ for(i=0; i<order; i++)
+ lsp_hz[i] = (4000.0/PI)*lsp[i];
+
+ dlsp[0] = lsp_hz[0];
+ for(i=1; i<order; i++)
+ dlsp[i] = lsp_hz[i] - lsp_hz[i-1];
+
+ /* simple uniform scalar quantisers */
+
+ wt[0] = 1.0;
+ for(i=0; i<order; i++) {
+ if (i)
+ dlsp[i] = lsp_hz[i] - lsp__hz[i-1];
+ else
+ dlsp[0] = lsp_hz[0];
+
+ k = lsp_cbd[i].k;
+ m = lsp_cbd[i].m;
+ cb = lsp_cbd[i].cb;
+ indexes[i] = quantise(cb, &dlsp[i], wt, k, m, &se);
+ dlsp_[i] = cb[indexes[i]*k];
+
+ if (i)
+ lsp__hz[i] = lsp__hz[i-1] + dlsp_[i];
+ else
+ lsp__hz[0] = dlsp_[0];
+ }
+ for(; i<order; i++)
+ lsp__hz[i] = lsp__hz[i-1] + dlsp[i];
+
+ /* convert back to radians */
+
+ for(i=0; i<order; i++)
+ lsp_[i] = (PI/4000.0)*lsp__hz[i];
+}
+
+/*---------------------------------------------------------------------------*\
+
+ lspd_vq_quantise
+
+ Vector lsp difference quantiser.
+
+\*---------------------------------------------------------------------------*/
+
+void lspdvq_quantise(
+ float lsp[],
+ float lsp_[],
+ int order
+)
+{
+ int i,k,m,ncb, nlsp;
+ float dlsp[LPC_MAX];
+ float dlsp_[LPC_MAX];
+ float wt[LPC_ORD];
+ const float *cb;
+ float se;
+ int index;
+
+ dlsp[0] = lsp[0];
+ for(i=1; i<order; i++)
+ dlsp[i] = lsp[i] - lsp[i-1];
+
+ for(i=0; i<order; i++)
+ dlsp_[i] = dlsp[i];
+
+ for(i=0; i<order; i++)
+ wt[i] = 1.0;
+
+ /* scalar quantise dLSPs 1,2,3,4,5 */
+
+ for(i=0; i<5; i++) {
+ if (i)
+ dlsp[i] = (lsp[i] - lsp_[i-1])*4000.0/PI;
+ else
+ dlsp[0] = lsp[0]*4000.0/PI;
+
+ k = lsp_cbdvq[i].k;
+ m = lsp_cbdvq[i].m;
+ cb = lsp_cbdvq[i].cb;
+ index = quantise(cb, &dlsp[i], wt, k, m, &se);
+ dlsp_[i] = cb[index*k]*PI/4000.0;
+
+ if (i)
+ lsp_[i] = lsp_[i-1] + dlsp_[i];
+ else
+ lsp_[0] = dlsp_[0];
+ }
+ dlsp[i] = lsp[i] - lsp_[i-1];
+ dlsp_[i] = dlsp[i];
+
+ //printf("lsp[0] %f lsp_[0] %f\n", lsp[0], lsp_[0]);
+ //printf("lsp[1] %f lsp_[1] %f\n", lsp[1], lsp_[1]);
+
+#ifdef TT
+ /* VQ dLSPs 3,4,5 */
+
+ ncb = 2;
+ nlsp = 2;
+ k = lsp_cbdvq[ncb].k;
+ m = lsp_cbdvq[ncb].m;
+ cb = lsp_cbdvq[ncb].cb;
+ index = quantise(cb, &dlsp[nlsp], wt, k, m, &se);
+ dlsp_[nlsp] = cb[index*k];
+ dlsp_[nlsp+1] = cb[index*k+1];
+ dlsp_[nlsp+2] = cb[index*k+2];
+
+ lsp_[0] = dlsp_[0];
+ for(i=1; i<5; i++)
+ lsp_[i] = lsp_[i-1] + dlsp_[i];
+ dlsp[i] = lsp[i] - lsp_[i-1];
+ dlsp_[i] = dlsp[i];
+#endif
+ /* VQ dLSPs 6,7,8,9,10 */
+
+ ncb = 5;
+ nlsp = 5;
+ k = lsp_cbdvq[ncb].k;
+ m = lsp_cbdvq[ncb].m;
+ cb = lsp_cbdvq[ncb].cb;
+ index = quantise(cb, &dlsp[nlsp], wt, k, m, &se);
+ dlsp_[nlsp] = cb[index*k];
+ dlsp_[nlsp+1] = cb[index*k+1];
+ dlsp_[nlsp+2] = cb[index*k+2];
+ dlsp_[nlsp+3] = cb[index*k+3];
+ dlsp_[nlsp+4] = cb[index*k+4];
+
+ /* rebuild LSPs for dLSPs */
+
+ lsp_[0] = dlsp_[0];
+ for(i=1; i<order; i++)
+ lsp_[i] = lsp_[i-1] + dlsp_[i];
+}
+
+void check_lsp_order(float lsp[], int lpc_order)
+{
+ int i;
+ float tmp;
+
+ for(i=1; i<lpc_order; i++)
+ if (lsp[i] < lsp[i-1]) {
+ printf("swap %d\n",i);
+ tmp = lsp[i-1];
+ lsp[i-1] = lsp[i]-0.05;
+ lsp[i] = tmp+0.05;
+ }
+}
+
+void force_min_lsp_dist(float lsp[], int lpc_order)
+{
+ int i;
+
+ for(i=1; i<lpc_order; i++)
+ if ((lsp[i]-lsp[i-1]) < 0.01) {
+ lsp[i] += 0.01;
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ lpc_model_amplitudes
+
+ Derive a LPC model for amplitude samples then estimate amplitude samples
+ from this model with optional LSP quantisation.
+
+ Returns the spectral distortion for this frame.
+
+\*---------------------------------------------------------------------------*/
+
+float lpc_model_amplitudes(
+ float Sn[], /* Input frame of speech samples */
+ float w[],
+ MODEL *model, /* sinusoidal model parameters */
+ int order, /* LPC model order */
+ int lsp_quant, /* optional LSP quantisation if non-zero */
+ float ak[] /* output aks */
+)
+{
+ float Wn[M];
+ float R[LPC_MAX+1];
+ float E;
+ int i,j;
+ float snr;
+ float lsp[LPC_MAX];
+ float lsp_hz[LPC_MAX];
+ float lsp_[LPC_MAX];
+ int roots; /* number of LSP roots found */
+ int index;
+ float se;
+ int k,m;
+ const float * cb;
+ float wt[LPC_MAX];
+
+ for(i=0; i<M; i++)
+ Wn[i] = Sn[i]*w[i];
+ autocorrelate(Wn,R,M,order);
+ levinson_durbin(R,ak,order);
+
+ E = 0.0;
+ for(i=0; i<=order; i++)
+ E += ak[i]*R[i];
+
+ for(i=0; i<order; i++)
+ wt[i] = 1.0;
+
+ if (lsp_quant) {
+ roots = lpc_to_lsp(ak, order, lsp, 5, LSP_DELTA1);
+ if (roots != order)
+ printf("LSP roots not found\n");
+
+ /* convert from radians to Hz to make quantisers more
+ human readable */
+
+ for(i=0; i<order; i++)
+ lsp_hz[i] = (4000.0/PI)*lsp[i];
+
+ /* simple uniform scalar quantisers */
+
+ for(i=0; i<10; i++) {
+ k = lsp_cb[i].k;
+ m = lsp_cb[i].m;
+ cb = lsp_cb[i].cb;
+ index = quantise(cb, &lsp_hz[i], wt, k, m, &se);
+ lsp_hz[i] = cb[index*k];
+ }
+
+ /* experiment: simulating uniform quantisation error
+ for(i=0; i<order; i++)
+ lsp[i] += PI*(12.5/4000.0)*(1.0 - 2.0*(float)rand()/RAND_MAX);
+ */
+
+ for(i=0; i<order; i++)
+ lsp[i] = (PI/4000.0)*lsp_hz[i];
+
+ /* Bandwidth Expansion (BW). Prevents any two LSPs getting too
+ close together after quantisation. We know from experiment
+ that LSP quantisation errors < 12.5Hz (25Hz setp size) are
+ inaudible so we use that as the minimum LSP separation.
+ */
+
+ for(i=1; i<5; i++) {
+ if (lsp[i] - lsp[i-1] < PI*(12.5/4000.0))
+ lsp[i] = lsp[i-1] + PI*(12.5/4000.0);
+ }
+
+ /* as quantiser gaps increased, larger BW expansion was required
+ to prevent twinkly noises */
+
+ for(i=5; i<8; i++) {
+ if (lsp[i] - lsp[i-1] < PI*(25.0/4000.0))
+ lsp[i] = lsp[i-1] + PI*(25.0/4000.0);
+ }
+ for(i=8; i<order; i++) {
+ if (lsp[i] - lsp[i-1] < PI*(75.0/4000.0))
+ lsp[i] = lsp[i-1] + PI*(75.0/4000.0);
+ }
+
+ for(j=0; j<order; j++)
+ lsp_[j] = lsp[j];
+
+ lsp_to_lpc(lsp_, ak, order);
+#ifdef DUMP
+ dump_lsp(lsp);
+#endif
+ }
+
+#ifdef DUMP
+ dump_E(E);
+#endif
+ #ifdef SIM_QUANT
+ /* simulated LPC energy quantisation */
+ {
+ float e = 10.0*log10(E);
+ e += 2.0*(1.0 - 2.0*(float)rand()/RAND_MAX);
+ E = pow(10.0,e/10.0);
+ }
+ #endif
+
+ aks_to_M2(ak,order,model,E,&snr, 1); /* {ak} -> {Am} LPC decode */
+
+ return snr;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ aks_to_M2()
+
+ Transforms the linear prediction coefficients to spectral amplitude
+ samples. This function determines A(m) from the average energy per
+ band using an FFT.
+
+\*---------------------------------------------------------------------------*/
+
+void aks_to_M2(
+ float ak[], /* LPC's */
+ int order,
+ MODEL *model, /* sinusoidal model parameters for this frame */
+ float E, /* energy term */
+ float *snr, /* signal to noise ratio for this frame in dB */
+ int dump /* true to dump sample to dump file */
+)
+{
+ COMP Pw[FFT_DEC]; /* power spectrum */
+ int i,m; /* loop variables */
+ int am,bm; /* limits of current band */
+ float r; /* no. rads/bin */
+ float Em; /* energy in band */
+ float Am; /* spectral amplitude sample */
+ float signal, noise;
+
+ r = TWO_PI/(FFT_DEC);
+
+ /* Determine DFT of A(exp(jw)) --------------------------------------------*/
+
+ for(i=0; i<FFT_DEC; i++) {
+ Pw[i].real = 0.0;
+ Pw[i].imag = 0.0;
+ }
+
+ for(i=0; i<=order; i++)
+ Pw[i].real = ak[i];
+ fft(&Pw[0].real,FFT_DEC,1);
+
+ /* Determine power spectrum P(w) = E/(A(exp(jw))^2 ------------------------*/
+
+ for(i=0; i<FFT_DEC/2; i++)
+ Pw[i].real = E/(Pw[i].real*Pw[i].real + Pw[i].imag*Pw[i].imag);
+#ifdef DUMP
+ if (dump)
+ dump_Pw(Pw);
+#endif
+
+ /* Determine magnitudes by linear interpolation of P(w) -------------------*/
+
+ signal = noise = 0.0;
+ for(m=1; m<=model->L; m++) {
+ am = floor((m - 0.5)*model->Wo/r + 0.5);
+ bm = floor((m + 0.5)*model->Wo/r + 0.5);
+ Em = 0.0;
+
+ for(i=am; i<bm; i++)
+ Em += Pw[i].real;
+ Am = sqrt(Em);
+
+ signal += pow(model->A[m],2.0);
+ noise += pow(model->A[m] - Am,2.0);
+ model->A[m] = Am;
+ }
+ *snr = 10.0*log10(signal/noise);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: encode_Wo()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Encodes Wo using a WO_LEVELS quantiser.
+
+\*---------------------------------------------------------------------------*/
+
+int encode_Wo(float Wo)
+{
+ int index;
+ float Wo_min = TWO_PI/P_MAX;
+ float Wo_max = TWO_PI/P_MIN;
+ float norm;
+
+ norm = (Wo - Wo_min)/(Wo_max - Wo_min);
+ index = floor(WO_LEVELS * norm + 0.5);
+ if (index < 0 ) index = 0;
+ if (index > (WO_LEVELS-1)) index = WO_LEVELS-1;
+
+ return index;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: decode_Wo()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Decodes Wo using a WO_LEVELS quantiser.
+
+\*---------------------------------------------------------------------------*/
+
+float decode_Wo(int index)
+{
+ float Wo_min = TWO_PI/P_MAX;
+ float Wo_max = TWO_PI/P_MIN;
+ float step;
+ float Wo;
+
+ step = (Wo_max - Wo_min)/WO_LEVELS;
+ Wo = Wo_min + step*(index);
+
+ return Wo;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: speech_to_uq_lsps()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Analyse a windowed frame of time domain speech to determine LPCs
+ which are the converted to LSPs for quantisation and transmission
+ over the channel.
+
+\*---------------------------------------------------------------------------*/
+
+float speech_to_uq_lsps(float lsp[],
+ float ak[],
+ float Sn[],
+ float w[],
+ int order
+)
+{
+ int i, roots;
+ float Wn[M];
+ float R[LPC_MAX+1];
+ float E;
+
+ for(i=0; i<M; i++)
+ Wn[i] = Sn[i]*w[i];
+ autocorrelate(Wn, R, M, order);
+ levinson_durbin(R, ak, order);
+
+ E = 0.0;
+ for(i=0; i<=order; i++)
+ E += ak[i]*R[i];
+
+ roots = lpc_to_lsp(ak, order, lsp, 5, LSP_DELTA1);
+ if (roots != order) {
+ /* for some reason LSP roots could not be found */
+ /* some alpha testers are reporting this condition */
+ fprintf(stderr, "LSP roots not found!\nroots = %d\n", roots);
+ for(i=0; i<=order; i++)
+ fprintf(stderr, "a[%d] = %f\n", i, ak[i]);
+
+ /* some benign LSP values we can use instead */
+ for(i=0; i<order; i++)
+ lsp[i] = (PI/order)*(float)i;
+ }
+
+ return E;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: encode_lsps()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ From a vector of unquantised (floating point) LSPs finds the quantised
+ LSP indexes.
+
+\*---------------------------------------------------------------------------*/
+
+void encode_lsps(int indexes[], float lsp[], int order)
+{
+ int i,k,m;
+ float wt[1];
+ float lsp_hz[LPC_MAX];
+ const float * cb;
+ float se;
+
+ /* convert from radians to Hz so we can use human readable
+ frequencies */
+
+ for(i=0; i<order; i++)
+ lsp_hz[i] = (4000.0/PI)*lsp[i];
+
+ /* simple uniform scalar quantisers */
+
+ wt[0] = 1.0;
+ for(i=0; i<order; i++) {
+ k = lsp_cb[i].k;
+ m = lsp_cb[i].m;
+ cb = lsp_cb[i].cb;
+ indexes[i] = quantise(cb, &lsp_hz[i], wt, k, m, &se);
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: decode_lsps()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ From a vector of quantised LSP indexes, returns the quantised
+ (floating point) LSPs.
+
+\*---------------------------------------------------------------------------*/
+
+void decode_lsps(float lsp[], int indexes[], int order)
+{
+ int i,k;
+ float lsp_hz[LPC_MAX];
+ const float * cb;
+
+ for(i=0; i<order; i++) {
+ k = lsp_cb[i].k;
+ cb = lsp_cb[i].cb;
+ lsp_hz[i] = cb[indexes[i]*k];
+ }
+
+ /* convert back to radians */
+
+ for(i=0; i<order; i++)
+ lsp[i] = (PI/4000.0)*lsp_hz[i];
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: bw_expand_lsps()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Applies Bandwidth Expansion (BW) to a vector of LSPs. Prevents any
+ two LSPs getting too close together after quantisation. We know
+ from experiment that LSP quantisation errors < 12.5Hz (25Hz setp
+ size) are inaudible so we use that as the minimum LSP separation.
+
+\*---------------------------------------------------------------------------*/
+
+void bw_expand_lsps(float lsp[],
+ int order
+)
+{
+ int i;
+
+ for(i=1; i<5; i++) {
+ if (lsp[i] - lsp[i-1] < PI*(12.5/4000.0))
+ lsp[i] = lsp[i-1] + PI*(12.5/4000.0);
+ }
+
+ /* As quantiser gaps increased, larger BW expansion was required
+ to prevent twinkly noises. This may need more experiment for
+ different quanstisers.
+ */
+
+ for(i=5; i<8; i++) {
+ if (lsp[i] - lsp[i-1] < PI*(25.0/4000.0))
+ lsp[i] = lsp[i-1] + PI*(25.0/4000.0);
+ }
+ for(i=8; i<order; i++) {
+ if (lsp[i] - lsp[i-1] < PI*(75.0/4000.0))
+ lsp[i] = lsp[i-1] + PI*(75.0/4000.0);
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: apply_lpc_correction()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Apply first harmonic LPC correction at decoder. This helps improve
+ low pitch males after LPC modelling, like hts1a and morig.
+
+\*---------------------------------------------------------------------------*/
+
+void apply_lpc_correction(MODEL *model)
+{
+ if (model->Wo < (PI*150.0/4000)) {
+ model->A[1] *= 0.032;
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: encode_energy()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Encodes LPC energy using an E_LEVELS quantiser.
+
+\*---------------------------------------------------------------------------*/
+
+int encode_energy(float e)
+{
+ int index;
+ float e_min = E_MIN_DB;
+ float e_max = E_MAX_DB;
+ float norm;
+
+ e = 10.0*log10(e);
+ norm = (e - e_min)/(e_max - e_min);
+ index = floor(E_LEVELS * norm + 0.5);
+ if (index < 0 ) index = 0;
+ if (index > (E_LEVELS-1)) index = E_LEVELS-1;
+
+ return index;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: decode_energy()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Decodes energy using a WO_BITS quantiser.
+
+\*---------------------------------------------------------------------------*/
+
+float decode_energy(int index)
+{
+ float e_min = E_MIN_DB;
+ float e_max = E_MAX_DB;
+ float step;
+ float e;
+
+ step = (e_max - e_min)/E_LEVELS;
+ e = e_min + step*(index);
+ e = pow(10.0,e/10.0);
+
+ return e;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: encode_amplitudes()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Time domain LPC is used model the amplitudes which are then
+ converted to LSPs and quantised. So we don't actually encode the
+ amplitudes directly, rather we derive an equivalent representation
+ from the time domain speech.
+
+\*---------------------------------------------------------------------------*/
+
+void encode_amplitudes(int lsp_indexes[],
+ int *energy_index,
+ MODEL *model,
+ float Sn[],
+ float w[])
+{
+ float lsps[LPC_ORD];
+ float ak[LPC_ORD+1];
+ float e;
+
+ e = speech_to_uq_lsps(lsps, ak, Sn, w, LPC_ORD);
+ encode_lsps(lsp_indexes, lsps, LPC_ORD);
+ *energy_index = encode_energy(e);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: decode_amplitudes()
+ AUTHOR......: David Rowe
+ DATE CREATED: 22/8/2010
+
+ Given the amplitude quantiser indexes recovers the harmonic
+ amplitudes.
+
+\*---------------------------------------------------------------------------*/
+
+float decode_amplitudes(MODEL *model,
+ float ak[],
+ int lsp_indexes[],
+ int energy_index,
+ float lsps[],
+ float *e
+)
+{
+ float snr;
+
+ decode_lsps(lsps, lsp_indexes, LPC_ORD);
+ bw_expand_lsps(lsps, LPC_ORD);
+ lsp_to_lpc(lsps, ak, LPC_ORD);
+ *e = decode_energy(energy_index);
+ aks_to_M2(ak, LPC_ORD, model, *e, &snr, 1);
+ apply_lpc_correction(model);
+
+ return snr;
+}
diff --git a/gr-vocoder/lib/codec2/quantise.h b/gr-vocoder/lib/codec2/quantise.h
new file mode 100644
index 000000000..90a3661ff
--- /dev/null
+++ b/gr-vocoder/lib/codec2/quantise.h
@@ -0,0 +1,83 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: quantise.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 31/5/92
+
+ Quantisation functions for the sinusoidal coder.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __QUANTISE__
+#define __QUANTISE__
+
+#define WO_BITS 7
+#define WO_LEVELS (1<<WO_BITS)
+#define E_BITS 5
+#define E_LEVELS (1<<E_BITS)
+#define E_MIN_DB -10.0
+#define E_MAX_DB 40.0
+
+void quantise_init();
+float lpc_model_amplitudes(float Sn[], float w[], MODEL *model, int order,
+ int lsp,float ak[]);
+void aks_to_M2(float ak[], int order, MODEL *model, float E, float *snr,
+ int dump);
+
+int encode_Wo(float Wo);
+float decode_Wo(int index);
+
+void encode_lsps(int indexes[], float lsp[], int order);
+void decode_lsps(float lsp[], int indexes[], int order);
+void lspd_quantise(float lsp[], float lsp_[], int order);
+void lspdvq_quantise(float lsp[], float lsp_[], int order);
+
+int encode_energy(float e);
+float decode_energy(int index);
+
+void encode_amplitudes(int lsp_indexes[],
+ int *energy_index,
+ MODEL *model,
+ float Sn[],
+ float w[]);
+
+float decode_amplitudes(MODEL *model,
+ float ak[],
+ int lsp_indexes[],
+ int energy_index,
+ float lsps[],
+ float *e);
+
+void pack(unsigned char * bits, unsigned int *nbit, int index, unsigned int index_bits);
+int unpack(const unsigned char * bits, unsigned int *nbit, unsigned int index_bits);
+
+int lsp_bits(int i);
+
+void apply_lpc_correction(MODEL *model);
+float speech_to_uq_lsps(float lsp[],
+ float ak[],
+ float Sn[],
+ float w[],
+ int order
+ );
+void bw_expand_lsps(float lsp[],
+ int order
+ );
+void decode_lsps(float lsp[], int indexes[], int order);
+
+#endif
diff --git a/gr-vocoder/lib/codec2/sim.sh b/gr-vocoder/lib/codec2/sim.sh
new file mode 100755
index 000000000..10152d979
--- /dev/null
+++ b/gr-vocoder/lib/codec2/sim.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# sim.sh
+# David Rowe 10 Sep 2009
+
+# Process a source file using the codec 2 simulation. An output
+# speech file is generated for each major processing step, from the
+# unquantised siusoidal model to fully quantised. This way we can
+# listen to the effect of each processing step. Use listensim.sh to
+# test the output files.
+
+../src/c2sim ../raw/$1.raw -o $1_uq.raw
+../src/c2sim ../raw/$1.raw --phase0 -o $1_phase0.raw --postfilter
+../src/c2sim ../raw/$1.raw --lpc 10 -o $1_lpc10.raw --postfilter
+../src/c2sim ../raw/$1.raw --phase0 --lpc 10 -o $1_phase0_lpc10.raw --postfilter
+../src/c2sim ../raw/$1.raw --phase0 --lpc 10 --dec -o $1_phase0_lpc10_dec.raw --postfilter
+../src/c2sim ../raw/$1.raw --phase0 --lpc 10 --lsp --dec -o $1_phase0_lsp_dec.raw --postfilter
+
+#../src/c2sim ../raw/$1.raw --lpc 10 --lsp -o $1_lsp.raw
+#../src/c2sim ../raw/$1.raw --phase0 --lpc 10 -o $1_phase0_lpc10.raw --postfilter
+#../src/c2sim ../raw/$1.raw --phase0 --lpc 10 --lsp -o $1_phase0_lsp.raw --postfilter
+#../src/c2sim ../raw/$1.raw --phase0 --lpc 10 --lsp -o $1_phase0_lsp_dec.raw --postfilter --dec
+
diff --git a/gr-vocoder/lib/codec2/sine.c b/gr-vocoder/lib/codec2/sine.c
new file mode 100644
index 000000000..45cc9de71
--- /dev/null
+++ b/gr-vocoder/lib/codec2/sine.c
@@ -0,0 +1,638 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: sine.c
+ AUTHOR......: David Rowe
+ DATE CREATED: 19/8/2010
+
+ Sinusoidal analysis and synthesis functions.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 1990-2010 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*---------------------------------------------------------------------------*\
+
+ INCLUDES
+
+\*---------------------------------------------------------------------------*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "defines.h"
+#include "sine.h"
+#include "fft.h"
+
+#define HPF_BETA 0.125
+
+/*---------------------------------------------------------------------------*\
+
+ HEADERS
+
+\*---------------------------------------------------------------------------*/
+
+void hs_pitch_refinement(MODEL *model, COMP Sw[], float pmin, float pmax,
+ float pstep);
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTIONS
+
+\*---------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: make_analysis_window
+ AUTHOR......: David Rowe
+ DATE CREATED: 11/5/94
+
+ Init function that generates the time domain analysis window and it's DFT.
+
+\*---------------------------------------------------------------------------*/
+
+void make_analysis_window(float w[],COMP W[])
+{
+ float m;
+ COMP temp;
+ int i,j;
+
+ /*
+ Generate Hamming window centered on M-sample pitch analysis window
+
+ 0 M/2 M-1
+ |-------------|-------------|
+ |-------|-------|
+ NW samples
+
+ All our analysis/synthsis is centred on the M/2 sample.
+ */
+
+ m = 0.0;
+ for(i=0; i<M/2-NW/2; i++)
+ w[i] = 0.0;
+ for(i=M/2-NW/2,j=0; i<M/2+NW/2; i++,j++) {
+ w[i] = 0.5 - 0.5*cos(TWO_PI*j/(NW-1));
+ m += w[i]*w[i];
+ }
+ for(i=M/2+NW/2; i<M; i++)
+ w[i] = 0.0;
+
+ /* Normalise - makes freq domain amplitude estimation straight
+ forward */
+
+ m = 1.0/sqrt(m*FFT_ENC);
+ for(i=0; i<M; i++) {
+ w[i] *= m;
+ }
+
+ /*
+ Generate DFT of analysis window, used for later processing. Note
+ we modulo FFT_ENC shift the time domain window w[], this makes the
+ imaginary part of the DFT W[] equal to zero as the shifted w[] is
+ even about the n=0 time axis if NW is odd. Having the imag part
+ of the DFT W[] makes computation easier.
+
+ 0 FFT_ENC-1
+ |-------------------------|
+
+ ----\ /----
+ \ /
+ \ / <- shifted version of window w[n]
+ \ /
+ \ /
+ -------
+
+ |---------| |---------|
+ NW/2 NW/2
+ */
+
+ for(i=0; i<FFT_ENC; i++) {
+ W[i].real = 0.0;
+ W[i].imag = 0.0;
+ }
+ for(i=0; i<NW/2; i++)
+ W[i].real = w[i+M/2];
+ for(i=FFT_ENC-NW/2,j=M/2-NW/2; i<FFT_ENC; i++,j++)
+ W[i].real = w[j];
+
+ fft(&W[0].real,FFT_ENC,-1); /* "Numerical Recipes in C" FFT */
+
+ /*
+ Re-arrange W[] to be symmetrical about FFT_ENC/2. Makes later
+ analysis convenient.
+
+ Before:
+
+
+ 0 FFT_ENC-1
+ |----------|---------|
+ __ _
+ \ /
+ \_______________/
+
+ After:
+
+ 0 FFT_ENC-1
+ |----------|---------|
+ ___
+ / \
+ ________/ \_______
+
+ */
+
+
+ for(i=0; i<FFT_ENC/2; i++) {
+ temp.real = W[i].real;
+ temp.imag = W[i].imag;
+ W[i].real = W[i+FFT_ENC/2].real;
+ W[i].imag = W[i+FFT_ENC/2].imag;
+ W[i+FFT_ENC/2].real = temp.real;
+ W[i+FFT_ENC/2].imag = temp.imag;
+ }
+
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: hpf
+ AUTHOR......: David Rowe
+ DATE CREATED: 16 Nov 2010
+
+ High pass filter with a -3dB point of about 160Hz.
+
+ y(n) = -HPF_BETA*y(n-1) + x(n) - x(n-1)
+
+\*---------------------------------------------------------------------------*/
+
+float hpf(float x, float states[])
+{
+ states[0] += -HPF_BETA*states[0] + x - states[1];
+ states[1] = x;
+
+ return states[0];
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: dft_speech
+ AUTHOR......: David Rowe
+ DATE CREATED: 27/5/94
+
+ Finds the DFT of the current speech input speech frame.
+
+\*---------------------------------------------------------------------------*/
+
+void dft_speech(COMP Sw[], float Sn[], float w[])
+{
+ int i;
+
+ for(i=0; i<FFT_ENC; i++) {
+ Sw[i].real = 0.0;
+ Sw[i].imag = 0.0;
+ }
+
+ /* Centre analysis window on time axis, we need to arrange input
+ to FFT this way to make FFT phases correct */
+
+ /* move 2nd half to start of FFT input vector */
+
+ for(i=0; i<NW/2; i++)
+ Sw[i].real = Sn[i+M/2]*w[i+M/2];
+
+ /* move 1st half to end of FFT input vector */
+
+ for(i=0; i<NW/2; i++)
+ Sw[FFT_ENC-NW/2+i].real = Sn[i+M/2-NW/2]*w[i+M/2-NW/2];
+
+ fft(&Sw[0].real,FFT_ENC,-1);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: two_stage_pitch_refinement
+ AUTHOR......: David Rowe
+ DATE CREATED: 27/5/94
+
+ Refines the current pitch estimate using the harmonic sum pitch
+ estimation technique.
+
+\*---------------------------------------------------------------------------*/
+
+void two_stage_pitch_refinement(MODEL *model, COMP Sw[])
+{
+ float pmin,pmax,pstep; /* pitch refinment minimum, maximum and step */
+
+ /* Coarse refinement */
+
+ pmax = TWO_PI/model->Wo + 5;
+ pmin = TWO_PI/model->Wo - 5;
+ pstep = 1.0;
+ hs_pitch_refinement(model,Sw,pmin,pmax,pstep);
+
+ /* Fine refinement */
+
+ pmax = TWO_PI/model->Wo + 1;
+ pmin = TWO_PI/model->Wo - 1;
+ pstep = 0.25;
+ hs_pitch_refinement(model,Sw,pmin,pmax,pstep);
+
+ /* Limit range */
+
+ if (model->Wo < TWO_PI/P_MAX)
+ model->Wo = TWO_PI/P_MAX;
+ if (model->Wo > TWO_PI/P_MIN)
+ model->Wo = TWO_PI/P_MIN;
+
+ model->L = floor(PI/model->Wo);
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: hs_pitch_refinement
+ AUTHOR......: David Rowe
+ DATE CREATED: 27/5/94
+
+ Harmonic sum pitch refinement function.
+
+ pmin pitch search range minimum
+ pmax pitch search range maximum
+ step pitch search step size
+ model current pitch estimate in model.Wo
+
+ model refined pitch estimate in model.Wo
+
+\*---------------------------------------------------------------------------*/
+
+void hs_pitch_refinement(MODEL *model, COMP Sw[], float pmin, float pmax, float pstep)
+{
+ int m; /* loop variable */
+ int b; /* bin for current harmonic centre */
+ float E; /* energy for current pitch*/
+ float Wo; /* current "test" fundamental freq. */
+ float Wom; /* Wo that maximises E */
+ float Em; /* mamimum energy */
+ float r; /* number of rads/bin */
+ float p; /* current pitch */
+
+ /* Initialisation */
+
+ model->L = PI/model->Wo; /* use initial pitch est. for L */
+ Wom = model->Wo;
+ Em = 0.0;
+ r = TWO_PI/FFT_ENC;
+
+ /* Determine harmonic sum for a range of Wo values */
+
+ for(p=pmin; p<=pmax; p+=pstep) {
+ E = 0.0;
+ Wo = TWO_PI/p;
+
+ /* Sum harmonic magnitudes */
+
+ for(m=1; m<=model->L; m++) {
+ b = floor(m*Wo/r + 0.5);
+ E += Sw[b].real*Sw[b].real + Sw[b].imag*Sw[b].imag;
+ }
+
+ /* Compare to see if this is a maximum */
+
+ if (E > Em) {
+ Em = E;
+ Wom = Wo;
+ }
+ }
+
+ model->Wo = Wom;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: estimate_amplitudes
+ AUTHOR......: David Rowe
+ DATE CREATED: 27/5/94
+
+ Estimates the complex amplitudes of the harmonics.
+
+\*---------------------------------------------------------------------------*/
+
+void estimate_amplitudes(MODEL *model, COMP Sw[], COMP W[])
+{
+ int i,m; /* loop variables */
+ int am,bm; /* bounds of current harmonic */
+ int b; /* DFT bin of centre of current harmonic */
+ float den; /* denominator of amplitude expression */
+ float r; /* number of rads/bin */
+ int offset;
+ COMP Am;
+
+ r = TWO_PI/FFT_ENC;
+
+ for(m=1; m<=model->L; m++) {
+ den = 0.0;
+ am = floor((m - 0.5)*model->Wo/r + 0.5);
+ bm = floor((m + 0.5)*model->Wo/r + 0.5);
+ b = floor(m*model->Wo/r + 0.5);
+
+ /* Estimate ampltude of harmonic */
+
+ den = 0.0;
+ Am.real = Am.imag = 0.0;
+ for(i=am; i<bm; i++) {
+ den += Sw[i].real*Sw[i].real + Sw[i].imag*Sw[i].imag;
+ offset = i + FFT_ENC/2 - floor(m*model->Wo/r + 0.5);
+ Am.real += Sw[i].real*W[offset].real;
+ Am.imag += Sw[i].imag*W[offset].real;
+ }
+
+ model->A[m] = sqrt(den);
+
+ /* Estimate phase of harmonic */
+
+ model->phi[m] = atan2(Sw[b].imag,Sw[b].real);
+ }
+}
+
+/*---------------------------------------------------------------------------*\
+
+ est_voicing_mbe()
+
+ Returns the error of the MBE cost function for a fiven F0.
+
+ Note: I think a lot of the operations below can be simplified as
+ W[].imag = 0 and has been normalised such that den always equals 1.
+
+\*---------------------------------------------------------------------------*/
+
+float est_voicing_mbe(
+ MODEL *model,
+ COMP Sw[],
+ COMP W[],
+ COMP Sw_[], /* DFT of all voiced synthesised signal */
+ /* useful for debugging/dump file */
+ COMP Ew[], /* DFT of error */
+ float prev_Wo)
+{
+ int i,l,al,bl,m; /* loop variables */
+ COMP Am; /* amplitude sample for this band */
+ int offset; /* centers Hw[] about current harmonic */
+ float den; /* denominator of Am expression */
+ float error; /* accumulated error between original and synthesised */
+ float Wo;
+ float sig, snr;
+ float elow, ehigh, eratio;
+ float dF0, sixty;
+
+ sig = 0.0;
+ for(l=1; l<=model->L/4; l++) {
+ sig += model->A[l]*model->A[l];
+ }
+ for(i=0; i<FFT_ENC; i++) {
+ Sw_[i].real = 0.0;
+ Sw_[i].imag = 0.0;
+ Ew[i].real = 0.0;
+ Ew[i].imag = 0.0;
+ }
+
+ Wo = model->Wo;
+ error = 0.0;
+
+ /* Just test across the harmonics in the first 1000 Hz (L/4) */
+
+ for(l=1; l<=model->L/4; l++) {
+ Am.real = 0.0;
+ Am.imag = 0.0;
+ den = 0.0;
+ al = ceil((l - 0.5)*Wo*FFT_ENC/TWO_PI);
+ bl = ceil((l + 0.5)*Wo*FFT_ENC/TWO_PI);
+
+ /* Estimate amplitude of harmonic assuming harmonic is totally voiced */
+
+ for(m=al; m<bl; m++) {
+ offset = FFT_ENC/2 + m - l*Wo*FFT_ENC/TWO_PI + 0.5;
+ Am.real += Sw[m].real*W[offset].real + Sw[m].imag*W[offset].imag;
+ Am.imag += Sw[m].imag*W[offset].real - Sw[m].real*W[offset].imag;
+ den += W[offset].real*W[offset].real + W[offset].imag*W[offset].imag;
+ }
+
+ Am.real = Am.real/den;
+ Am.imag = Am.imag/den;
+
+ /* Determine error between estimated harmonic and original */
+
+ for(m=al; m<bl; m++) {
+ offset = FFT_ENC/2 + m - l*Wo*FFT_ENC/TWO_PI + 0.5;
+ Sw_[m].real = Am.real*W[offset].real - Am.imag*W[offset].imag;
+ Sw_[m].imag = Am.real*W[offset].imag + Am.imag*W[offset].real;
+ Ew[m].real = Sw[m].real - Sw_[m].real;
+ Ew[m].imag = Sw[m].imag - Sw_[m].imag;
+ error += Ew[m].real*Ew[m].real;
+ error += Ew[m].imag*Ew[m].imag;
+ }
+ }
+
+ snr = 10.0*log10(sig/error);
+ if (snr > V_THRESH)
+ model->voiced = 1;
+ else
+ model->voiced = 0;
+
+ /* post processing, helps clean up some voicing errors ------------------*/
+
+ /*
+ Determine the ratio of low freancy to high frequency energy,
+ voiced speech tends to be dominated by low frequency energy,
+ unvoiced by high frequency. This measure can be used to
+ determine if we have made any gross errors.
+ */
+
+ elow = ehigh = 0.0;
+ for(l=1; l<=model->L/2; l++) {
+ elow += model->A[l]*model->A[l];
+ }
+ for(l=model->L/2; l<=model->L; l++) {
+ ehigh += model->A[l]*model->A[l];
+ }
+ eratio = 10.0*log10(elow/ehigh);
+ dF0 = 0.0;
+
+ /* Look for Type 1 errors, strongly V speech that has been
+ accidentally declared UV */
+
+ if (model->voiced == 0)
+ if (eratio > 10.0)
+ model->voiced = 1;
+
+ /* Look for Type 2 errors, strongly UV speech that has been
+ accidentally declared V */
+
+ if (model->voiced == 1) {
+ if (eratio < -10.0)
+ model->voiced = 0;
+
+ /* If pitch is jumping about it's likely this is UV */
+
+ dF0 = (model->Wo - prev_Wo)*FS/TWO_PI;
+ if (fabs(dF0) > 15.0)
+ model->voiced = 0;
+
+ /* A common source of Type 2 errors is the pitch estimator
+ gives a low (50Hz) estimate for UV speech, which gives a
+ good match with noise due to the close harmoonic spacing.
+ These errors are much more common than people with 50Hz
+ pitch, so we have just a small eratio threshold. */
+
+ sixty = 60.0*TWO_PI/FS;
+ if ((eratio < -4.0) && (model->Wo <= sixty))
+ model->voiced = 0;
+ }
+ //printf(" v: %d snr: %f eratio: %3.2f %f\n",model->voiced,snr,eratio,dF0);
+
+ return snr;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: make_synthesis_window
+ AUTHOR......: David Rowe
+ DATE CREATED: 11/5/94
+
+ Init function that generates the trapezoidal (Parzen) sythesis window.
+
+\*---------------------------------------------------------------------------*/
+
+void make_synthesis_window(float Pn[])
+{
+ int i;
+ float win;
+
+ /* Generate Parzen window in time domain */
+
+ win = 0.0;
+ for(i=0; i<N/2-TW; i++)
+ Pn[i] = 0.0;
+ win = 0.0;
+ for(i=N/2-TW; i<N/2+TW; win+=1.0/(2*TW), i++ )
+ Pn[i] = win;
+ for(i=N/2+TW; i<3*N/2-TW; i++)
+ Pn[i] = 1.0;
+ win = 1.0;
+ for(i=3*N/2-TW; i<3*N/2+TW; win-=1.0/(2*TW), i++)
+ Pn[i] = win;
+ for(i=3*N/2+TW; i<2*N; i++)
+ Pn[i] = 0.0;
+}
+
+/*---------------------------------------------------------------------------*\
+
+ FUNCTION....: synthesise
+ AUTHOR......: David Rowe
+ DATE CREATED: 20/2/95
+
+ Synthesise a speech signal in the frequency domain from the
+ sinusodal model parameters. Uses overlap-add with a trapezoidal
+ window to smoothly interpolate betwen frames.
+
+\*---------------------------------------------------------------------------*/
+
+void synthesise(
+ float Sn_[], /* time domain synthesised signal */
+ MODEL *model, /* ptr to model parameters for this frame */
+ float Pn[], /* time domain Parzen window */
+ int shift /* flag used to handle transition frames */
+)
+{
+ int i,l,j,b; /* loop variables */
+ COMP Sw_[FFT_DEC]; /* DFT of synthesised signal */
+
+ if (shift) {
+ /* Update memories */
+
+ for(i=0; i<N-1; i++) {
+ Sn_[i] = Sn_[i+N];
+ }
+ Sn_[N-1] = 0.0;
+ }
+
+ for(i=0; i<FFT_DEC; i++) {
+ Sw_[i].real = 0.0;
+ Sw_[i].imag = 0.0;
+ }
+
+ /*
+ Nov 2010 - found that synthesis using time domain cos() functions
+ gives better results for synthesis frames greater than 10ms. Inverse
+ FFT synthesis using a 512 pt FFT works well for 10ms window. I think
+ (but am not sure) that the problem is realted to the quantisation of
+ the harmonic frequencies to the FFT bin size, e.g. there is a
+ 8000/512 Hz step between FFT bins. For some reason this makes
+ the speech from longer frame > 10ms sound poor. The effect can also
+ be seen when synthesising test signals like single sine waves, some
+ sort of amplitude modulation at the frame rate.
+
+ Another possibility is using a larger FFT size (1024 or 2048).
+ */
+
+#define FFT_SYNTHESIS
+#ifdef FFT_SYNTHESIS
+ /* Now set up frequency domain synthesised speech */
+ for(l=1; l<=model->L; l++) {
+ b = floor(l*model->Wo*FFT_DEC/TWO_PI + 0.5);
+ if (b > ((FFT_DEC/2)-1)) {
+ b = (FFT_DEC/2)-1;
+ }
+ Sw_[b].real = model->A[l]*cos(model->phi[l]);
+ Sw_[b].imag = model->A[l]*sin(model->phi[l]);
+ Sw_[FFT_DEC-b].real = Sw_[b].real;
+ Sw_[FFT_DEC-b].imag = -Sw_[b].imag;
+ }
+
+ /* Perform inverse DFT */
+
+ fft(&Sw_[0].real,FFT_DEC,1);
+#else
+ /*
+ Direct time domain synthesis using the cos() function. Works
+ well at 10ms and 20ms frames rates. Note synthesis window is
+ still used to handle overlap-add between adjacent frames. This
+ could be simplified as we don't need to synthesise where Pn[]
+ is zero.
+ */
+ for(l=1; l<=model->L; l++) {
+ for(i=0,j=-N+1; i<N-1; i++,j++) {
+ Sw_[FFT_DEC-N+1+i].real += 2.0*model->A[l]*cos(j*model->Wo*l + model->phi[l]);
+ }
+ for(i=N-1,j=0; i<2*N; i++,j++)
+ Sw_[j].real += 2.0*model->A[l]*cos(j*model->Wo*l + model->phi[l]);
+ }
+#endif
+
+ /* Overlap add to previous samples */
+
+ for(i=0; i<N-1; i++) {
+ Sn_[i] += Sw_[FFT_DEC-N+1+i].real*Pn[i];
+ }
+
+ if (shift)
+ for(i=N-1,j=0; i<2*N; i++,j++)
+ Sn_[i] = Sw_[j].real*Pn[i];
+ else
+ for(i=N-1,j=0; i<2*N; i++,j++)
+ Sn_[i] += Sw_[j].real*Pn[i];
+}
+
diff --git a/gr-vocoder/lib/codec2/sine.h b/gr-vocoder/lib/codec2/sine.h
new file mode 100644
index 000000000..ae578bf70
--- /dev/null
+++ b/gr-vocoder/lib/codec2/sine.h
@@ -0,0 +1,44 @@
+/*---------------------------------------------------------------------------*\
+
+ FILE........: sine.h
+ AUTHOR......: David Rowe
+ DATE CREATED: 1/11/94
+
+ Header file for sinusoidal analysis and synthesis functions.
+
+\*---------------------------------------------------------------------------*/
+
+/*
+ Copyright (C) 2009 David Rowe
+
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License version 2.1, as
+ published by the Free Software Foundation. This program 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 Lesser General Public License
+ along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __SINE__
+#define __SINE__
+
+#include "defines.h"
+#include "comp.h"
+
+void make_analysis_window(float w[], COMP W[]);
+float hpf(float x, float states[]);
+void dft_speech(COMP Sw[], float Sn[], float w[]);
+void two_stage_pitch_refinement(MODEL *model, COMP Sw[]);
+void estimate_amplitudes(MODEL *model, COMP Sw[], COMP W[]);
+float est_voicing_mbe(MODEL *model, COMP Sw[], COMP W[], COMP Sw_[],COMP Ew[],
+ float prev_Wo);
+void make_synthesis_window(float Pn[]);
+void synthesise(float Sn_[], MODEL *model, float Pn[], int shift);
+
+#endif
diff --git a/gcell/ibm/.gitignore b/gr-vocoder/lib/g7xx/.gitignore
index a02b6ff73..a02b6ff73 100644
--- a/gcell/ibm/.gitignore
+++ b/gr-vocoder/lib/g7xx/.gitignore
diff --git a/gnuradio-core/src/lib/g72x/Makefile.am b/gr-vocoder/lib/g7xx/Makefile.am
index d2700376f..929fd23ba 100644
--- a/gnuradio-core/src/lib/g72x/Makefile.am
+++ b/gr-vocoder/lib/g7xx/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,7 +21,7 @@
include $(top_srcdir)/Makefile.common
-noinst_LTLIBRARIES = libccitt.la
-libccitt_la_SOURCES = g711.c g72x.c g721.c g723_24.c g723_40.c g72x.h
+noinst_LTLIBRARIES = libg7xx.la
+libg7xx_la_SOURCES = g711.c g72x.c g721.c g723_24.c g723_40.c g72x.h
EXTRA_DIST += encode.c decode.c
diff --git a/gnuradio-core/src/lib/g72x/README b/gr-vocoder/lib/g7xx/README
index 23b0e7dd5..23b0e7dd5 100644
--- a/gnuradio-core/src/lib/g72x/README
+++ b/gr-vocoder/lib/g7xx/README
diff --git a/gnuradio-core/src/lib/g72x/decode.c b/gr-vocoder/lib/g7xx/decode.c
index cf8c739c5..cf8c739c5 100644
--- a/gnuradio-core/src/lib/g72x/decode.c
+++ b/gr-vocoder/lib/g7xx/decode.c
diff --git a/gnuradio-core/src/lib/g72x/encode.c b/gr-vocoder/lib/g7xx/encode.c
index e74482869..e74482869 100644
--- a/gnuradio-core/src/lib/g72x/encode.c
+++ b/gr-vocoder/lib/g7xx/encode.c
diff --git a/gnuradio-core/src/lib/g72x/g711.c b/gr-vocoder/lib/g7xx/g711.c
index d4d60a5c2..d4d60a5c2 100644
--- a/gnuradio-core/src/lib/g72x/g711.c
+++ b/gr-vocoder/lib/g7xx/g711.c
diff --git a/gnuradio-core/src/lib/g72x/g721.c b/gr-vocoder/lib/g7xx/g721.c
index 445f177e8..445f177e8 100644
--- a/gnuradio-core/src/lib/g72x/g721.c
+++ b/gr-vocoder/lib/g7xx/g721.c
diff --git a/gnuradio-core/src/lib/g72x/g723_24.c b/gr-vocoder/lib/g7xx/g723_24.c
index 452f4daeb..452f4daeb 100644
--- a/gnuradio-core/src/lib/g72x/g723_24.c
+++ b/gr-vocoder/lib/g7xx/g723_24.c
diff --git a/gnuradio-core/src/lib/g72x/g723_40.c b/gr-vocoder/lib/g7xx/g723_40.c
index 4858baf40..4858baf40 100644
--- a/gnuradio-core/src/lib/g72x/g723_40.c
+++ b/gr-vocoder/lib/g7xx/g723_40.c
diff --git a/gnuradio-core/src/lib/g72x/g72x.c b/gr-vocoder/lib/g7xx/g72x.c
index 9a823c755..9a823c755 100644
--- a/gnuradio-core/src/lib/g72x/g72x.c
+++ b/gr-vocoder/lib/g7xx/g72x.c
diff --git a/gnuradio-core/src/lib/g72x/g72x.h b/gr-vocoder/lib/g7xx/g72x.h
index 33807171a..33807171a 100644
--- a/gnuradio-core/src/lib/g72x/g72x.h
+++ b/gr-vocoder/lib/g7xx/g72x.h
diff --git a/gcell/include/.gitignore b/gr-vocoder/lib/gsm/.gitignore
index a02b6ff73..a02b6ff73 100644
--- a/gcell/include/.gitignore
+++ b/gr-vocoder/lib/gsm/.gitignore
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/COPYRIGHT b/gr-vocoder/lib/gsm/COPYRIGHT
index eba0e523b..eba0e523b 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/COPYRIGHT
+++ b/gr-vocoder/lib/gsm/COPYRIGHT
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/Makefile.am b/gr-vocoder/lib/gsm/Makefile.am
index d0872ff39..d0872ff39 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/Makefile.am
+++ b/gr-vocoder/lib/gsm/Makefile.am
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/README b/gr-vocoder/lib/gsm/README
index 1927d878a..1927d878a 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/README
+++ b/gr-vocoder/lib/gsm/README
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/README.gsm b/gr-vocoder/lib/gsm/README.gsm
index cb6af85cf..cb6af85cf 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/README.gsm
+++ b/gr-vocoder/lib/gsm/README.gsm
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/add.c b/gr-vocoder/lib/gsm/add.c
index 21ccfabe7..21ccfabe7 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/add.c
+++ b/gr-vocoder/lib/gsm/add.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/code.c b/gr-vocoder/lib/gsm/code.c
index 19af507b7..19af507b7 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/code.c
+++ b/gr-vocoder/lib/gsm/code.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/config.h b/gr-vocoder/lib/gsm/config.h
index 2a962ac7d..2a962ac7d 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/config.h
+++ b/gr-vocoder/lib/gsm/config.h
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/debug.c b/gr-vocoder/lib/gsm/debug.c
index e05210428..e05210428 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/debug.c
+++ b/gr-vocoder/lib/gsm/debug.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/decode.c b/gr-vocoder/lib/gsm/decode.c
index 34e558663..34e558663 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/decode.c
+++ b/gr-vocoder/lib/gsm/decode.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm.h b/gr-vocoder/lib/gsm/gsm.h
index 990e42af5..990e42af5 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm.h
+++ b/gr-vocoder/lib/gsm/gsm.h
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_create.c b/gr-vocoder/lib/gsm/gsm_create.c
index de0b125b4..de0b125b4 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_create.c
+++ b/gr-vocoder/lib/gsm/gsm_create.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_decode.c b/gr-vocoder/lib/gsm/gsm_decode.c
index 7318ba2d4..7318ba2d4 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_decode.c
+++ b/gr-vocoder/lib/gsm/gsm_decode.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_destroy.c b/gr-vocoder/lib/gsm/gsm_destroy.c
index 4807c0acd..4807c0acd 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_destroy.c
+++ b/gr-vocoder/lib/gsm/gsm_destroy.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_encode.c b/gr-vocoder/lib/gsm/gsm_encode.c
index 62338300e..62338300e 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_encode.c
+++ b/gr-vocoder/lib/gsm/gsm_encode.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_explode.c b/gr-vocoder/lib/gsm/gsm_explode.c
index a906fc2ed..a906fc2ed 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_explode.c
+++ b/gr-vocoder/lib/gsm/gsm_explode.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_implode.c b/gr-vocoder/lib/gsm/gsm_implode.c
index 453b8cf39..453b8cf39 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_implode.c
+++ b/gr-vocoder/lib/gsm/gsm_implode.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_option.c b/gr-vocoder/lib/gsm/gsm_option.c
index 280780132..280780132 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_option.c
+++ b/gr-vocoder/lib/gsm/gsm_option.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_print.c b/gr-vocoder/lib/gsm/gsm_print.c
index af745bc48..af745bc48 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/gsm_print.c
+++ b/gr-vocoder/lib/gsm/gsm_print.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/long_term.c b/gr-vocoder/lib/gsm/long_term.c
index fd67bda19..fd67bda19 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/long_term.c
+++ b/gr-vocoder/lib/gsm/long_term.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/lpc.c b/gr-vocoder/lib/gsm/lpc.c
index ac2b8a9eb..ac2b8a9eb 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/lpc.c
+++ b/gr-vocoder/lib/gsm/lpc.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/preprocess.c b/gr-vocoder/lib/gsm/preprocess.c
index 99c0709dc..99c0709dc 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/preprocess.c
+++ b/gr-vocoder/lib/gsm/preprocess.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/private.h b/gr-vocoder/lib/gsm/private.h
index 6b538cc27..6b538cc27 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/private.h
+++ b/gr-vocoder/lib/gsm/private.h
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/proto.h b/gr-vocoder/lib/gsm/proto.h
index 87cf05e8a..87cf05e8a 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/proto.h
+++ b/gr-vocoder/lib/gsm/proto.h
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/rpe.c b/gr-vocoder/lib/gsm/rpe.c
index 8a6b81fae..8a6b81fae 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/rpe.c
+++ b/gr-vocoder/lib/gsm/rpe.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/short_term.c b/gr-vocoder/lib/gsm/short_term.c
index 4f5fd7be7..4f5fd7be7 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/short_term.c
+++ b/gr-vocoder/lib/gsm/short_term.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/table.c b/gr-vocoder/lib/gsm/table.c
index 16a04118c..16a04118c 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/table.c
+++ b/gr-vocoder/lib/gsm/table.c
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm/unproto.h b/gr-vocoder/lib/gsm/unproto.h
index ccd565109..ccd565109 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm/unproto.h
+++ b/gr-vocoder/lib/gsm/unproto.h
diff --git a/gr-vocoder/lib/vocoder_alaw_decode_bs.cc b/gr-vocoder/lib/vocoder_alaw_decode_bs.cc
new file mode 100644
index 000000000..7ffdddd81
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_alaw_decode_bs.cc
@@ -0,0 +1,65 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_alaw_decode_bs.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs()
+{
+ return gnuradio::get_initial_sptr(new vocoder_alaw_decode_bs());
+}
+
+vocoder_alaw_decode_bs::vocoder_alaw_decode_bs()
+ : gr_sync_block("vocoder_alaw_decode_bs",
+ gr_make_io_signature (1, 1, sizeof (unsigned char)),
+ gr_make_io_signature (1, 1, sizeof (short)))
+{
+}
+
+vocoder_alaw_decode_bs::~vocoder_alaw_decode_bs()
+{
+}
+
+
+
+int
+vocoder_alaw_decode_bs::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned char *in = (const unsigned char *)input_items[0];
+ short *out = (short *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = alaw2linear(in[i]);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_alaw_encode_sb.cc b/gr-vocoder/lib/vocoder_alaw_encode_sb.cc
new file mode 100644
index 000000000..e4d975271
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_alaw_encode_sb.cc
@@ -0,0 +1,63 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_alaw_encode_sb.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb()
+{
+ return gnuradio::get_initial_sptr(new vocoder_alaw_encode_sb());
+}
+
+vocoder_alaw_encode_sb::vocoder_alaw_encode_sb()
+ : gr_sync_block("vocoder_alaw_encode_sb",
+ gr_make_io_signature (1, 1, sizeof(short)),
+ gr_make_io_signature (1, 1, sizeof(unsigned char)))
+{
+}
+
+vocoder_alaw_encode_sb::~vocoder_alaw_encode_sb()
+{
+}
+
+int
+vocoder_alaw_encode_sb::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const short *in = (const short *)input_items[0];
+ unsigned char *out = (unsigned char *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = linear2alaw(in[i]);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_codec2_decode_ps.cc b/gr-vocoder/lib/vocoder_codec2_decode_ps.cc
new file mode 100644
index 000000000..b1feb1aaf
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_codec2_decode_ps.cc
@@ -0,0 +1,75 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005,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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "vocoder_codec2_decode_ps.h"
+
+extern "C" {
+#include "codec2/codec2.h"
+}
+
+#include <gr_io_signature.h>
+#include <stdexcept>
+#include <assert.h>
+
+vocoder_codec2_decode_ps_sptr
+vocoder_make_codec2_decode_ps ()
+{
+ return gnuradio::get_initial_sptr(new vocoder_codec2_decode_ps ());
+}
+
+vocoder_codec2_decode_ps::vocoder_codec2_decode_ps ()
+ : gr_sync_interpolator ("vocoder_codec2_decode_ps",
+ gr_make_io_signature (1, 1, CODEC2_BITS_PER_FRAME * sizeof (char)),
+ gr_make_io_signature (1, 1, sizeof (short)),
+ CODEC2_SAMPLES_PER_FRAME)
+{
+ if ((d_codec2 = codec2_create ()) == 0)
+ throw std::runtime_error ("vocoder_codec2_decode_ps: codec2_create failed");
+}
+
+vocoder_codec2_decode_ps::~vocoder_codec2_decode_ps ()
+{
+ codec2_destroy(d_codec2);
+}
+
+int
+vocoder_codec2_decode_ps::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned char *in = (const unsigned char *) input_items[0];
+ short *out = (short *) output_items[0];
+
+ assert ((noutput_items % CODEC2_SAMPLES_PER_FRAME) == 0);
+
+ for (int i = 0; i < noutput_items; i += CODEC2_SAMPLES_PER_FRAME){
+ codec2_decode (d_codec2, out, const_cast<unsigned char*>(in));
+ in += CODEC2_BITS_PER_FRAME * sizeof (char);
+ out += CODEC2_SAMPLES_PER_FRAME;
+ }
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_codec2_encode_sp.cc b/gr-vocoder/lib/vocoder_codec2_encode_sp.cc
new file mode 100644
index 000000000..1f22e38b2
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_codec2_encode_sp.cc
@@ -0,0 +1,72 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2005,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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "vocoder_codec2_encode_sp.h"
+
+extern "C" {
+#include "codec2/codec2.h"
+}
+
+#include <gr_io_signature.h>
+#include <stdexcept>
+
+vocoder_codec2_encode_sp_sptr
+vocoder_make_codec2_encode_sp ()
+{
+ return gnuradio::get_initial_sptr(new vocoder_codec2_encode_sp ());
+}
+
+vocoder_codec2_encode_sp::vocoder_codec2_encode_sp ()
+ : gr_sync_decimator ("vocoder_codec2_encode_sp",
+ gr_make_io_signature (1, 1, sizeof (short)),
+ gr_make_io_signature (1, 1, CODEC2_BITS_PER_FRAME * sizeof (char)),
+ CODEC2_SAMPLES_PER_FRAME)
+{
+ if ((d_codec2 = codec2_create ()) == 0)
+ throw std::runtime_error ("vocoder_codec2_encode_sp: codec2_create failed");
+}
+
+vocoder_codec2_encode_sp::~vocoder_codec2_encode_sp ()
+{
+ codec2_destroy(d_codec2);
+}
+
+int
+vocoder_codec2_encode_sp::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const short *in = (const short *) input_items[0];
+ unsigned char *out = (unsigned char *) output_items[0];
+
+ for (int i = 0; i < noutput_items; i++){
+ codec2_encode (d_codec2, out, const_cast<short*>(in));
+ in += CODEC2_SAMPLES_PER_FRAME;
+ out += CODEC2_BITS_PER_FRAME * sizeof (char);
+ }
+
+ return noutput_items;
+}
diff --git a/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc b/gr-vocoder/lib/vocoder_cvsd_decode_bs.cc
index 26dcb29da..baf99f041 100644
--- a/gr-cvsd-vocoder/src/lib/cvsd_decode_bs.cc
+++ b/gr-vocoder/lib/vocoder_cvsd_decode_bs.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2007,2010 Free Software Foundation, Inc.
+ * Copyright 2007,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,28 +29,28 @@
#include "config.h"
#endif
-#include <cvsd_decode_bs.h>
+#include <vocoder_cvsd_decode_bs.h>
#include <gr_io_signature.h>
#include <limits.h>
/*
- * Create a new instance of cvsd_decode_bs and return
+ * Create a new instance of vocoder_cvsd_decode_bs and return
* a boost shared_ptr. This is effectively the public constructor.
*/
-cvsd_decode_bs_sptr
-cvsd_make_decode_bs (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max)
+vocoder_cvsd_decode_bs_sptr
+vocoder_make_cvsd_decode_bs (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max)
{
- return gnuradio::get_initial_sptr(new cvsd_decode_bs (min_step, max_step,
- step_decay, accum_decay, K, J,
- pos_accum_max, neg_accum_max));
+ return gnuradio::get_initial_sptr(new vocoder_cvsd_decode_bs (min_step, max_step,
+ step_decay, accum_decay, K, J,
+ pos_accum_max, neg_accum_max));
}
-cvsd_decode_bs::cvsd_decode_bs (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max)
- : gr_sync_interpolator ("cvsd_decode_bs",
+vocoder_cvsd_decode_bs::vocoder_cvsd_decode_bs (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max)
+ : gr_sync_interpolator ("vocoder_cvsd_decode_bs",
gr_make_io_signature (1, 1, sizeof (unsigned char)),
gr_make_io_signature (1, 1, sizeof (short)),
8),
@@ -69,12 +69,12 @@ cvsd_decode_bs::cvsd_decode_bs (short min_step, short max_step, double step_deca
}
-cvsd_decode_bs::~cvsd_decode_bs ()
+vocoder_cvsd_decode_bs::~vocoder_cvsd_decode_bs ()
{
// nothing else required in this example
}
-unsigned char cvsd_decode_bs::cvsd_bitwise_sum (unsigned int input)
+unsigned char vocoder_cvsd_decode_bs::cvsd_bitwise_sum (unsigned int input)
{
unsigned int temp=input;
unsigned char bits=0;
@@ -86,7 +86,7 @@ unsigned char cvsd_decode_bs::cvsd_bitwise_sum (unsigned int input)
return bits;
}
-int cvsd_decode_bs::cvsd_round (double input)
+int vocoder_cvsd_decode_bs::cvsd_round (double input)
{
double temp;
temp=input+0.5;
@@ -95,7 +95,7 @@ int cvsd_decode_bs::cvsd_round (double input)
return (int)temp;
}
-unsigned int cvsd_decode_bs::cvsd_pow (short radix, short power)
+unsigned int vocoder_cvsd_decode_bs::cvsd_pow (short radix, short power)
{
double d_radix = (double) radix;
int i_power = (int) power;
@@ -107,9 +107,9 @@ unsigned int cvsd_decode_bs::cvsd_pow (short radix, short power)
int
-cvsd_decode_bs::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+vocoder_cvsd_decode_bs::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
diff --git a/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc b/gr-vocoder/lib/vocoder_cvsd_encode_sb.cc
index df867f3ba..71cf6df8c 100644
--- a/gr-cvsd-vocoder/src/lib/cvsd_encode_sb.cc
+++ b/gr-vocoder/lib/vocoder_cvsd_encode_sb.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2007,2010 Free Software Foundation, Inc.
+ * Copyright 2007,2010,2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -29,28 +29,28 @@
#include "config.h"
#endif
-#include <cvsd_encode_sb.h>
+#include <vocoder_cvsd_encode_sb.h>
#include <gr_io_signature.h>
#include <limits.h>
/*
- * Create a new instance of cvsd_encode_sb and return
+ * Create a new instance of vocoder_cvsd_encode_sb and return
* a boost shared_ptr. This is effectively the public constructor.
*/
-cvsd_encode_sb_sptr
-cvsd_make_encode_sb (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max)
+vocoder_cvsd_encode_sb_sptr
+vocoder_make_cvsd_encode_sb (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max)
{
- return gnuradio::get_initial_sptr(new cvsd_encode_sb (min_step, max_step,
- step_decay, accum_decay, K, J,
- pos_accum_max, neg_accum_max));
+ return gnuradio::get_initial_sptr(new vocoder_cvsd_encode_sb (min_step, max_step,
+ step_decay, accum_decay, K, J,
+ pos_accum_max, neg_accum_max));
}
-cvsd_encode_sb::cvsd_encode_sb (short min_step, short max_step, double step_decay,
- double accum_decay, int K, int J,
- short pos_accum_max, short neg_accum_max)
- : gr_sync_decimator ("cvsd_encode_sb",
+vocoder_cvsd_encode_sb::vocoder_cvsd_encode_sb (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max)
+ : gr_sync_decimator ("vocoder_cvsd_encode_sb",
gr_make_io_signature (1, 1, sizeof (short)),
gr_make_io_signature (1, 1, sizeof (unsigned char)),
8),
@@ -68,12 +68,12 @@ cvsd_encode_sb::cvsd_encode_sb (short min_step, short max_step, double step_deca
}
-cvsd_encode_sb::~cvsd_encode_sb ()
+vocoder_cvsd_encode_sb::~vocoder_cvsd_encode_sb ()
{
// nothing else required in this example
}
-unsigned char cvsd_encode_sb::cvsd_bitwise_sum (unsigned int input)
+unsigned char vocoder_cvsd_encode_sb::cvsd_bitwise_sum (unsigned int input)
{
unsigned int temp=input;
unsigned char bits=0;
@@ -85,7 +85,7 @@ unsigned char cvsd_encode_sb::cvsd_bitwise_sum (unsigned int input)
return bits;
}
-int cvsd_encode_sb::cvsd_round (double input)
+int vocoder_cvsd_encode_sb::cvsd_round (double input)
{
double temp;
temp=input+0.5;
@@ -94,7 +94,7 @@ int cvsd_encode_sb::cvsd_round (double input)
return (int)temp;
}
-unsigned int cvsd_encode_sb::cvsd_pow (short radix, short power)
+unsigned int vocoder_cvsd_encode_sb::cvsd_pow (short radix, short power)
{
double d_radix = (double) radix;
int i_power = (int) power;
@@ -104,12 +104,10 @@ unsigned int cvsd_encode_sb::cvsd_pow (short radix, short power)
return ( (unsigned int) cvsd_round(output));
}
-
-
int
-cvsd_encode_sb::work (int noutput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
+vocoder_cvsd_encode_sb::work (int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
{
const short *in = (const short *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
diff --git a/gr-vocoder/lib/vocoder_g721_decode_bs.cc b/gr-vocoder/lib/vocoder_g721_decode_bs.cc
new file mode 100644
index 000000000..2abee8d14
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_g721_decode_bs.cc
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_g721_decode_bs.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+class vocoder_g721_decode_bs_impl : public vocoder_g721_decode_bs
+{
+public:
+
+ vocoder_g721_decode_bs_impl();
+ ~vocoder_g721_decode_bs_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+private:
+
+ g72x_state d_state;
+
+};
+
+vocoder_g721_decode_bs_sptr vocoder_make_g721_decode_bs()
+{
+ return gnuradio::get_initial_sptr(new vocoder_g721_decode_bs_impl());
+}
+
+vocoder_g721_decode_bs_impl::vocoder_g721_decode_bs_impl()
+ : gr_sync_block("vocoder_g721_decode_bs",
+ gr_make_io_signature (1, 1, sizeof (unsigned char)),
+ gr_make_io_signature (1, 1, sizeof (short)))
+{
+ g72x_init_state(&d_state);
+}
+
+vocoder_g721_decode_bs_impl::~vocoder_g721_decode_bs_impl()
+{
+}
+
+int
+vocoder_g721_decode_bs_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned char *in = (const unsigned char *)input_items[0];
+ short *out = (short *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = g721_decoder(in[i], AUDIO_ENCODING_LINEAR, &d_state);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_g721_encode_sb.cc b/gr-vocoder/lib/vocoder_g721_encode_sb.cc
new file mode 100644
index 000000000..667e983dc
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_g721_encode_sb.cc
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_g721_encode_sb.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+class vocoder_g721_encode_sb_impl : public vocoder_g721_encode_sb
+{
+public:
+
+ vocoder_g721_encode_sb_impl();
+ ~vocoder_g721_encode_sb_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+private:
+
+ g72x_state d_state;
+
+};
+
+vocoder_g721_encode_sb_sptr vocoder_make_g721_encode_sb()
+{
+ return gnuradio::get_initial_sptr(new vocoder_g721_encode_sb_impl());
+}
+
+vocoder_g721_encode_sb_impl::vocoder_g721_encode_sb_impl()
+ : gr_sync_block("vocoder_g721_encode_sb",
+ gr_make_io_signature (1, 1, sizeof (short)),
+ gr_make_io_signature (1, 1, sizeof (unsigned char)))
+{
+ g72x_init_state(&d_state);
+}
+
+vocoder_g721_encode_sb_impl::~vocoder_g721_encode_sb_impl()
+{
+}
+
+int
+vocoder_g721_encode_sb_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const short *in = (const short *)input_items[0];
+ unsigned char *out = (unsigned char *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = g721_encoder(in[i], AUDIO_ENCODING_LINEAR, &d_state);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_g723_24_decode_bs.cc b/gr-vocoder/lib/vocoder_g723_24_decode_bs.cc
new file mode 100644
index 000000000..2ea036c58
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_g723_24_decode_bs.cc
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_g723_24_decode_bs.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+class vocoder_g723_24_decode_bs_impl : public vocoder_g723_24_decode_bs
+{
+public:
+
+ vocoder_g723_24_decode_bs_impl();
+ ~vocoder_g723_24_decode_bs_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+private:
+
+ g72x_state d_state;
+
+};
+
+vocoder_g723_24_decode_bs_sptr vocoder_make_g723_24_decode_bs()
+{
+ return gnuradio::get_initial_sptr(new vocoder_g723_24_decode_bs_impl());
+}
+
+vocoder_g723_24_decode_bs_impl::vocoder_g723_24_decode_bs_impl()
+ : gr_sync_block("vocoder_g723_24_decode_bs",
+ gr_make_io_signature (1, 1, sizeof (unsigned char)),
+ gr_make_io_signature (1, 1, sizeof (short)))
+{
+ g72x_init_state(&d_state);
+}
+
+vocoder_g723_24_decode_bs_impl::~vocoder_g723_24_decode_bs_impl()
+{
+}
+
+int
+vocoder_g723_24_decode_bs_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned char *in = (const unsigned char *)input_items[0];
+ short *out = (short *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = g723_24_decoder(in[i], AUDIO_ENCODING_LINEAR, &d_state);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_g723_24_encode_sb.cc b/gr-vocoder/lib/vocoder_g723_24_encode_sb.cc
new file mode 100644
index 000000000..7e6914223
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_g723_24_encode_sb.cc
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_g723_24_encode_sb.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+class vocoder_g723_24_encode_sb_impl : public vocoder_g723_24_encode_sb
+{
+public:
+
+ vocoder_g723_24_encode_sb_impl();
+ ~vocoder_g723_24_encode_sb_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+private:
+
+ g72x_state d_state;
+
+};
+
+vocoder_g723_24_encode_sb_sptr vocoder_make_g723_24_encode_sb()
+{
+ return gnuradio::get_initial_sptr(new vocoder_g723_24_encode_sb_impl());
+}
+
+vocoder_g723_24_encode_sb_impl::vocoder_g723_24_encode_sb_impl()
+ : gr_sync_block("vocoder_g723_24_encode_sb",
+ gr_make_io_signature (1, 1, sizeof (short)),
+ gr_make_io_signature (1, 1, sizeof (unsigned char)))
+{
+ g72x_init_state(&d_state);
+}
+
+vocoder_g723_24_encode_sb_impl::~vocoder_g723_24_encode_sb_impl()
+{
+}
+
+int
+vocoder_g723_24_encode_sb_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const short *in = (const short *)input_items[0];
+ unsigned char *out = (unsigned char *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = g723_24_encoder(in[i], AUDIO_ENCODING_LINEAR, &d_state);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_g723_40_decode_bs.cc b/gr-vocoder/lib/vocoder_g723_40_decode_bs.cc
new file mode 100644
index 000000000..38fd0fb5e
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_g723_40_decode_bs.cc
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_g723_40_decode_bs.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+class vocoder_g723_40_decode_bs_impl : public vocoder_g723_40_decode_bs
+{
+public:
+
+ vocoder_g723_40_decode_bs_impl();
+ ~vocoder_g723_40_decode_bs_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+private:
+
+ g72x_state d_state;
+
+};
+
+vocoder_g723_40_decode_bs_sptr vocoder_make_g723_40_decode_bs()
+{
+ return gnuradio::get_initial_sptr(new vocoder_g723_40_decode_bs_impl());
+}
+
+vocoder_g723_40_decode_bs_impl::vocoder_g723_40_decode_bs_impl()
+ : gr_sync_block("vocoder_g723_40_decode_bs",
+ gr_make_io_signature (1, 1, sizeof (unsigned char)),
+ gr_make_io_signature (1, 1, sizeof (short)))
+{
+ g72x_init_state(&d_state);
+}
+
+vocoder_g723_40_decode_bs_impl::~vocoder_g723_40_decode_bs_impl()
+{
+}
+
+int
+vocoder_g723_40_decode_bs_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned char *in = (const unsigned char *)input_items[0];
+ short *out = (short *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = g723_40_decoder(in[i], AUDIO_ENCODING_LINEAR, &d_state);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_g723_40_encode_sb.cc b/gr-vocoder/lib/vocoder_g723_40_encode_sb.cc
new file mode 100644
index 000000000..1089306e7
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_g723_40_encode_sb.cc
@@ -0,0 +1,81 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_g723_40_encode_sb.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+class vocoder_g723_40_encode_sb_impl : public vocoder_g723_40_encode_sb
+{
+public:
+
+ vocoder_g723_40_encode_sb_impl();
+ ~vocoder_g723_40_encode_sb_impl();
+
+ int work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items);
+
+private:
+
+ g72x_state d_state;
+
+};
+
+vocoder_g723_40_encode_sb_sptr vocoder_make_g723_40_encode_sb()
+{
+ return gnuradio::get_initial_sptr(new vocoder_g723_40_encode_sb_impl());
+}
+
+vocoder_g723_40_encode_sb_impl::vocoder_g723_40_encode_sb_impl()
+ : gr_sync_block("vocoder_g723_40_encode_sb",
+ gr_make_io_signature (1, 1, sizeof (short)),
+ gr_make_io_signature (1, 1, sizeof (unsigned char)))
+{
+ g72x_init_state(&d_state);
+}
+
+vocoder_g723_40_encode_sb_impl::~vocoder_g723_40_encode_sb_impl()
+{
+}
+
+int
+vocoder_g723_40_encode_sb_impl::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const short *in = (const short *)input_items[0];
+ unsigned char *out = (unsigned char *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = g723_40_encoder(in[i], AUDIO_ENCODING_LINEAR, &d_state);
+
+ return noutput_items;
+}
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.cc b/gr-vocoder/lib/vocoder_gsm_fr_decode_ps.cc
index 9b788dedf..986e0814e 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm_fr_decode_ps.cc
+++ b/gr-vocoder/lib/vocoder_gsm_fr_decode_ps.cc
@@ -23,7 +23,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include "gsm_fr_decode_ps.h"
+#include "vocoder_gsm_fr_decode_ps.h"
extern "C"{
#include "gsm/gsm.h"
}
@@ -31,29 +31,29 @@ extern "C"{
#include <stdexcept>
#include <assert.h>
-gsm_fr_decode_ps_sptr
-gsm_fr_make_decode_ps ()
+vocoder_gsm_fr_decode_ps_sptr
+vocoder_make_gsm_fr_decode_ps ()
{
- return gnuradio::get_initial_sptr(new gsm_fr_decode_ps ());
+ return gnuradio::get_initial_sptr(new vocoder_gsm_fr_decode_ps ());
}
-gsm_fr_decode_ps::gsm_fr_decode_ps ()
- : gr_sync_interpolator ("gsm_fr_decode_ps",
+vocoder_gsm_fr_decode_ps::vocoder_gsm_fr_decode_ps ()
+ : gr_sync_interpolator ("vocoder_gsm_fr_decode_ps",
gr_make_io_signature (1, 1, sizeof (gsm_frame)),
gr_make_io_signature (1, 1, sizeof (short)),
GSM_SAMPLES_PER_FRAME)
{
if ((d_gsm = gsm_create ()) == 0)
- throw std::runtime_error ("gsm_fr_decode_ps: gsm_create failed");
+ throw std::runtime_error ("vocoder_gsm_fr_decode_ps: gsm_create failed");
}
-gsm_fr_decode_ps::~gsm_fr_decode_ps ()
+vocoder_gsm_fr_decode_ps::~vocoder_gsm_fr_decode_ps ()
{
gsm_destroy (d_gsm);
}
int
-gsm_fr_decode_ps::work (int noutput_items,
+vocoder_gsm_fr_decode_ps::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.cc b/gr-vocoder/lib/vocoder_gsm_fr_encode_sp.cc
index 10bd1fef8..7a69b856d 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm_fr_encode_sp.cc
+++ b/gr-vocoder/lib/vocoder_gsm_fr_encode_sp.cc
@@ -23,36 +23,36 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include "gsm_fr_encode_sp.h"
+#include "vocoder_gsm_fr_encode_sp.h"
extern "C"{
#include "gsm/gsm.h"
}
#include <gr_io_signature.h>
#include <stdexcept>
-gsm_fr_encode_sp_sptr
-gsm_fr_make_encode_sp ()
+vocoder_gsm_fr_encode_sp_sptr
+vocoder_make_gsm_fr_encode_sp ()
{
- return gnuradio::get_initial_sptr(new gsm_fr_encode_sp ());
+ return gnuradio::get_initial_sptr(new vocoder_gsm_fr_encode_sp ());
}
-gsm_fr_encode_sp::gsm_fr_encode_sp ()
- : gr_sync_decimator ("gsm_fr_encode_sp",
+vocoder_gsm_fr_encode_sp::vocoder_gsm_fr_encode_sp ()
+ : gr_sync_decimator ("vocoder_gsm_fr_encode_sp",
gr_make_io_signature (1, 1, sizeof (short)),
gr_make_io_signature (1, 1, sizeof (gsm_frame)),
GSM_SAMPLES_PER_FRAME)
{
if ((d_gsm = gsm_create ()) == 0)
- throw std::runtime_error ("gsm_fr_encode_sp: gsm_create failed");
+ throw std::runtime_error ("vocoder_gsm_fr_encode_sp: gsm_create failed");
}
-gsm_fr_encode_sp::~gsm_fr_encode_sp ()
+vocoder_gsm_fr_encode_sp::~vocoder_gsm_fr_encode_sp ()
{
gsm_destroy (d_gsm);
}
int
-gsm_fr_encode_sp::work (int noutput_items,
+vocoder_gsm_fr_encode_sp::work (int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
diff --git a/gr-vocoder/lib/vocoder_ulaw_decode_bs.cc b/gr-vocoder/lib/vocoder_ulaw_decode_bs.cc
new file mode 100644
index 000000000..3ade9d3f0
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_ulaw_decode_bs.cc
@@ -0,0 +1,65 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_ulaw_decode_bs.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs()
+{
+ return gnuradio::get_initial_sptr(new vocoder_ulaw_decode_bs());
+}
+
+vocoder_ulaw_decode_bs::vocoder_ulaw_decode_bs()
+ : gr_sync_block("vocoder_ulaw_decode_bs",
+ gr_make_io_signature (1, 1, sizeof (unsigned char)),
+ gr_make_io_signature (1, 1, sizeof (short)))
+{
+}
+
+vocoder_ulaw_decode_bs::~vocoder_ulaw_decode_bs()
+{
+}
+
+
+
+int
+vocoder_ulaw_decode_bs::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const unsigned char *in = (const unsigned char *)input_items[0];
+ short *out = (short *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = ulaw2linear(in[i]);
+
+ return noutput_items;
+}
diff --git a/gr-vocoder/lib/vocoder_ulaw_encode_sb.cc b/gr-vocoder/lib/vocoder_ulaw_encode_sb.cc
new file mode 100644
index 000000000..19c53d72c
--- /dev/null
+++ b/gr-vocoder/lib/vocoder_ulaw_encode_sb.cc
@@ -0,0 +1,63 @@
+/* -*- c++ -*- */
+/*
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vocoder_ulaw_encode_sb.h>
+#include <gr_io_signature.h>
+#include <limits.h>
+
+extern "C" {
+#include "g7xx/g72x.h"
+}
+
+vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb()
+{
+ return gnuradio::get_initial_sptr(new vocoder_ulaw_encode_sb());
+}
+
+vocoder_ulaw_encode_sb::vocoder_ulaw_encode_sb()
+ : gr_sync_block("vocoder_ulaw_encode_sb",
+ gr_make_io_signature (1, 1, sizeof(short)),
+ gr_make_io_signature (1, 1, sizeof(unsigned char)))
+{
+}
+
+vocoder_ulaw_encode_sb::~vocoder_ulaw_encode_sb()
+{
+}
+
+int
+vocoder_ulaw_encode_sb::work(int noutput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items)
+{
+ const short *in = (const short *)input_items[0];
+ unsigned char *out = (unsigned char *)output_items[0];
+
+ for(int i = 0; i < noutput_items; i++)
+ out[i] = linear2ulaw(in[i]);
+
+ return noutput_items;
+}
diff --git a/gr-gsm-fr-vocoder/src/python/.gitignore b/gr-vocoder/python/.gitignore
index bf03975bb..bf03975bb 100644
--- a/gr-gsm-fr-vocoder/src/python/.gitignore
+++ b/gr-vocoder/python/.gitignore
diff --git a/gr-cvsd-vocoder/src/python/Makefile.am b/gr-vocoder/python/Makefile.am
index e6fd74828..4b6146ca7 100644
--- a/gr-cvsd-vocoder/src/python/Makefile.am
+++ b/gr-vocoder/python/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2004,2009,2010 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,16 +21,22 @@
include $(top_srcdir)/Makefile.common
-EXTRA_DIST += run_tests.in
-DISTCLEANFILES += run_tests
-TESTS = run_tests
+vocoderdir = $(grpythondir)/vocoder
+TESTS = run_tests
-grblkspythondir = $(grpythondir)/blks2impl
+noinst_PYTHON = \
+ qa_alaw_vocoder.py \
+ qa_codec2_vocoder.py \
+ qa_cvsd_vocoder.py \
+ qa_g721_vocoder.py \
+ qa_g723_24_vocoder.py \
+ qa_g723_40_vocoder.py \
+ qa_gsm_full_rate.py \
+ qa_ulaw_vocoder.py
-grblkspython_PYTHON = \
+vocoder_PYTHON = \
+ __init__.py \
cvsd.py
-noinst_PYTHON = \
- encdec.py \
- qa_cvsd_vocoder.py
+EXTRA_DIST += run_tests.in
diff --git a/gnuradio-examples/python/digital_voice/Makefile.am b/gr-vocoder/python/__init__.py
index 60f363b90..c5477b2be 100644
--- a/gnuradio-examples/python/digital_voice/Makefile.am
+++ b/gr-vocoder/python/__init__.py
@@ -1,5 +1,5 @@
#
-# Copyright 2004,2005,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,10 +19,10 @@
# Boston, MA 02110-1301, USA.
#
-include $(top_srcdir)/Makefile.common
+'''
+This is the gr-vocoder package. This package includes the various
+vocoder blocks in GNU Radio.
+'''
-ourdatadir = $(exampledir)/digital_voice
-
-dist_ourdata_SCRIPTS = \
- encdec.py \
- cvsd_test.py
+from vocoder_swig import *
+from cvsd import *
diff --git a/gr-cvsd-vocoder/src/python/cvsd.py b/gr-vocoder/python/cvsd.py
index 4defbf9a2..27b06ddeb 100644
--- a/gr-cvsd-vocoder/src/python/cvsd.py
+++ b/gr-vocoder/python/cvsd.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2007 Free Software Foundation, Inc.
+# Copyright 2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -21,9 +21,9 @@
#
from gnuradio import gr
-from gnuradio.vocoder import cvsd_vocoder
+import vocoder_swig
-class cvsd_encode(gr.hier_block2):
+class cvsd_encode_fb(gr.hier_block2):
'''
This is a wrapper for the CVSD encoder that performs interpolation and filtering
necessary to work with the vocoding. It converts an incoming float (+-1) to a short, scales
@@ -50,12 +50,12 @@ class cvsd_encode(gr.hier_block2):
taps = gr.firdes.low_pass(self.interp, self.interp, bw, 2*bw)
interp = gr.interp_fir_filter_fff(self.interp, taps)
f2s = gr.float_to_short()
- enc = cvsd_vocoder.encode_sb()
+ enc = vocoder_swig.cvsd_encode_sb()
self.connect(self, src_scale, interp, f2s, enc, self)
-class cvsd_decode(gr.hier_block2):
+class cvsd_decode_bf(gr.hier_block2):
'''
This is a wrapper for the CVSD decoder that performs decimation and filtering
necessary to work with the vocoding. It converts an incoming CVSD-encoded short to a float, decodes it
@@ -77,11 +77,10 @@ class cvsd_decode(gr.hier_block2):
scale_factor = 32000.0
self.decim = resample
- dec = cvsd_vocoder.decode_bs()
+ dec = vocoder_swig.cvsd_decode_bs()
s2f = gr.short_to_float()
taps = gr.firdes.low_pass(1, 1, bw, 2*bw)
decim = gr.fir_filter_fff(self.decim, taps)
sink_scale = gr.multiply_const_ff(1.0/scale_factor)
self.connect(self, dec, s2f, decim, sink_scale, self)
-
diff --git a/gr-sounder/src/python/Makefile.am b/gr-vocoder/python/qa_alaw_vocoder.py
index 1d9b25254..b7b937138 100644..100755
--- a/gr-sounder/src/python/Makefile.am
+++ b/gr-vocoder/python/qa_alaw_vocoder.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
#
-# Copyright 2007,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,21 +20,20 @@
# Boston, MA 02110-1301, USA.
#
-include $(top_srcdir)/Makefile.common
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
-# Install this stuff so that it ends up as the gnuradio.sounder module
-# This usually ends up at:
-# ${prefix}/lib/python${python_version}/site-packages/gnuradio
+class test_alaw_vocoder (gr_unittest.TestCase):
-sounder_pythondir = $(grpythondir)
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
-EXTRA_DIST += \
- sounder_loopback.sh \
- qa_nothing.py \
- run_tests.in
+ def test001_module_load (self):
+ enc = alaw_encode_sb();
+ dec = alaw_decode_bs();
-dist_bin_SCRIPTS = \
- usrp_sounder.py
-
-sounder_python_PYTHON = \
- sounder.py
+if __name__ == '__main__':
+ gr_unittest.run(test_alaw_vocoder, "test_alaw_vocoder.xml")
diff --git a/gr-vocoder/python/qa_codec2_vocoder.py b/gr-vocoder/python/qa_codec2_vocoder.py
new file mode 100755
index 000000000..699bb7dda
--- /dev/null
+++ b/gr-vocoder/python/qa_codec2_vocoder.py
@@ -0,0 +1,39 @@
+#!/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, gr_unittest
+from vocoder_swig import *
+
+class test_codec2_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ raw_enc = codec2_encode_sp();
+ raw_dec = codec2_decode_ps();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_codec2_vocoder, "test_codec2_vocoder.xml")
diff --git a/gr-cvsd-vocoder/src/python/qa_cvsd_vocoder.py b/gr-vocoder/python/qa_cvsd_vocoder.py
index 99a38d946..53045e4a9 100755
--- a/gr-cvsd-vocoder/src/python/qa_cvsd_vocoder.py
+++ b/gr-vocoder/python/qa_cvsd_vocoder.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2007,2010 Free Software Foundation, Inc.
+# Copyright 2007,2010,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -20,17 +20,25 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gr_unittest, blks2
-import cvsd_vocoder
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
+from cvsd import *
class test_cvsd_vocoder (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block()
-
+
def tearDown (self):
self.tb = None
+ def test001_module_load (self):
+ raw_enc = cvsd_encode_sb();
+ raw_dec = cvsd_decode_bs();
+ hb_enc = cvsd_encode_fb();
+ hb_dec = cvsd_decode_bf();
+
+
""" Disable for now
def test01(self):
sample_rate = 8000
diff --git a/gr-vocoder/python/qa_g721_vocoder.py b/gr-vocoder/python/qa_g721_vocoder.py
new file mode 100755
index 000000000..79cc944f3
--- /dev/null
+++ b/gr-vocoder/python/qa_g721_vocoder.py
@@ -0,0 +1,39 @@
+#!/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, gr_unittest
+from vocoder_swig import *
+
+class test_g721_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = g721_encode_sb();
+ dec = g721_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_g721_vocoder, "test_g721_vocoder.xml")
diff --git a/gr-sounder/src/fpga/top/Makefile.am b/gr-vocoder/python/qa_g723_24_vocoder.py
index f559991de..ccf215f46 100644..100755
--- a/gr-sounder/src/fpga/top/Makefile.am
+++ b/gr-vocoder/python/qa_g723_24_vocoder.py
@@ -1,5 +1,6 @@
+#!/usr/bin/env python
#
-# Copyright 2007,2009 Free Software Foundation, Inc.
+# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -19,30 +20,20 @@
# Boston, MA 02110-1301, USA.
#
-include $(top_srcdir)/Makefile.common
+from gnuradio import gr, gr_unittest
+from vocoder_swig import *
-RBFS = usrp_sounder.rbf
+class test_g723_24_vocoder (gr_unittest.TestCase):
-rbf2datadir = $(prefix)/share/usrp/rev2
-dist_rbf2data_DATA = $(RBFS)
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
-rbf4datadir = $(prefix)/share/usrp/rev4
-dist_rbf4data_DATA = $(RBFS)
+ def test001_module_load (self):
+ enc = g723_24_encode_sb();
+ dec = g723_24_decode_bs();
-EXTRA_DIST += \
- config.vh \
- usrp_sounder.v \
- usrp_sounder.csf \
- usrp_sounder.esf \
- usrp_sounder.psf \
- usrp_sounder.qpf
-
-MOSTLYCLEANFILES += \
- db/* \
- *.rpt \
- *.summary \
- *.qws \
- *.smsg \
- *.done \
- *.pin \
- *.sof
+if __name__ == '__main__':
+ gr_unittest.run(test_g723_24_vocoder, "test_g723_24_vocoder.xml")
diff --git a/gr-vocoder/python/qa_g723_40_vocoder.py b/gr-vocoder/python/qa_g723_40_vocoder.py
new file mode 100755
index 000000000..9e6a52339
--- /dev/null
+++ b/gr-vocoder/python/qa_g723_40_vocoder.py
@@ -0,0 +1,39 @@
+#!/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, gr_unittest
+from vocoder_swig import *
+
+class test_g723_40_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = g723_40_encode_sb();
+ dec = g723_40_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_g723_40_vocoder, "test_g723_40_vocoder.xml")
diff --git a/gr-gsm-fr-vocoder/src/python/qa_gsm_full_rate.py b/gr-vocoder/python/qa_gsm_full_rate.py
index 4164a1965..f9125905c 100755
--- a/gr-gsm-fr-vocoder/src/python/qa_gsm_full_rate.py
+++ b/gr-vocoder/python/qa_gsm_full_rate.py
@@ -21,7 +21,7 @@
#
from gnuradio import gr, gr_unittest
-import gsm_full_rate
+import vocoder_swig
class test_gsm_vocoder (gr_unittest.TestCase):
@@ -31,5 +31,9 @@ class test_gsm_vocoder (gr_unittest.TestCase):
def tearDown (self):
self.tb = None
+ def test001_module_load (self):
+ enc = vocoder_swig.gsm_fr_encode_sp();
+ dec = vocoder_swig.gsm_fr_decode_ps();
+
if __name__ == '__main__':
gr_unittest.run(test_gsm_vocoder, "test_gsm_vocoder.xml")
diff --git a/gr-vocoder/python/qa_ulaw_vocoder.py b/gr-vocoder/python/qa_ulaw_vocoder.py
new file mode 100755
index 000000000..0e201638c
--- /dev/null
+++ b/gr-vocoder/python/qa_ulaw_vocoder.py
@@ -0,0 +1,39 @@
+#!/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, gr_unittest
+from vocoder_swig import *
+
+class test_ulaw_vocoder (gr_unittest.TestCase):
+
+ def setUp (self):
+ self.tb = gr.top_block()
+
+ def tearDown (self):
+ self.tb = None
+
+ def test001_module_load (self):
+ enc = ulaw_encode_sb();
+ dec = ulaw_decode_bs();
+
+if __name__ == '__main__':
+ gr_unittest.run(test_ulaw_vocoder, "test_ulaw_vocoder.xml")
diff --git a/gr-sounder/src/python/run_tests.in b/gr-vocoder/python/run_tests.in
index b8f7830c2..e0c61a6b4 100644
--- a/gr-sounder/src/python/run_tests.in
+++ b/gr-vocoder/python/run_tests.in
@@ -5,6 +5,6 @@
# 3rd parameter is path to Python QA directory
@top_builddir@/run_tests.sh \
- @abs_top_srcdir@/gr-sounder \
- @abs_top_builddir@/gr-sounder \
+ @abs_top_srcdir@/gr-vocoder \
+ @abs_top_builddir@/gr-vocoder \
@srcdir@
diff --git a/gr-radar-mono/.gitignore b/gr-vocoder/swig/.gitignore
index b336cc7ce..b336cc7ce 100644
--- a/gr-radar-mono/.gitignore
+++ b/gr-vocoder/swig/.gitignore
diff --git a/gr-vocoder/swig/Makefile.am b/gr-vocoder/swig/Makefile.am
new file mode 100644
index 000000000..500d72ec7
--- /dev/null
+++ b/gr-vocoder/swig/Makefile.am
@@ -0,0 +1,82 @@
+#
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+
+include $(top_srcdir)/Makefile.common
+include $(top_srcdir)/Makefile.swig
+
+TESTS =
+EXTRA_DIST += $(nobase_guile_DATA)
+
+AM_CPPFLAGS = \
+ -I$(abs_top_srcdir)/gr-vocoder/include \
+ $(STD_DEFINES_AND_INCLUDES) \
+ $(PYTHON_CPPFLAGS) \
+ $(WITH_INCLUDES)
+
+if GUILE
+nobase_guile_DATA = \
+ gnuradio/vocoder_swig.scm
+endif
+
+noinst_GUILE = vocoder.test
+
+
+##############################
+# SWIG interface and library
+TOP_SWIG_IFILES = \
+ vocoder_swig.i
+
+# Install so that they end up available as:
+# import gnuradio.vocoder
+# This ends up at:
+# ${prefix}/lib/python${python_version}/site-packages/gnuradio/vocoder
+vocoder_swig_pythondir_category = \
+ gnuradio/vocoder
+
+# additional libraries for linking with the SWIG-generated library
+vocoder_swig_la_swig_libadd = \
+ $(abs_top_builddir)/gr-vocoder/lib/libgnuradio-vocoder.la
+
+# additional SWIG files to be installed
+vocoder_swig_swiginclude_headers = \
+ vocoder_alaw_decode_bs.i \
+ vocoder_alaw_encode_sb.i \
+ vocoder_codec2_decode_ps.i \
+ vocoder_codec2_encode_sp.i \
+ vocoder_cvsd_decode_bs.i \
+ vocoder_cvsd_encode_sb.i \
+ vocoder_g721_decode_bs.i \
+ vocoder_g721_encode_sb.i \
+ vocoder_g723_24_decode_bs.i \
+ vocoder_g723_24_encode_sb.i \
+ vocoder_g723_40_decode_bs.i \
+ vocoder_g723_40_encode_sb.i \
+ vocoder_gsm_fr_encode_sp.i \
+ vocoder_gsm_fr_decode_ps.i \
+ vocoder_ulaw_decode_bs.i \
+ vocoder_ulaw_encode_sb.i
+
+vocoder_swig_swig_args = \
+ -I$(abs_top_builddir)/gr-vocoder/lib
+
+if GUILE
+TESTS += run_guile_tests
+endif
diff --git a/gr-cvsd-vocoder/src/lib/Makefile.swig.gen b/gr-vocoder/swig/Makefile.swig.gen
index e23427a0f..b0d0504a8 100644
--- a/gr-cvsd-vocoder/src/lib/Makefile.swig.gen
+++ b/gr-vocoder/swig/Makefile.swig.gen
@@ -20,37 +20,37 @@
# Boston, MA 02110-1301, USA.
#
-# Makefile.swig.gen for cvsd_vocoder.i
+# Makefile.swig.gen for vocoder_swig.i
## Default install locations for these files:
##
## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/cvsd_vocoder
+## ${prefix}/lib/python${python_version}/site-packages/[category]/vocoder_swig
## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/cvsd_vocoder
+## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/vocoder_swig
##
## The following can be overloaded to change the install location, but
## this has to be done in the including Makefile.am -before-
## Makefile.swig is included.
-cvsd_vocoder_pythondir_category ?= gnuradio/cvsd_vocoder
-cvsd_vocoder_pylibdir_category ?= $(cvsd_vocoder_pythondir_category)
-cvsd_vocoder_pythondir = $(pythondir)/$(cvsd_vocoder_pythondir_category)
-cvsd_vocoder_pylibdir = $(pyexecdir)/$(cvsd_vocoder_pylibdir_category)
+vocoder_swig_pythondir_category ?= gnuradio/vocoder_swig
+vocoder_swig_pylibdir_category ?= $(vocoder_swig_pythondir_category)
+vocoder_swig_pythondir = $(pythondir)/$(vocoder_swig_pythondir_category)
+vocoder_swig_pylibdir = $(pyexecdir)/$(vocoder_swig_pylibdir_category)
# The .so libraries for the guile modules get installed whereever guile
# is installed, usually /usr/lib/guile/gnuradio/
# FIXME: determince whether these should be installed with gnuradio.
-cvsd_vocoder_scmlibdir = $(libdir)
+vocoder_swig_scmlibdir = $(libdir)
# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/cvsd_vocoder
+# is installed, usually /usr/share/guile/site/vocoder_swig
# FIXME: determince whether these should be installed with gnuradio.
-cvsd_vocoder_scmdir = $(guiledir)
+vocoder_swig_scmdir = $(guiledir)
## SWIG headers are always installed into the same directory.
-cvsd_vocoder_swigincludedir = $(swigincludedir)
+vocoder_swig_swigincludedir = $(swigincludedir)
## This is a template file for a "generated" Makefile addition (in
## this case, "Makefile.swig.gen"). By including the top-level
@@ -75,70 +75,70 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S*
## Makefile.am by setting the variable value there, then including
## Makefile.swig .
-cvsd_vocoder_swiginclude_HEADERS = \
- cvsd_vocoder.i \
- $(cvsd_vocoder_swiginclude_headers)
+vocoder_swig_swiginclude_HEADERS = \
+ vocoder_swig.i \
+ $(vocoder_swig_swiginclude_headers)
if PYTHON
-cvsd_vocoder_pylib_LTLIBRARIES = \
- _cvsd_vocoder.la
+vocoder_swig_pylib_LTLIBRARIES = \
+ _vocoder_swig.la
-_cvsd_vocoder_la_SOURCES = \
- python/cvsd_vocoder.cc \
- $(cvsd_vocoder_la_swig_sources)
+_vocoder_swig_la_SOURCES = \
+ python/vocoder_swig.cc \
+ $(vocoder_swig_la_swig_sources)
-cvsd_vocoder_python_PYTHON = \
- cvsd_vocoder.py \
- $(cvsd_vocoder_python)
+vocoder_swig_python_PYTHON = \
+ vocoder_swig.py \
+ $(vocoder_swig_python)
-_cvsd_vocoder_la_LIBADD = \
+_vocoder_swig_la_LIBADD = \
$(STD_SWIG_LA_LIB_ADD) \
- $(cvsd_vocoder_la_swig_libadd)
+ $(vocoder_swig_la_swig_libadd)
-_cvsd_vocoder_la_LDFLAGS = \
+_vocoder_swig_la_LDFLAGS = \
$(STD_SWIG_LA_LD_FLAGS) \
- $(cvsd_vocoder_la_swig_ldflags)
+ $(vocoder_swig_la_swig_ldflags)
-_cvsd_vocoder_la_CXXFLAGS = \
+_vocoder_swig_la_CXXFLAGS = \
$(STD_SWIG_CXX_FLAGS) \
-I$(top_builddir) \
- $(cvsd_vocoder_la_swig_cxxflags)
+ $(vocoder_swig_la_swig_cxxflags)
-python/cvsd_vocoder.cc: cvsd_vocoder.py
-cvsd_vocoder.py: cvsd_vocoder.i
+python/vocoder_swig.cc: vocoder_swig.py
+vocoder_swig.py: vocoder_swig.i
# Include the python dependencies for this file
--include python/cvsd_vocoder.d
+-include python/vocoder_swig.d
endif # end of if python
if GUILE
-cvsd_vocoder_scmlib_LTLIBRARIES = \
- libguile-gnuradio-cvsd_vocoder.la
-libguile_gnuradio_cvsd_vocoder_la_SOURCES = \
- guile/cvsd_vocoder.cc \
- $(cvsd_vocoder_la_swig_sources)
-nobase_cvsd_vocoder_scm_DATA = \
- gnuradio/cvsd_vocoder.scm \
- gnuradio/cvsd_vocoder-primitive.scm
-libguile_gnuradio_cvsd_vocoder_la_LIBADD = \
+vocoder_swig_scmlib_LTLIBRARIES = \
+ libguile-gnuradio-vocoder_swig.la
+libguile_gnuradio_vocoder_swig_la_SOURCES = \
+ guile/vocoder_swig.cc \
+ $(vocoder_swig_la_swig_sources)
+nobase_vocoder_swig_scm_DATA = \
+ gnuradio/vocoder_swig.scm \
+ gnuradio/vocoder_swig-primitive.scm
+libguile_gnuradio_vocoder_swig_la_LIBADD = \
$(STD_SWIG_LA_LIB_ADD) \
- $(cvsd_vocoder_la_swig_libadd)
-libguile_gnuradio_cvsd_vocoder_la_LDFLAGS = \
+ $(vocoder_swig_la_swig_libadd)
+libguile_gnuradio_vocoder_swig_la_LDFLAGS = \
$(STD_SWIG_LA_LD_FLAGS) \
- $(cvsd_vocoder_la_swig_ldflags)
-libguile_gnuradio_cvsd_vocoder_la_CXXFLAGS = \
+ $(vocoder_swig_la_swig_ldflags)
+libguile_gnuradio_vocoder_swig_la_CXXFLAGS = \
$(STD_SWIG_CXX_FLAGS) \
-I$(top_builddir) \
- $(cvsd_vocoder_la_swig_cxxflags)
+ $(vocoder_swig_la_swig_cxxflags)
-guile/cvsd_vocoder.cc: gnuradio/cvsd_vocoder.scm
-gnuradio/cvsd_vocoder.scm: cvsd_vocoder.i
-gnuradio/cvsd_vocoder-primitive.scm: gnuradio/cvsd_vocoder.scm
+guile/vocoder_swig.cc: gnuradio/vocoder_swig.scm
+gnuradio/vocoder_swig.scm: vocoder_swig.i
+gnuradio/vocoder_swig-primitive.scm: gnuradio/vocoder_swig.scm
# Include the guile dependencies for this file
--include guile/cvsd_vocoder.d
+-include guile/vocoder_swig.d
endif # end of GUILE
diff --git a/gr-vocoder/swig/run_guile_tests.in b/gr-vocoder/swig/run_guile_tests.in
new file mode 100644
index 000000000..5d08b0dd5
--- /dev/null
+++ b/gr-vocoder/swig/run_guile_tests.in
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+. @top_builddir@/setup_guile_test_env
+
+# 1st argument is absolute path to hand coded guile source directory
+# 2nd argument is absolute path to component C++ shared library build directory
+# 3nd argument is absolute path to component SWIG build directory
+
+add_local_paths \
+ @srcdir@ \
+ @abs_builddir@ \
+ @abs_builddir@
+
+@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@
diff --git a/gr-vocoder/swig/vocoder_alaw_decode_bs.i b/gr-vocoder/swig/vocoder_alaw_decode_bs.i
new file mode 100644
index 000000000..f789c454f
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_alaw_decode_bs.i
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_alaw_decode_bs.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,alaw_decode_bs);
+
+vocoder_alaw_decode_bs_sptr vocoder_make_alaw_decode_bs();
+
+class vocoder_alaw_decode_bs : public gr_sync_block
+{
+private:
+ vocoder_alaw_decode_bs();
+};
diff --git a/gr-vocoder/swig/vocoder_alaw_encode_sb.i b/gr-vocoder/swig/vocoder_alaw_encode_sb.i
new file mode 100644
index 000000000..9fe537d55
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_alaw_encode_sb.i
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_alaw_encode_sb.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,alaw_encode_sb);
+
+vocoder_alaw_encode_sb_sptr vocoder_make_alaw_encode_sb();
+
+class vocoder_alaw_encode_sb : public gr_sync_block
+{
+private:
+ vocoder_alaw_encode_sb();
+};
diff --git a/gr-vocoder/swig/vocoder_codec2_decode_ps.i b/gr-vocoder/swig/vocoder_codec2_decode_ps.i
new file mode 100644
index 000000000..e53cb078a
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_codec2_decode_ps.i
@@ -0,0 +1,34 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_codec2_decode_ps.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,codec2_decode_ps);
+
+vocoder_codec2_decode_ps_sptr vocoder_make_codec2_decode_ps ();
+
+class vocoder_codec2_decode_ps : public gr_sync_interpolator {
+public:
+ ~vocoder_codec2_decode_ps ();
+};
diff --git a/gr-vocoder/swig/vocoder_codec2_encode_sp.i b/gr-vocoder/swig/vocoder_codec2_encode_sp.i
new file mode 100644
index 000000000..84f26954d
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_codec2_encode_sp.i
@@ -0,0 +1,34 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_codec2_encode_sp.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,codec2_encode_sp);
+
+vocoder_codec2_encode_sp_sptr vocoder_make_codec2_encode_sp ();
+
+class vocoder_codec2_encode_sp : public gr_sync_decimator {
+public:
+ ~vocoder_codec2_encode_sp ();
+};
diff --git a/gr-vocoder/swig/vocoder_cvsd_decode_bs.i b/gr-vocoder/swig/vocoder_cvsd_decode_bs.i
new file mode 100644
index 000000000..e990f5440
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_cvsd_decode_bs.i
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,2009,2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_cvsd_decode_bs.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,cvsd_decode_bs);
+
+vocoder_cvsd_decode_bs_sptr vocoder_make_cvsd_decode_bs (short min_step=10,
+ short max_step=1280,
+ double step_decay=0.9990234375,
+ double accum_decay= 0.96875,
+ int K=32,
+ int J=4,
+ short pos_accum_max=32767,
+ short neg_accum_max=-32767);
+
+class vocoder_cvsd_decode_bs : public gr_sync_interpolator
+{
+private:
+ vocoder_cvsd_decode_bs (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max);
+};
diff --git a/gr-vocoder/swig/vocoder_cvsd_encode_sb.i b/gr-vocoder/swig/vocoder_cvsd_encode_sb.i
new file mode 100644
index 000000000..5db7b3a48
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_cvsd_encode_sb.i
@@ -0,0 +1,44 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2007,2009,2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_cvsd_encode_sb.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,cvsd_encode_sb);
+
+vocoder_cvsd_encode_sb_sptr vocoder_make_cvsd_encode_sb (short min_step=10,
+ short max_step=1280,
+ double step_decay=0.9990234375,
+ double accum_decay= 0.96875,
+ int K=32,
+ int J=4,
+ short pos_accum_max=32767,
+ short neg_accum_max=-32767);
+
+class vocoder_cvsd_encode_sb : public gr_sync_decimator
+{
+private:
+ vocoder_cvsd_encode_sb (short min_step, short max_step, double step_decay,
+ double accum_decay, int K, int J,
+ short pos_accum_max, short neg_accum_max);
+};
diff --git a/gr-vocoder/swig/vocoder_g721_decode_bs.i b/gr-vocoder/swig/vocoder_g721_decode_bs.i
new file mode 100644
index 000000000..47e7d2861
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_g721_decode_bs.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_g721_decode_bs.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,g721_decode_bs);
+
+vocoder_g721_decode_bs_sptr vocoder_make_g721_decode_bs();
+
+class vocoder_g721_decode_bs : public gr_sync_block
+{
+};
diff --git a/gr-vocoder/swig/vocoder_g721_encode_sb.i b/gr-vocoder/swig/vocoder_g721_encode_sb.i
new file mode 100644
index 000000000..0675087a0
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_g721_encode_sb.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_g721_encode_sb.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,g721_encode_sb);
+
+vocoder_g721_encode_sb_sptr vocoder_make_g721_encode_sb();
+
+class vocoder_g721_encode_sb : public gr_sync_block
+{
+};
diff --git a/gr-vocoder/swig/vocoder_g723_24_decode_bs.i b/gr-vocoder/swig/vocoder_g723_24_decode_bs.i
new file mode 100644
index 000000000..41548059f
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_g723_24_decode_bs.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_g723_24_decode_bs.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,g723_24_decode_bs);
+
+vocoder_g723_24_decode_bs_sptr vocoder_make_g723_24_decode_bs();
+
+class vocoder_g723_24_decode_bs : public gr_sync_block
+{
+};
diff --git a/gr-vocoder/swig/vocoder_g723_24_encode_sb.i b/gr-vocoder/swig/vocoder_g723_24_encode_sb.i
new file mode 100644
index 000000000..7165a8a82
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_g723_24_encode_sb.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_g723_24_encode_sb.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,g723_24_encode_sb);
+
+vocoder_g723_24_encode_sb_sptr vocoder_make_g723_24_encode_sb();
+
+class vocoder_g723_24_encode_sb : public gr_sync_block
+{
+};
diff --git a/gr-vocoder/swig/vocoder_g723_40_decode_bs.i b/gr-vocoder/swig/vocoder_g723_40_decode_bs.i
new file mode 100644
index 000000000..d9ec9d6c9
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_g723_40_decode_bs.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_g723_40_decode_bs.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,g723_40_decode_bs);
+
+vocoder_g723_40_decode_bs_sptr vocoder_make_g723_40_decode_bs();
+
+class vocoder_g723_40_decode_bs : public gr_sync_block
+{
+};
diff --git a/gr-vocoder/swig/vocoder_g723_40_encode_sb.i b/gr-vocoder/swig/vocoder_g723_40_encode_sb.i
new file mode 100644
index 000000000..839ae46cf
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_g723_40_encode_sb.i
@@ -0,0 +1,33 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_g723_40_encode_sb.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,g723_40_encode_sb);
+
+vocoder_g723_40_encode_sb_sptr vocoder_make_g723_40_encode_sb();
+
+class vocoder_g723_40_encode_sb : public gr_sync_block
+{
+};
diff --git a/gr-vocoder/swig/vocoder_gsm_fr_decode_ps.i b/gr-vocoder/swig/vocoder_gsm_fr_decode_ps.i
new file mode 100644
index 000000000..8e96689f6
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_gsm_fr_decode_ps.i
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_gsm_fr_decode_ps.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,gsm_fr_decode_ps);
+
+vocoder_gsm_fr_decode_ps_sptr vocoder_make_gsm_fr_decode_ps();
+
+class vocoder_gsm_fr_decode_ps : public gr_sync_interpolator
+{
+public:
+ ~vocoder_gsm_fr_decode_ps();
+};
diff --git a/gr-vocoder/swig/vocoder_gsm_fr_encode_sp.i b/gr-vocoder/swig/vocoder_gsm_fr_encode_sp.i
new file mode 100644
index 000000000..8216336a9
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_gsm_fr_encode_sp.i
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_gsm_fr_encode_sp.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,gsm_fr_encode_sp);
+
+vocoder_gsm_fr_encode_sp_sptr vocoder_make_gsm_fr_encode_sp();
+
+class vocoder_gsm_fr_encode_sp : public gr_sync_decimator
+{
+public:
+ ~vocoder_gsm_fr_encode_sp();
+};
diff --git a/gr-gsm-fr-vocoder/src/lib/gsm_full_rate.i b/gr-vocoder/swig/vocoder_swig.i
index 20bf8fdea..71a2952dd 100644
--- a/gr-gsm-fr-vocoder/src/lib/gsm_full_rate.i
+++ b/gr-vocoder/swig/vocoder_swig.i
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2005,2009 Free Software Foundation, Inc.
+ * Copyright 2011 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -22,34 +22,26 @@
%include "gnuradio.i"
-%{
-#include "gsm_fr_encode_sp.h"
-#include "gsm_fr_decode_ps.h"
-%}
-
-GR_SWIG_BLOCK_MAGIC(gsm_fr,encode_sp);
-
-gsm_fr_encode_sp_sptr gsm_fr_make_encode_sp ();
-
-class gsm_fr_encode_sp : public gr_sync_decimator {
-public:
- ~gsm_fr_encode_sp ();
-};
-
-// ----------------------------------------------------------------
-
-GR_SWIG_BLOCK_MAGIC(gsm_fr,decode_ps);
-
-gsm_fr_decode_ps_sptr gsm_fr_make_decode_ps ();
-
-class gsm_fr_decode_ps : public gr_sync_interpolator {
-public:
- ~gsm_fr_decode_ps ();
-};
+%include "vocoder_alaw_decode_bs.i"
+%include "vocoder_alaw_encode_sb.i"
+%include "vocoder_codec2_decode_ps.i"
+%include "vocoder_codec2_encode_sp.i"
+%include "vocoder_cvsd_decode_bs.i"
+%include "vocoder_cvsd_encode_sb.i"
+%include "vocoder_g721_decode_bs.i"
+%include "vocoder_g721_encode_sb.i"
+%include "vocoder_g723_24_decode_bs.i"
+%include "vocoder_g723_24_encode_sb.i"
+%include "vocoder_g723_40_decode_bs.i"
+%include "vocoder_g723_40_encode_sb.i"
+%include "vocoder_gsm_fr_decode_ps.i"
+%include "vocoder_gsm_fr_encode_sp.i"
+%include "vocoder_ulaw_decode_bs.i"
+%include "vocoder_ulaw_encode_sb.i"
#if SWIGGUILE
%scheme %{
-(load-extension-global "libguile-gnuradio-gsm_full_rate" "scm_init_gnuradio_gsm_full_rate_module")
+(load-extension-global "libguile-gnuradio-vocoder" "scm_init_gnuradio_gsm_vocoder_module")
%}
%goops %{
diff --git a/gr-vocoder/swig/vocoder_ulaw_decode_bs.i b/gr-vocoder/swig/vocoder_ulaw_decode_bs.i
new file mode 100644
index 000000000..5e8e8c9ae
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_ulaw_decode_bs.i
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_ulaw_decode_bs.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,ulaw_decode_bs);
+
+vocoder_ulaw_decode_bs_sptr vocoder_make_ulaw_decode_bs();
+
+class vocoder_ulaw_decode_bs : public gr_sync_block
+{
+private:
+ vocoder_ulaw_decode_bs();
+};
diff --git a/gr-vocoder/swig/vocoder_ulaw_encode_sb.i b/gr-vocoder/swig/vocoder_ulaw_encode_sb.i
new file mode 100644
index 000000000..1665df480
--- /dev/null
+++ b/gr-vocoder/swig/vocoder_ulaw_encode_sb.i
@@ -0,0 +1,35 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 2011 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * GNU Radio is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3, or (at your option)
+ * any later version.
+ *
+ * GNU Radio is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Radio; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
+ */
+
+%{
+#include "vocoder_ulaw_encode_sb.h"
+%}
+
+GR_SWIG_BLOCK_MAGIC(vocoder,ulaw_encode_sb);
+
+vocoder_ulaw_encode_sb_sptr vocoder_make_ulaw_encode_sb();
+
+class vocoder_ulaw_encode_sb : public gr_sync_block
+{
+private:
+ vocoder_ulaw_encode_sb();
+};
diff --git a/gr-wxgui/grc/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml
index c200790f9..f9df9d4ac 100644
--- a/gr-wxgui/grc/wxgui_constellationsink2.xml
+++ b/gr-wxgui/grc/wxgui_constellationsink2.xml
@@ -18,7 +18,7 @@ constsink_gl.const_sink_c(
const_size=$const_size,
M=$M,
theta=$theta,
- alpha=$alpha,
+ loop_bw=$loop_bw,
fmax=$fmax,
mu=$mu,
gain_mu=$gain_mu,
@@ -71,9 +71,9 @@ $(parent).GridAdd(self.$(id).win, $(', '.join(map(str, $grid_pos()))))
<type>real</type>
</param>
<param>
- <name>Alpha</name>
- <key>alpha</key>
- <value>0.005</value>
+ <name>Loop Bandwidth</name>
+ <key>loop_bw</key>
+ <value>6.28/100.0</value>
<type>real</type>
</param>
<param>
diff --git a/gr-wxgui/src/python/const_window.py b/gr-wxgui/src/python/const_window.py
index f7c7caf07..2ad89b2a3 100644
--- a/gr-wxgui/src/python/const_window.py
+++ b/gr-wxgui/src/python/const_window.py
@@ -36,7 +36,7 @@ import forms
# Constants
##################################################
SLIDER_STEPS = 200
-ALPHA_MIN_EXP, ALPHA_MAX_EXP = -6, -0.301
+LOOP_BW_MIN_EXP, LOOP_BW_MAX_EXP = -6, 0.0
GAIN_MU_MIN_EXP, GAIN_MU_MAX_EXP = -6, -0.301
DEFAULT_FRAME_RATE = gr.prefs().get_long('wxgui', 'const_rate', 5)
DEFAULT_WIN_SIZE = (500, 400)
@@ -70,19 +70,19 @@ class control_panel(wx.Panel):
parent=self, label='Options',
bold=True, orient=wx.VERTICAL,
)
- #alpha
+ #loop_bw
control_box.AddStretchSpacer()
forms.text_box(
- sizer=control_box, parent=self, label='Alpha',
+ sizer=control_box, parent=self, label='Loop Bandwidth',
converter=forms.float_converter(),
- ps=parent, key=ALPHA_KEY,
+ ps=parent, key=LOOP_BW_KEY,
)
forms.log_slider(
sizer=control_box, parent=self,
- min_exp=ALPHA_MIN_EXP,
- max_exp=ALPHA_MAX_EXP,
+ min_exp=LOOP_BW_MIN_EXP,
+ max_exp=LOOP_BW_MAX_EXP,
num_steps=SLIDER_STEPS,
- ps=parent, key=ALPHA_KEY,
+ ps=parent, key=LOOP_BW_KEY,
)
#gain_mu
control_box.AddStretchSpacer()
@@ -127,8 +127,7 @@ class const_window(wx.Panel, pubsub.pubsub):
size,
title,
msg_key,
- alpha_key,
- beta_key,
+ loop_bw_key,
gain_mu_key,
gain_omega_key,
omega_key,
@@ -137,8 +136,7 @@ class const_window(wx.Panel, pubsub.pubsub):
pubsub.pubsub.__init__(self)
#proxy the keys
self.proxy(MSG_KEY, controller, msg_key)
- self.proxy(ALPHA_KEY, controller, alpha_key)
- self.proxy(BETA_KEY, controller, beta_key)
+ self.proxy(LOOP_BW_KEY, controller, loop_bw_key)
self.proxy(GAIN_MU_KEY, controller, gain_mu_key)
self.proxy(GAIN_OMEGA_KEY, controller, gain_omega_key)
self.proxy(OMEGA_KEY, controller, omega_key)
@@ -164,8 +162,6 @@ class const_window(wx.Panel, pubsub.pubsub):
main_box.Add(self.control_panel, 0, wx.EXPAND)
self.SetSizerAndFit(main_box)
#alpha and gain mu 2nd orders
- def set_beta(alpha): self[BETA_KEY] = .25*alpha**2
- self.subscribe(ALPHA_KEY, set_beta)
def set_gain_omega(gain_mu): self[GAIN_OMEGA_KEY] = .25*gain_mu**2
self.subscribe(GAIN_MU_KEY, set_gain_omega)
#register events
diff --git a/gr-wxgui/src/python/constants.py b/gr-wxgui/src/python/constants.py
index 070be0808..08cc6a634 100644
--- a/gr-wxgui/src/python/constants.py
+++ b/gr-wxgui/src/python/constants.py
@@ -73,3 +73,4 @@ NUM_BINS_KEY = 'num_bins'
FRAME_SIZE_KEY = 'frame_size'
CHANNEL_OPTIONS_KEY = 'channel_options'
SHOW_CONTROL_PANEL_KEY = 'show_control_panel'
+LOOP_BW_KEY = 'loop_bw'
diff --git a/gr-wxgui/src/python/constsink_gl.py b/gr-wxgui/src/python/constsink_gl.py
index 91bc65d9f..51434df68 100644
--- a/gr-wxgui/src/python/constsink_gl.py
+++ b/gr-wxgui/src/python/constsink_gl.py
@@ -27,6 +27,12 @@ import common
from gnuradio import gr, blks2
from pubsub import pubsub
from constants import *
+import sys
+try:
+ from gnuradio import digital
+except ImportError:
+ sys.stderr.write("Error: could not import gnuradio.digital, please install gr-digitial.\n")
+ sys.exit(1)
##################################################
# Constellation sink block (wrapper for old wxgui)
@@ -47,7 +53,7 @@ class const_sink_c(gr.hier_block2, common.wxgui_hb):
#mpsk recv params
M=4,
theta=0,
- alpha=0.005,
+ loop_bw=6.28/100.0,
fmax=0.06,
mu=0.5,
gain_mu=0.005,
@@ -68,16 +74,18 @@ class const_sink_c(gr.hier_block2, common.wxgui_hb):
vec_rate=frame_rate,
vec_len=const_size,
)
- beta = .25*alpha**2 #redundant, will be updated
fmin = -fmax
gain_omega = .25*gain_mu**2 #redundant, will be updated
omega = 1 #set_sample_rate will update this
# Costas frequency/phase recovery loop
# Critically damped 2nd order PLL
- self._costas = gr.costas_loop_cc(alpha, beta, fmax, fmin, M)
+ self._costas = digital.costas_loop_cc(loop_bw, M)
# Timing recovery loop
# Critically damped 2nd order DLL
- self._retime = gr.clock_recovery_mm_cc(omega, gain_omega, mu, gain_mu, omega_limit)
+ self._retime = digital.clock_recovery_mm_cc(omega,
+ gain_omega,
+ mu, gain_mu,
+ omega_limit)
#sync = gr.mpsk_receiver_cc(
# M, #psk order
# theta,
@@ -97,10 +105,8 @@ class const_sink_c(gr.hier_block2, common.wxgui_hb):
#controller
def setter(p, k, x): p[k] = x
self.controller = pubsub()
- self.controller.subscribe(ALPHA_KEY, self._costas.set_alpha)
- self.controller.publish(ALPHA_KEY, self._costas.alpha)
- self.controller.subscribe(BETA_KEY, self._costas.set_beta)
- self.controller.publish(BETA_KEY, self._costas.beta)
+ self.controller.subscribe(LOOP_BW_KEY, self._costas.set_loop_bandwidth)
+ self.controller.publish(LOOP_BW_KEY, self._costas.get_loop_bandwidth)
self.controller.subscribe(GAIN_MU_KEY, self._retime.set_gain_mu)
self.controller.publish(GAIN_MU_KEY, self._retime.gain_mu)
self.controller.subscribe(OMEGA_KEY, self._retime.set_omega)
@@ -121,8 +127,7 @@ class const_sink_c(gr.hier_block2, common.wxgui_hb):
size=size,
title=title,
msg_key=MSG_KEY,
- alpha_key=ALPHA_KEY,
- beta_key=BETA_KEY,
+ loop_bw_key=LOOP_BW_KEY,
gain_mu_key=GAIN_MU_KEY,
gain_omega_key=GAIN_OMEGA_KEY,
omega_key=OMEGA_KEY,
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am
index a9f9427e9..9813154bd 100644
--- a/grc/blocks/Makefile.am
+++ b/grc/blocks/Makefile.am
@@ -30,10 +30,6 @@ dist_ourdata_DATA = \
blks2_analysis_filterbank.xml \
blks2_cvsd_encode.xml \
blks2_cvsd_decode.xml \
- blks2_dxpsk_demod.xml \
- blks2_dxpsk_mod.xml \
- blks2_dxpsk2_demod.xml \
- blks2_dxpsk2_mod.xml \
blks2_error_rate.xml \
blks2_fm_deemph.xml \
blks2_fm_demod_cf.xml \
@@ -71,12 +67,9 @@ dist_ourdata_DATA = \
gr_and_xx.xml \
gr_and_const_xx.xml \
gr_argmax_xx.xml \
- gr_binary_slicer_fb.xml \
gr_channel_model.xml \
gr_char_to_float.xml \
gr_chunks_to_symbols.xml \
- gr_clock_recovery_mm_xx.xml \
- gr_cma_equalizer_cc.xml \
gr_complex_to_arg.xml \
gr_complex_to_float.xml \
gr_complex_to_imag.xml \
@@ -85,13 +78,11 @@ dist_ourdata_DATA = \
gr_complex_to_mag_squared.xml \
gr_complex_to_real.xml \
gr_conjugate_cc.xml \
- gr_constellation_decoder_cb.xml \
gr_copy.xml \
- gr_correlate_access_code_bb.xml \
- gr_costas_loop_cc.xml \
gr_cpfsk_bc.xml \
gr_ctcss_squelch_ff.xml \
gr_dc_blocker.xml \
+ gr_cpmmod_bc.xml \
gr_decode_ccsds_27_fb.xml \
gr_deinterleave.xml \
gr_delay.xml \
@@ -109,7 +100,6 @@ dist_ourdata_DATA = \
gr_file_source.xml \
gr_filter_delay_fc.xml \
gr_fir_filter_xxx.xml \
- gr_fll_band_edge_cc.xml \
gr_float_to_char.xml \
gr_float_to_complex.xml \
gr_float_to_short.xml \
@@ -118,6 +108,7 @@ dist_ourdata_DATA = \
gr_freq_xlating_fir_filter_xxx.xml \
gr_frequency_modulator_fc.xml \
gr_glfsr_source_x.xml \
+ gr_gmskmod_bc.xml \
gr_goertzel_fc.xml \
gr_head.xml \
gr_hilbert_fc.xml \
@@ -135,7 +126,6 @@ dist_ourdata_DATA = \
gr_message_sink.xml \
gr_message_source.xml \
gr_moving_average_xx.xml \
- gr_mpsk_receiver_cc.xml \
gr_mpsk_sync_cc.xml \
gr_multiply_const_vxx.xml \
gr_multiply_xx.xml \
diff --git a/grc/blocks/blks2_dxpsk2_mod.xml b/grc/blocks/blks2_dxpsk2_mod.xml
deleted file mode 100644
index bf292be17..000000000
--- a/grc/blocks/blks2_dxpsk2_mod.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##DPSK2 Mod - 2, 4
-###################################################
- -->
-<block>
- <name>DPSK2 Mod</name>
- <key>blks2_dxpsk2_mod</key>
- <import>from gnuradio import blks2</import>
- <make>blks2.$(type)2_mod(
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- gray_code=$gray_code,
- verbose=$verbose,
- log=$log,
-)</make>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>DBPSK</name>
- <key>dbpsk</key>
- </option>
- <option>
- <name>DQPSK</name>
- <key>dqpsk</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>gray_code</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Logging</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>byte</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
-</block>
diff --git a/grc/blocks/blks2_dxpsk_demod.xml b/grc/blocks/blks2_dxpsk_demod.xml
deleted file mode 100644
index 1c96b6cec..000000000
--- a/grc/blocks/blks2_dxpsk_demod.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##DPSK Demod - 2, 4, 8
-###################################################
- -->
-<block>
- <name>DPSK Demod</name>
- <key>blks2_dxpsk_demod</key>
- <import>from gnuradio import blks2</import>
- <make>blks2.$(type)_demod(
- samples_per_symbol=$samples_per_symbol,
- excess_bw=$excess_bw,
- costas_alpha=$costas_alpha,
- gain_mu=$gain_mu,
- mu=$mu,
- omega_relative_limit=$omega_relative_limit,
- gray_code=$gray_code,
- verbose=$verbose,
- log=$log,
-)</make>
- <param>
- <name>Type</name>
- <key>type</key>
- <type>enum</type>
- <option>
- <name>DBPSK</name>
- <key>dbpsk</key>
- </option>
- <option>
- <name>DQPSK</name>
- <key>dqpsk</key>
- </option>
- <option>
- <name>D8PSK</name>
- <key>d8psk</key>
- </option>
- </param>
- <param>
- <name>Samples/Symbol</name>
- <key>samples_per_symbol</key>
- <value>2</value>
- <type>int</type>
- </param>
- <param>
- <name>Excess BW</name>
- <key>excess_bw</key>
- <value>0.35</value>
- <type>real</type>
- </param>
- <param>
- <name>Costas Alpha</name>
- <key>costas_alpha</key>
- <value>0.175</value>
- <type>real</type>
- </param>
- <param>
- <name>Gain Mu</name>
- <key>gain_mu</key>
- <value>0.175</value>
- <type>real</type>
- </param>
- <param>
- <name>Mu</name>
- <key>mu</key>
- <value>0.5</value>
- <type>real</type>
- </param>
- <param>
- <name>Omega Relative Limit</name>
- <key>omega_relative_limit</key>
- <value>0.005</value>
- <type>real</type>
- </param>
- <param>
- <name>Gray Code</name>
- <key>gray_code</key>
- <value>True</value>
- <type>bool</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Verbose</name>
- <key>verbose</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($verbose) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <param>
- <name>Logging</name>
- <key>log</key>
- <value>False</value>
- <type>bool</type>
- <hide>#if str($log) == 'False' then 'part' else 'none'#</hide>
- <option>
- <name>On</name>
- <key>True</key>
- </option>
- <option>
- <name>Off</name>
- <key>False</key>
- </option>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>byte</type>
- </source>
-</block>
diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml
index f82d40f85..ea7d744d4 100644
--- a/grc/blocks/block_tree.xml
+++ b/grc/blocks/block_tree.xml
@@ -110,26 +110,19 @@
<block>gr_unpacked_to_packed_xx</block>
<block>gr_packed_to_unpacked_xx</block>
<block>gr_unpack_k_bits_bb</block>
- <block>gr_binary_slicer_fb</block>
<block>gr_chunks_to_symbols_xx</block>
<block>gr_map_bb</block>
</cat>
<cat>
<name>Synchronizers</name>
- <block>gr_clock_recovery_mm_xx</block>
<block>gr_pfb_clock_sync_xxx</block>
- <block>gr_costas_loop_cc</block>
<block>gr_mpsk_sync_cc</block>
- <block>gr_mpsk_receiver_cc</block>
<block>gr_pll_carriertracking_cc</block>
<block>gr_pll_freqdet_cf</block>
<block>gr_pll_refout_cc</block>
- <block>gr_fll_band_edge_cc</block>
-
- <block>gr_correlate_access_code_bb</block>
<block>gr_pn_correlator_cc</block>
<block>gr_simple_correlator</block>
<block>gr_simple_framer</block>
@@ -182,7 +175,6 @@
<block>gr_single_pole_iir_filter_xx</block>
<block>gr_hilbert_fc</block>
<block>gr_goertzel_fc</block>
- <block>gr_cma_equalizer_cc</block>
<block>gr_rational_resampler_base_xxx</block>
<block>blks2_rational_resampler_xxx</block>
<block>gr_fractional_interpolator_xx</block>
@@ -198,9 +190,10 @@
<block>gr_phase_modulator_fc</block>
<block>gr_quadrature_demod_cf</block>
<block>gr_cpfsk_bc</block>
+ <block>gr_cpmmod_bc</block>
+ <block>gr_gmskmod_bc</block>
<block>gr_diff_phasor_cc</block>
- <block>gr_constellation_decoder_cb</block>
<block>gr_diff_encoder_bb</block>
<block>gr_diff_decoder_bb</block>
@@ -217,12 +210,6 @@
<block>blks2_fm_deemph</block>
<block>blks2_fm_preemph</block>
- <block>blks2_dxpsk_mod</block>
- <block>blks2_dxpsk_demod</block>
-
- <block>blks2_dxpsk2_mod</block>
- <block>blks2_dxpsk2_demod</block>
-
<block>blks2_gmsk_mod</block>
<block>blks2_gmsk_demod</block>
diff --git a/grc/blocks/gr_costas_loop_cc.xml b/grc/blocks/gr_costas_loop_cc.xml
deleted file mode 100644
index e0db8bc5d..000000000
--- a/grc/blocks/gr_costas_loop_cc.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-###################################################
-##Costas Loop
-###################################################
- -->
-<block>
- <name>Costas Loop</name>
- <key>gr_costas_loop_cc</key>
- <import>from gnuradio import gr</import>
- <make>gr.costas_loop_cc($alpha, $beta, $max_freq, $min_freq, $order)</make>
- <callback>set_alpha($alpha)</callback>
- <callback>set_beta($beta)</callback>
- <param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
- <type>real</type>
- </param>
- <param>
- <name>Max Freq</name>
- <key>max_freq</key>
- <type>real</type>
- </param>
- <param>
- <name>Min Freq</name>
- <key>min_freq</key>
- <type>real</type>
- </param>
- <param>
- <name>Order</name>
- <key>order</key>
- <type>int</type>
- </param>
- <sink>
- <name>in</name>
- <type>complex</type>
- </sink>
- <source>
- <name>out</name>
- <type>complex</type>
- </source>
- <source>
- <name>out</name>
- <type>complex</type>
- <optional>1</optional>
- </source>
-</block>
diff --git a/grc/blocks/gr_cpmmod_bc.xml b/grc/blocks/gr_cpmmod_bc.xml
new file mode 100644
index 000000000..da405534e
--- /dev/null
+++ b/grc/blocks/gr_cpmmod_bc.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## Continuous Phase Modulation
+###################################################
+ -->
+<block>
+ <name>Continuous Phase Modulation</name>
+ <key>gr_cpmmod_bc</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.cpmmod_bc($type, $mod_index, $samples_per_symbol, $L, $beta)</make>
+ <param>
+ <name>CPM Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>L-REC (Rectangular phase response)</name>
+ <key>gr.cpm.LREC</key>
+ </option>
+ <option>
+ <name>L-RC (Raised Cosine)</name>
+ <key>gr.cpm.LRC</key>
+ </option>
+ <option>
+ <name>L-SRC (Spectral raised cosine)</name>
+ <key>gr.cpm.LSRC</key>
+ </option>
+ <option>
+ <name>TFM (Tamed frequency modulation)</name>
+ <key>gr.cpm.TFM</key>
+ </option>
+ <option>
+ <name>Gaussian</name>
+ <key>gr.cpm.GAUSSIAN</key>
+ </option>
+ </param>
+ <param>
+ <name>Modulation Index</name>
+ <key>mod_index</key>
+ <value>0.5</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>4</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Pulse Duration (Symbols)</name>
+ <key>L</key>
+ <value>4</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Phase Response Parameter (BT or Beta)</name>
+ <key>beta</key>
+ <value>0.3</value>
+ <type>real</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>byte</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/grc/blocks/gr_gmskmod_bc.xml b/grc/blocks/gr_gmskmod_bc.xml
new file mode 100644
index 000000000..82e47452b
--- /dev/null
+++ b/grc/blocks/gr_gmskmod_bc.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!--
+###################################################
+## GMSK
+###################################################
+ -->
+<block>
+ <name>GMSK Modulator</name>
+ <key>gr_gmskmod_bc</key>
+ <import>from gnuradio import gr</import>
+ <make>gr.gmskmod_bc($samples_per_symbol, $bt, $L)</make>
+ <param>
+ <name>Samples/Symbol</name>
+ <key>samples_per_symbol</key>
+ <value>2</value>
+ <type>int</type>
+ </param>
+ <param>
+ <name>3 dB Time-Bandwith Product</name>
+ <key>bt</key>
+ <value>0.3</value>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Pulse Duration (Symbols)</name>
+ <key>L</key>
+ <value>4</value>
+ <type>int</type>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>byte</type>
+ </sink>
+ <source>
+ <name>out</name>
+ <type>complex</type>
+ </source>
+</block>
diff --git a/grc/blocks/gr_pfb_clock_sync.xml b/grc/blocks/gr_pfb_clock_sync.xml
index 26cacfb3e..3e5e65d12 100644
--- a/grc/blocks/gr_pfb_clock_sync.xml
+++ b/grc/blocks/gr_pfb_clock_sync.xml
@@ -8,7 +8,7 @@
<name>Polyphase Clock Sync</name>
<key>gr_pfb_clock_sync_xxx</key>
<import>from gnuradio import gr</import>
- <make>gr.pfb_clock_sync_$(type)($sps, $alpha, $taps, $filter_size, $init_phase, $max_dev)
+ <make>gr.pfb_clock_sync_$(type)($sps, $alpha, $taps, $filter_size, $init_phase, $max_dev, $osps)
self.$(id).set_beta($beta)</make>
<callback>set_taps($taps)</callback>
<callback>set_alpha($alpha)</callback>
@@ -69,6 +69,11 @@ self.$(id).set_beta($beta)</make>
<key>max_dev</key>
<type>real</type>
</param>
+ <param>
+ <name>Output SPS</name>
+ <key>osps</key>
+ <type>int</type>
+ </param>
<sink>
<name>in</name>
<type>$type.input</type>
diff --git a/grc/blocks/gr_pll_carriertracking_cc.xml b/grc/blocks/gr_pll_carriertracking_cc.xml
index 5b876b259..27e673248 100644
--- a/grc/blocks/gr_pll_carriertracking_cc.xml
+++ b/grc/blocks/gr_pll_carriertracking_cc.xml
@@ -8,15 +8,11 @@
<name>PLL Carrier Tracking</name>
<key>gr_pll_carriertracking_cc</key>
<import>from gnuradio import gr</import>
- <make>gr.pll_carriertracking_cc($alpha, $beta, $max_freq, $min_freq)</make>
+ <make>gr.pll_carriertracking_cc($w, $max_freq, $min_freq)</make>
+ <callback>set_loop_bandwidth($w)</callback>
<param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
+ <name>Loop Bandwidth</name>
+ <key>w</key>
<type>real</type>
</param>
<param>
diff --git a/grc/blocks/gr_pll_freqdet_cf.xml b/grc/blocks/gr_pll_freqdet_cf.xml
index 8ec1fb3bb..d6e4694f0 100644
--- a/grc/blocks/gr_pll_freqdet_cf.xml
+++ b/grc/blocks/gr_pll_freqdet_cf.xml
@@ -8,15 +8,11 @@
<name>PLL Freq Det</name>
<key>gr_pll_freqdet_cf</key>
<import>from gnuradio import gr</import>
- <make>gr.pll_freqdet_cf($alpha, $beta, $max_freq, $min_freq)</make>
+ <make>gr.pll_freqdet_cf($w, $max_freq, $min_freq)</make>
+ <callback>set_loop_bandwidth($w)</callback>
<param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
+ <name>Loop Bandwidth</name>
+ <key>w</key>
<type>real</type>
</param>
<param>
diff --git a/grc/blocks/gr_pll_refout_cc.xml b/grc/blocks/gr_pll_refout_cc.xml
index 64cf2bfb6..b231ddd19 100644
--- a/grc/blocks/gr_pll_refout_cc.xml
+++ b/grc/blocks/gr_pll_refout_cc.xml
@@ -8,15 +8,11 @@
<name>PLL Ref Out</name>
<key>gr_pll_refout_cc</key>
<import>from gnuradio import gr</import>
- <make>gr.pll_refout_cc($alpha, $beta, $max_freq, $min_freq)</make>
+ <make>gr.pll_refout_cc($w, $max_freq, $min_freq)</make>
+ <callback>set_loop_bandwidth($w)</callback>
<param>
- <name>Alpha</name>
- <key>alpha</key>
- <type>real</type>
- </param>
- <param>
- <name>Beta</name>
- <key>beta</key>
+ <name>Loop Bandwidth</name>
+ <key>w</key>
<type>real</type>
</param>
<param>
diff --git a/gruel/src/swig/Makefile.swig.gen b/gruel/src/swig/Makefile.swig.gen
index c6a2fb956..97aff8104 100644
--- a/gruel/src/swig/Makefile.swig.gen
+++ b/gruel/src/swig/Makefile.swig.gen
@@ -20,20 +20,20 @@
# Boston, MA 02110-1301, USA.
#
-# Makefile.swig.gen for gnuradio_core_runtime.i
+# Makefile.swig.gen for pmt_swig.i
## Default install locations for these files:
##
## Default location for the Python directory is:
-## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_runtime
+## ${prefix}/lib/python${python_version}/site-packages/[category]/pmt_swig
## Default location for the Python exec directory is:
-## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_runtime
+## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/pmt_swig
##
## The following can be overloaded to change the install location, but
## this has to be done in the including Makefile.am -before-
## Makefile.swig is included.
-pmt_swig_pythondir_category ?= gruel/pmt_swig
+pmt_swig_pythondir_category ?= gnuradio/pmt_swig
pmt_swig_pylibdir_category ?= $(pmt_swig_pythondir_category)
pmt_swig_pythondir = $(pythondir)/$(pmt_swig_pythondir_category)
pmt_swig_pylibdir = $(pyexecdir)/$(pmt_swig_pylibdir_category)
@@ -44,7 +44,7 @@ pmt_swig_pylibdir = $(pyexecdir)/$(pmt_swig_pylibdir_category)
pmt_swig_scmlibdir = $(libdir)
# The scm files for the guile modules get installed where ever guile
-# is installed, usually /usr/share/guile/site/gnuradio_core_runtime
+# is installed, usually /usr/share/guile/site/pmt_swig
# FIXME: determince whether these should be installed with gnuradio.
pmt_swig_scmdir = $(guiledir)
@@ -105,11 +105,41 @@ _pmt_swig_la_CXXFLAGS = \
$(pmt_swig_la_swig_cxxflags)
python/pmt_swig.cc: pmt_swig.py
-pmt_swig.py: pmt_swig.i
+pmt_swig.py: pmt_swig.i
# Include the python dependencies for this file
-include python/pmt_swig.d
endif # end of if python
+if GUILE
+
+pmt_swig_scmlib_LTLIBRARIES = \
+ libguile-gnuradio-pmt_swig.la
+libguile_gnuradio_pmt_swig_la_SOURCES = \
+ guile/pmt_swig.cc \
+ $(pmt_swig_la_swig_sources)
+nobase_pmt_swig_scm_DATA = \
+ gnuradio/pmt_swig.scm \
+ gnuradio/pmt_swig-primitive.scm
+libguile_gnuradio_pmt_swig_la_LIBADD = \
+ $(STD_SWIG_LA_LIB_ADD) \
+ $(pmt_swig_la_swig_libadd)
+libguile_gnuradio_pmt_swig_la_LDFLAGS = \
+ $(STD_SWIG_LA_LD_FLAGS) \
+ $(pmt_swig_la_swig_ldflags)
+libguile_gnuradio_pmt_swig_la_CXXFLAGS = \
+ $(STD_SWIG_CXX_FLAGS) \
+ -I$(top_builddir) \
+ $(pmt_swig_la_swig_cxxflags)
+
+guile/pmt_swig.cc: gnuradio/pmt_swig.scm
+gnuradio/pmt_swig.scm: pmt_swig.i
+gnuradio/pmt_swig-primitive.scm: gnuradio/pmt_swig.scm
+
+# Include the guile dependencies for this file
+-include guile/pmt_swig.d
+
+endif # end of GUILE
+
diff --git a/usrp/host/swig/Makefile.swig.gen b/usrp/host/swig/Makefile.swig.gen
index b4cc97caa..b772e97da 100644
--- a/usrp/host/swig/Makefile.swig.gen
+++ b/usrp/host/swig/Makefile.swig.gen
@@ -105,7 +105,7 @@ _usrp_prims_la_CXXFLAGS = \
$(usrp_prims_la_swig_cxxflags)
python/usrp_prims.cc: usrp_prims.py
-usrp_prims.py: usrp_prims.i
+usrp_prims.py: usrp_prims.i
# Include the python dependencies for this file
-include python/usrp_prims.d
diff --git a/version.sh b/version.sh
index 05ffe83b4..df20514d6 100644
--- a/version.sh
+++ b/version.sh
@@ -1,4 +1,4 @@
MAJOR_VERSION=3
-API_COMPAT=4
-MINOR_VERSION=2
-MAINT_VERSION=git
+API_COMPAT=5
+MINOR_VERSION=git
+MAINT_VERSION= \ No newline at end of file