~ubuntu-branches/ubuntu/precise/gnuradio/precise

« back to all changes in this revision

Viewing changes to grc/blocks/random_source_x.xml

  • Committer: Bazaar Package Importer
  • Author(s): Kamal Mostafa
  • Date: 2010-03-13 07:46:01 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100313074601-zjsa893a87bozyh7
Tags: 3.2.2.dfsg-1ubuntu1
* Fix build for Ubuntu lucid (LP: #260406)
  - add binary package dep for libusrp0, libusrp2-0: adduser
  - debian/rules clean: remove pre-built Qt moc files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
<!--
 
3
###################################################
 
4
##Random Source:
 
5
##      Custom block
 
6
###################################################
 
7
 -->
 
8
<block>
 
9
        <name>Random Source</name>
 
10
        <key>random_source_x</key>
 
11
        <import>from gnuradio import gr</import>
 
12
        <import>import numpy</import>
 
13
        <make>gr.vector_source_$(type.fcn)(map(int, numpy.random.randint($min, $max, $num_samps)), $repeat)</make>
 
14
        <param>
 
15
                <name>Output Type</name>
 
16
                <key>type</key>
 
17
                <type>enum</type>
 
18
                <option>
 
19
                        <name>Int</name>
 
20
                        <key>int</key>
 
21
                        <opt>fcn:i</opt>
 
22
                </option>
 
23
                <option>
 
24
                        <name>Short</name>
 
25
                        <key>short</key>
 
26
                        <opt>fcn:s</opt>
 
27
                </option>
 
28
                <option>
 
29
                        <name>Byte</name>
 
30
                        <key>byte</key>
 
31
                        <opt>fcn:b</opt>
 
32
                </option>
 
33
        </param>
 
34
        <param>
 
35
                <name>Minimum</name>
 
36
                <key>min</key>
 
37
                <value>0</value>
 
38
                <type>int</type>
 
39
        </param>
 
40
        <param>
 
41
                <name>Maximum</name>
 
42
                <key>max</key>
 
43
                <value>2</value>
 
44
                <type>int</type>
 
45
        </param>
 
46
        <param>
 
47
                <name>Num Samples</name>
 
48
                <key>num_samps</key>
 
49
                <value>1000</value>
 
50
                <type>int</type>
 
51
        </param>
 
52
        <param>
 
53
                <name>Repeat</name>
 
54
                <key>repeat</key>
 
55
                <value>True</value>
 
56
                <type>enum</type>
 
57
                <option>
 
58
                        <name>Yes</name>
 
59
                        <key>True</key>
 
60
                </option>
 
61
                <option>
 
62
                        <name>No</name>
 
63
                        <key>False</key>
 
64
                </option>
 
65
        </param>
 
66
        <source>
 
67
                <name>out</name>
 
68
                <type>$type</type>
 
69
        </source>
 
70
        <doc>
 
71
Generate num samples of random numbers of [min, max). Repeat samples if specified.
 
72
 
 
73
Ex: With min=0 and max=2, the sequence 01110101... will be generated.
 
74
        </doc>
 
75
</block>