You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.0KB

  1. <h3>Summary</h3>
  2. <p>Detect the level of a single tone</p>
  3. <h3>Audio Connections</h3>
  4. <table class=doc align=center cellpadding=3>
  5. <tr class=top><th>Port</th><th>Purpose</th></tr>
  6. <tr class=odd><td align=center>In 0</td><td>Signal to analyze</td></tr>
  7. </table>
  8. <h3>Functions</h3>
  9. <p class=func><span class=keyword>frequency</span>(freq);</p>
  10. <p class=desc>Set the frequency to detect. The default detection time
  11. will be 10 cycles of this frequency.
  12. </p>
  13. <p class=func><span class=keyword>frequency</span>(freq, cycles);</p>
  14. <p class=desc>Set the frequency to detect, and the number of cycles.
  15. Longer detection time (more cycles) will give higher precision,
  16. but of course slower response.
  17. </p>
  18. <p class=func><span class=keyword>available</span>();</p>
  19. <p class=desc>Returns true (non-zero) each time a detection interval
  20. (number of cycles) completed and a new level is detected.
  21. </p>
  22. <p class=func><span class=keyword>read</span>();</p>
  23. <p class=desc>Read the detected signal level. Range is 0 to 1.0.
  24. </p>
  25. <p class=func><span class=keyword>threshold</span>(level);</p>
  26. <p class=desc>Set a detection threshold, where the bool test operation
  27. will return true if at or above this level, or false when below.
  28. </p>
  29. <p class=func>(bool)</p>
  30. <p class=desc>By testing the object as a boolean value, you can respond
  31. to detection of a tone.
  32. </p>
  33. <h3>Examples</h3>
  34. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_Serial
  35. </p>
  36. <p class=exam>File &gt; Examples &gt; Audio &gt; Analysis &gt; DialTone_7segment
  37. </p>
  38. <h3>Notes</h3>
  39. <p>Low frequency detection has trouble with numerical precision.
  40. Works really well for all 8 DTMF frequencies, but fails for
  41. detecting "sub audible tones" used in some control applications.</p>
  42. <p>The (bool) test continues to return true until the next detection
  43. interval (the configured number of cycles). This behavior may
  44. change in future versions, for a single true each time the signal
  45. is detected, and then false for the remainder of that interval.</p>