diff options
Diffstat (limited to 'grc/data/grc_gnuradio/blocks/random_source_x.xml')
-rw-r--r-- | grc/data/grc_gnuradio/blocks/random_source_x.xml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/grc/data/grc_gnuradio/blocks/random_source_x.xml b/grc/data/grc_gnuradio/blocks/random_source_x.xml new file mode 100644 index 000000000..f04dcd8da --- /dev/null +++ b/grc/data/grc_gnuradio/blocks/random_source_x.xml @@ -0,0 +1,73 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Random Source: +## Custom block +################################################### + --> +<block> + <name>Random Source</name> + <key>random_source_x</key> + <import>from gnuradio import gr</import> + <import>import numpy</import> + <make>gr.vector_source_$(type.fcn)(numpy.random.randint($min, $max, $num_samps), $repeat)</make> + <param> + <name>Output Type</name> + <key>type</key> + <type>enum</type> + <option> + <name>Int</name> + <key>int</key> + <opt>fcn:i</opt> + </option> + <option> + <name>Short</name> + <key>short</key> + <opt>fcn:s</opt> + </option> + <option> + <name>Byte</name> + <key>byte</key> + <opt>fcn:b</opt> + </option> + </param> + <param> + <name>Minimum</name> + <key>min</key> + <value>0</value> + <type>int</type> + </param> + <param> + <name>Maximum</name> + <key>max</key> + <value>1</value> + <type>int</type> + </param> + <param> + <name>Num Samples</name> + <key>num_samps</key> + <value>1000</value> + <type>int</type> + </param> + <param> + <name>Repeat</name> + <key>repeat</key> + <value>True</value> + <type>enum</type> + <option> + <name>Yes</name> + <key>True</key> + </option> + <option> + <name>No</name> + <key>False</key> + </option> + </param> + <source> + <name>out</name> + <type>$type</type> + </source> + <doc> +Generate num samples of random numbers of [min, max). Repeat samples if specified. + </doc> +</block> |