id: analog_wfm_tx
label: WBFM Transmit
flags: [ python, cpp ]

parameters:
-   id: audio_rate
    label: Audio Rate
    dtype: int
-   id: quad_rate
    label: Quadrature Rate
    dtype: int
-   id: tau
    label: Tau
    dtype: real
    default: 75e-6
-   id: max_dev
    label: Max Deviation
    dtype: real
    default: 75e3
-   id: fh
    label: Preemphasis High Corner Freq
    dtype: real
    default: '-1.0'

inputs:
-   domain: stream
    dtype: float

outputs:
-   domain: stream
    dtype: complex

asserts:
- ${ (quad_rate)%(audio_rate) == 0 }

templates:
    imports: from gnuradio import analog
    make: "analog.wfm_tx(\n\taudio_rate=${audio_rate},\n\tquad_rate=${quad_rate},\n\
        \ttau=${tau},\n\tmax_dev=${max_dev},\n\tfh=${fh},\n)"

cpp_templates:
    includes: [ '#include <gnuradio/analog/frequency_modulator_fc.h>', '#include <gnuradio/math.h>' ]
    declarations: gr::analog::frequency_modulator_fc::sptr ${id};
    make: this->${id} = gr::analog::frequency_modulator_fc::make(2 * (GR_M_PI) * ${max_dev} / ${quad_rate});
    link: ['gnuradio::gnuradio-analog']          
      
file_format: 1
