分享

getFft

 子路问学 2011-03-10

public int getFft (byte[] fft)

引入自:API 级别9

Returns a frequency capture of currently playing audio content.

This method must be called when the Visualizer is enabled.

The capture is an 8-bit magnitude FFT, the frequency range covered being 0 (DC) to half of the sampling rate returned by getSamplingRate(). The capture returns the real and imaginary parts of a number of frequency points equal to half of the capture size plus one.

Note: only the real part is returned for the first point (DC) and the last point (sampling frequency / 2).

The layout in the returned byte array is as follows:

  • n is the capture size returned by getCaptureSize()
  • Rfk, Ifk are respectively the real and imaginary parts of the kth frequency component
  • If Fs is the sampling frequency retuned by getSamplingRate() the kth frequency is: (k*Fs)/(n/2)
Index

 

0

 

1

 

2

 

3

 

4

 

5

 

...

 

n - 2

 

n - 1

 

Data

 

Rf0

 

Rf(n/2)

 

Rf1

 

If1

 

Rf2

 

If2

 

...

 

Rf(n-1)/2

 

If(n-1)/2

 

 

参数
fft array of bytes where the FFT should be returned
返回值

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多