id: pfb_channelizer_ccf
label: Polyphase Channelizer
flags: [ python, cpp ]

parameters:
-   id: nchans
    label: Channels
    dtype: int
    default: '1'
    hide: part
-   id: taps
    label: Taps
    dtype: real_vector
-   id: osr
    label: Oversampling Ratio
    dtype: real
    default: '1.0'
-   id: atten
    label: Attenuation
    dtype: real
    default: '100'
-   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_source
    label: Bus Connections
    dtype: raw
    default: '[[0,],]'
    hide: part

inputs:
-   domain: stream
    dtype: complex

outputs:
-   domain: stream
    dtype: complex
    multiplicity: ${ nchans }

templates:
    imports: |-
        from gnuradio.filter import pfb
        from gnuradio.filter import firdes
    make: |-
        pfb.channelizer_ccf(
            ${nchans},
            ${taps},
            ${osr},
            ${atten})
        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_channelizer_ccf.h>']
    declarations: 'pfb::channelizer_ccf::sptr ${id};'
    make: |-
        std::vector<float> taps = {${str(taps)[1:-1]}};
        this->${id} = pfb::channelizer_ccf::make(
            ${nchans},
            taps,
            ${osr},
            ${atten});
        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
