id: variable_band_pass_filter_taps
label: Band-pass Filter Taps
flags: [ show_id, python, cpp ]

parameters:
-   id: type
    label: Tap Type
    dtype: enum
    options: [band_pass, complex_band_pass]
    option_labels: [Real, Complex]
-   id: gain
    label: Gain
    dtype: float
    default: '1.0'
-   id: samp_rate
    label: Sample Rate (Hz)
    dtype: float
    default: samp_rate
-   id: low_cutoff_freq
    label: Low Cutoff Freq (Hz)
    dtype: float
-   id: high_cutoff_freq
    label: High Cutoff Freq (Hz)
    dtype: float
-   id: width
    label: Transition Width (Hz)
    dtype: float
-   id: win
    label: Window
    dtype: raw
    default: window.WIN_HAMMING
    options: [window.WIN_HAMMING, window.WIN_HANN, window.WIN_BLACKMAN, window.WIN_RECTANGULAR,
        window.WIN_KAISER]
    option_labels: [Hamming, Hann, Blackman, Rectangular, Kaiser]
-   id: beta
    label: Beta
    dtype: float
    default: '6.76'
-   id: value
    dtype: float_vector
    hide: all
value: ${ getattr(firdes, str(type))(gain, samp_rate, low_cutoff_freq, high_cutoff_freq,
    width, win, beta) }

templates:
    imports: from gnuradio.filter import firdes
    var_make: |-
        self.${id} = ${id} = firdes.${type}(${gain}, ${samp_rate}, ${low_cutoff_freq}, \
        ${high_cutoff_freq}, ${width}, ${win}, ${beta})
    callbacks:
    - self.set_${id}(firdes.${type}(${gain}, ${samp_rate}, ${low_cutoff_freq}, ${high_cutoff_freq}, ${width}, ${win}, ${beta}))

cpp_templates:
    includes: ['#include <gnuradio/filter/firdes.h>']
    declarations: 'filter::firdes::sptr ${id};'
    var_make: |-
        ${id} = filter::firdes::${type}(${gain}, ${samp_rate}, ${low_cutoff_freq}, \
        ${high_cutoff_freq}, ${width}, ${win.replace('window.','fft::window::')}, ${beta});
    link: ['gnuradio::gnuradio-filter']

documentation: |-
    This is a convenience wrapper for calling firdes.band_pass() or firdes.complex_band_pass()

        The beta parameter only applies to the Kaiser window.

file_format: 1
