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.

58 satır
2.6KB

  1. <h3>Summary</h3>
  2. <p>Compute a 256 point Fast Fourier Transform (FFT) frequency analysis,
  3. with real value (magnitude) output. The frequency resolution is
  4. 172 Hz, useful for simple audio visualization.</p>
  5. <h3>Audio Connections</h3>
  6. <table class=doc align=center cellpadding=3>
  7. <tr class=top><th>Port</th><th>Purpose</th></tr>
  8. <tr class=odd><td align=center>In 0</td><td>Signal to convert to frequency bins</td></tr>
  9. </table>
  10. <h3>Functions</h3>
  11. <p class=func><span class=keyword>available</span>();</p>
  12. <p class=desc>Returns true each time the FFT analysis produces new output data.
  13. </p>
  14. <p class=func><span class=keyword>read</span>(binNumber);</p>
  15. <p class=desc>Read a single frequency bin, from 0 to 127. The result is scaled
  16. so 1.0 represents a full scale sine wave.
  17. </p>
  18. <p class=func><span class=keyword>read</span>(firstBin, lastBin);</p>
  19. <p class=desc>Read several frequency bins, returning their sum. The higher
  20. audio octaves are represented by many bins, which are typically read
  21. as a group for audio visualization.
  22. </p>
  23. <p class=func><span class=keyword>averageTogether</span>(number);</p>
  24. <p class=desc>New data is produced very radidly, approximately 344 times
  25. per second. Multiple outputs can be averaged together, so available()
  26. returns true at a slower rate.
  27. </p>
  28. <p class=func><span class=keyword>windowFunction</span>(window);</p>
  29. <p class=desc>Set the window function to be used. AudioWindowHanning256
  30. is the default. Windowing may be disabled by NULL, but windowing
  31. should be used for all non-periodic (music) signals, and all periodic
  32. signals that are not exact integer division of the sample rate.
  33. </p>
  34. <h3>Examples</h3>
  35. <p class=exam>File &gt; Examples &gt; Audio &gt; MemoryAndCpuUsage
  36. </p>
  37. <h3>Notes</h3>
  38. <p>The raw 16 bit output data bins may be access with myFFT.output[num], where
  39. num is 0 to 127.</p>
  40. <p>TODO: caveats about spectral leakage vs frequency precision for arbitrary signals</p>
  41. <p>Window Types:
  42. <ul>
  43. <li><span class=literal>AudioWindowHanning256</span> (default)</li>
  44. <li><span class=literal>AudioWindowBartlett256</span></li>
  45. <li><span class=literal>AudioWindowBlackman256</span></li>
  46. <li><span class=literal>AudioWindowFlattop256</span></li>
  47. <li><span class=literal>AudioWindowBlackmanHarris256</span></li>
  48. <li><span class=literal>AudioWindowNuttall256</span></li>
  49. <li><span class=literal>AudioWindowBlackmanNuttall256</span></li>
  50. <li><span class=literal>AudioWindowWelch256</span></li>
  51. <li><span class=literal>AudioWindowHamming256</span></li>
  52. <li><span class=literal>AudioWindowCosine256</span></li>
  53. <li><span class=literal>AudioWindowTukey256</span></li>
  54. </ul>
  55. </p>