<?xml version="1.0"?>
<block>
  <name>Jay's Peak Detector</name>
  <key>jay_peak_detect</key>
  <category>[jay]</category>
  <import>import jay</import>
  <make>jay.peak_detect($vlen, $framerate, $bandwidth, $fcenter, $peak_height_min, $peak_width_min, $peak_width_max, $alpha_s, $alpha_m)</make>
  <!-- Make one 'param' node for every Parameter you want settable from the GUI.
       Sub-nodes:
       * name
       * key (makes the value accessible as $keyname, e.g. in the make node)
       * type -->
  <param>
    <name>Vector Length</name>
    <key>vlen</key>
    <value>1024</value>
    <type>int</type>
  </param>
  <param>
    <name>Frame Rate</name>
    <key>framerate</key>
    <value>30</value>
    <type>float</type>
  </param>
    <param>
    <name>Bandwidth (Hz)</name>
    <key>bandwidth</key>
    <value>samp_rate</value>
    <type>float</type>
  </param>
  <param>
    <name>Center Frequency (Hz)</name>
    <key>fcenter</key>
    <value>0</value>
    <type>float</type>
  </param>
<param>
    <name>Peak Threshold [dB]</name>
    <key>peak_height_min</key>
    <value>20</value>
    <type>float</type>
  </param>
  <param>
    <name>Peak BW Minimum [Hz]</name>
    <key>peak_width_min</key>
    <value>2000</value>
    <type>float</type>
  </param>
  <param>
    <name>Peak BW Maximum [Hz]</name>
    <key>peak_width_max</key>
    <value>3000</value>
    <type>float</type>
  </param>
  <param>
    <name>Alpha Short</name>
    <key>alpha_s</key>
    <value>0.2</value>
    <type>float</type>
  </param>
  <param>
    <name>Alpha Medium</name>
    <key>alpha_m</key>
    <value>0.04</value>
    <type>float</type>
  </param>

  <!-- Make one 'sink' node per input. Sub-nodes:
       * name (an identifier for the GUI)
       * type
       * vlen
       * optional (set to 1 for optional inputs) -->
  <sink>
    <name>in</name>
    <type>float</type>
    <vlen>$vlen</vlen>
  </sink>
  <sink>
    <name>control</name>
    <type>message</type>
    <optional>1</optional>
  </sink>

  <!-- Make one 'source' node per output. Sub-nodes:
       * name (an identifier for the GUI)
       * type
       * vlen
       * optional (set to 1 for optional inputs) -->
  <source>
    <name>out</name>
    <type>float</type>
    <vlen>$vlen</vlen>
    <optional>1</optional>
  </source>
  <source>
    <name>pbox</name>
    <type>float</type>
    <vlen>$vlen</vlen>
    <optional>1</optional>
  </source>
  <source>
    <name>status</name>
    <type>message</type>
    <optional>1</optional>
  </source>
</block>
