diff options
Diffstat (limited to 'grc')
7 files changed, 169 insertions, 1 deletions
diff --git a/grc/data/platforms/python/block_tree.xml b/grc/data/platforms/python/block_tree.xml index 4cc98b4c5..a234001d8 100644 --- a/grc/data/platforms/python/block_tree.xml +++ b/grc/data/platforms/python/block_tree.xml @@ -237,6 +237,13 @@ <block>gr_descrambler_bb</block> </cat> <cat> + <name>Probes</name> + <block>gr_probe_avg_mag_sqrd_x</block> + <block>gr_probe_density_b</block> + <block>gr_probe_mpsk_snr_c</block> + <block>gr_probe_signal_f</block> + </cat> + <cat> <name>USRP</name> <block>usrp_simple_source_x</block> <block>usrp_simple_sink_x</block> diff --git a/grc/data/platforms/python/blocks/Makefile.am b/grc/data/platforms/python/blocks/Makefile.am index 7bc678180..2d4eec56c 100644 --- a/grc/data/platforms/python/blocks/Makefile.am +++ b/grc/data/platforms/python/blocks/Makefile.am @@ -138,6 +138,10 @@ dist_ourdata_DATA = \ gr_pll_freqdet_cf.xml \ gr_pll_refout_cc.xml \ gr_pn_correlator_cc.xml \ + gr_probe_avg_mag_sqrd_x.xml \ + gr_probe_density_b.xml \ + gr_probe_mpsk_snr_c.xml \ + gr_probe_signal_f.xml \ gr_pwr_squelch_xx.xml \ gr_quadrature_demod_cf.xml \ gr_rational_resampler_base_xxx.xml \ diff --git a/grc/data/platforms/python/blocks/gr_float_to_char.xml b/grc/data/platforms/python/blocks/gr_float_to_char.xml index 5714130ac..907de7743 100644 --- a/grc/data/platforms/python/blocks/gr_float_to_char.xml +++ b/grc/data/platforms/python/blocks/gr_float_to_char.xml @@ -8,7 +8,7 @@ <name>Float To Char</name> <key>gr_float_to_char</key> <import>from gnuradio import gr</import> - <make>gr.gr_float_to_char()</make> + <make>gr.float_to_char()</make> <sink> <name>in</name> <type>float</type> diff --git a/grc/data/platforms/python/blocks/gr_probe_avg_mag_sqrd_x.xml b/grc/data/platforms/python/blocks/gr_probe_avg_mag_sqrd_x.xml new file mode 100644 index 000000000..310d97388 --- /dev/null +++ b/grc/data/platforms/python/blocks/gr_probe_avg_mag_sqrd_x.xml @@ -0,0 +1,56 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe Average Magnitude Squared +################################################### + --> +<block> + <name>Probe Avg Mag^2</name> + <key>gr_probe_avg_mag_sqrd_x</key> + <import>from gnuradio import gr</import> + <import>import threading</import> + <import>import time</import> + <make>gr.probe_avg_mag_sqrd_$(type)($threshold, $alpha) +def _$(id)_run(): + while True: + time.sleep($update_interval) + print "$(id) Level:", self.$(id).level() +threading.Thread(target=_$(id)_run).start()</make> + <callback>set_alpha($alpha)</callback> + <callback>set_threshold($threshold)</callback> + <param> + <name>Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Complex</name> + <key>c</key> + <opt>input:complex</opt> + </option> + <option> + <name>Float</name> + <key>f</key> + <opt>input:float</opt> + </option> + </param> + <param> + <name>Threshold (dB)</name> + <key>threshold</key> + <type>real</type> + </param> + <param> + <name>Alpha</name> + <key>alpha</key> + <type>real</type> + </param> + <param> + <name>Update Interval (s)</name> + <key>update_interval</key> + <value>1.0</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>$type.input</type> + </sink> +</block> diff --git a/grc/data/platforms/python/blocks/gr_probe_density_b.xml b/grc/data/platforms/python/blocks/gr_probe_density_b.xml new file mode 100644 index 000000000..1c529da5f --- /dev/null +++ b/grc/data/platforms/python/blocks/gr_probe_density_b.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe Density +################################################### + --> +<block> + <name>Probe Density</name> + <key>gr_probe_density_b</key> + <import>from gnuradio import gr</import> + <import>import threading</import> + <import>import time</import> + <make>gr.probe_density_b($alpha) +def _$(id)_run(): + while True: + time.sleep($update_interval) + print "$(id) Density:", self.$(id).density() +threading.Thread(target=_$(id)_run).start()</make> + <callback>set_alpha($alpha)</callback> + <param> + <name>Alpha</name> + <key>alpha</key> + <type>real</type> + </param> + <param> + <name>Update Interval (s)</name> + <key>update_interval</key> + <value>1.0</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>byte</type> + </sink> +</block> diff --git a/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml b/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml new file mode 100644 index 000000000..a4a9e00ae --- /dev/null +++ b/grc/data/platforms/python/blocks/gr_probe_mpsk_snr_c.xml @@ -0,0 +1,37 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe MPSK SNR +################################################### + --> +<block> + <name>Probe MPSK SNR</name> + <key>gr_probe_mpsk_snr_c</key> + <import>from gnuradio import gr</import> + <import>import threading</import> + <import>import time</import> + <make>gr.probe_mpsk_snr_c($alpha) +def _$(id)_run(): + while True: + time.sleep($update_interval) + print "$(id) Signal Mean:", self.$(id).signal_mean() + print "$(id) Noise Variance:", self.$(id).noise_variance() + print "$(id) SNR:", self.$(id).snr() +threading.Thread(target=_$(id)_run).start()</make> + <callback>set_alpha($alpha)</callback> + <param> + <name>Alpha</name> + <key>alpha</key> + <type>real</type> + </param> + <param> + <name>Update Interval (s)</name> + <key>update_interval</key> + <value>1.0</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>complex</type> + </sink> +</block> diff --git a/grc/data/platforms/python/blocks/gr_probe_signal_f.xml b/grc/data/platforms/python/blocks/gr_probe_signal_f.xml new file mode 100644 index 000000000..211d4f3a1 --- /dev/null +++ b/grc/data/platforms/python/blocks/gr_probe_signal_f.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Probe Signal +################################################### + --> +<block> + <name>Probe Signal</name> + <key>gr_probe_signal_f</key> + <import>from gnuradio import gr</import> + <import>import threading</import> + <import>import time</import> + <make>gr.probe_signal_f() +def _$(id)_run(): + while True: + time.sleep($update_interval) + print "$(id) Level:", self.$(id).level() +threading.Thread(target=_$(id)_run).start()</make> + <param> + <name>Update Interval (s)</name> + <key>update_interval</key> + <value>1.0</value> + <type>real</type> + </param> + <sink> + <name>in</name> + <type>float</type> + </sink> +</block> |