id: pfb_synthesizer_ccf
label: Polyphase Synthesizer
flags: [ python, cpp ]

parameters:
-   id: numchans
    label: Channels
    dtype: int
    default: '2'
-   id: connections
    label: Connections
    dtype: int
    default: '2'
    hide: part
-   id: taps
    label: Taps
    dtype: real_vector
-   id: twox
    label: 2x Sample Rate
    dtype: bool
    default: 'False'
-   id: samp_delay
    label: Sample Delay
    dtype: int
    default: '0'
    hide: part
-   id: ch_map
    label: Channel Map
    dtype: int_vector
    default: '[]'
-   id: bus_structure_sink
    label: Bus Connections
    dtype: raw
    default: '[[0,],]'
    hide: part

inputs:
-   domain: stream
    dtype: complex
    multiplicity: ${ connections }

outputs:
-   domain: stream
    dtype: complex

templates:
    imports: |-
        from gnuradio import filter
        from gnuradio.filter import firdes
    make: |-
        filter.pfb_synthesizer_ccf(
            ${numchans},
            ${taps},
            ${twox})
        self.${id}.set_channel_map(${ch_map})
        self.${id}.declare_sample_delay(${samp_delay})
    callbacks:
    - set_taps(${taps})
    - set_channel_map(${ch_map})

cpp_templates:
    includes: ['#include <gnuradio/filter/pfb_synthesizer_ccf.h>']
    declarations: 'gr::filter::pfb_synthesizer_ccf::sptr ${id};'
    make: |-
        std::vector<float> taps = {${str(eval(taps))[1:-1]}};
        std::vector<int> ch_map = {${str(ch_map)[1:-1]}};
        this->${id} = gr::filter::pfb_synthesizer_ccf::make(
            ${numchans},
            taps,
            ${twox});
        this->${id}->set_channel_map(ch_map);
        this->${id}->declare_sample_delay(${samp_delay});
    link: ['gnuradio::gnuradio-filter']
    callbacks:
    - set_taps(taps)
    - set_channel_map(ch_map)

file_format: 1
