summaryrefslogtreecommitdiff
path: root/gr-analog/grc/analog_random_source_x.block.yml
blob: 595aa81b6dfb990029a3b89ca30abd4ca248c8c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
id: analog_random_source_x
label: Random Source

parameters:
-   id: type
    label: Output Type
    dtype: enum
    options: [int, short, byte]
    option_attributes:
        fcn: [i, s, b]
    hide: part
-   id: min
    label: Minimum
    dtype: int
    default: '0'
-   id: max
    label: Maximum
    dtype: int
    default: '2'
-   id: num_samps
    label: Num Samples
    dtype: int
    default: '1000'
-   id: repeat
    label: Repeat
    dtype: enum
    default: 'True'
    options: ['True', 'False']
    option_labels: ['Yes', 'No']

outputs:
-   domain: stream
    dtype: ${ type }

templates:
    imports: |-
        from gnuradio import blocks
        import numpy
    make: blocks.vector_source_${type.fcn}(map(int, numpy.random.randint(${min}, ${max},
        ${num_samps})), ${repeat})

documentation: |-
    Generate num samples of random numbers of [min, max). Repeat samples if specified.

    Ex: With min=0 and max=2, the sequence 01110101... will be generated.

file_format: 1