diff options
Diffstat (limited to 'gr-analog/grc/analog_random_source_x.block.yml')
-rw-r--r-- | gr-analog/grc/analog_random_source_x.block.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/gr-analog/grc/analog_random_source_x.block.yml b/gr-analog/grc/analog_random_source_x.block.yml new file mode 100644 index 0000000000..595aa81b6d --- /dev/null +++ b/gr-analog/grc/analog_random_source_x.block.yml @@ -0,0 +1,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 |