blob: a921c626f42427a5d281219c4d3810828909008f (
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
48
49
50
51
52
53
54
55
56
57
58
59
|
id: blocks_peak_detector_xb
label: Peak Detector
flags: [ python, cpp ]
parameters:
- id: type
label: Input Type
dtype: enum
options: [float, int, short]
option_attributes:
fcn: [f, i, s]
hide: part
- id: threshold_factor_rise
label: TH Factor Rise
dtype: real
default: '0.25'
- id: threshold_factor_fall
label: TH Factor Fall
dtype: real
default: '0.40'
- id: look_ahead
label: Look Ahead
dtype: int
default: '10'
- id: alpha
label: Alpha
dtype: real
default: '0.001'
inputs:
- domain: stream
dtype: ${ type }
outputs:
- domain: stream
dtype: byte
templates:
imports: from gnuradio import blocks
make: blocks.peak_detector_${type.fcn}b(${threshold_factor_rise}, ${threshold_factor_fall},
${look_ahead}, ${alpha})
callbacks:
- set_threshold_factor_rise(${threshold_factor_rise})
- set_threshold_factor_fall(${threshold_factor_fall})
- set_look_ahead(${look_ahead})
- set_alpha(${alpha})
cpp_templates:
includes: ['#include <gnuradio/blocks/peak_detector.h>']
declarations: 'blocks::peak_detector_${type.fcn}b::sptr ${id};'
make: 'this->${id} = blocks::peak_detector_${type.fcn}b::make(${threshold_factor_rise}, ${threshold_factor_fall},
${look_ahead}, ${alpha});'
callbacks:
- set_threshold_factor_rise(${threshold_factor_rise})
- set_threshold_factor_fall(${threshold_factor_fall})
- set_look_ahead(${look_ahead})
- set_alpha(${alpha})
file_format: 1
|