id: variable_low_pass_filter_taps
label: Low-pass Filter Taps
flags: [ show_id, python, cpp]

parameters:
-   id: gain
    label: Gain
    dtype: float
    default: '1.0'
-   id: samp_rate
    label: Sample Rate (Hz)
    dtype: float
    default: samp_rate
-   id: cutoff_freq
    label: 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: ${ firdes.low_pass(gain, samp_rate, cutoff_freq, width, win, beta) }

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

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

documentation: |-
    This variable is a convenience wrapper around a call to firdes.low_pass(...).

        The beta parameter only applies to the Kaiser window.

file_format: 1
