Peak detection using computeSpectrum () returns FFT values

  • I am developing with ActionScript 3.0 for Flash Player 10.3
  • I am using computeSpectrum () for the downloaded .mp3
  • Launch * Event.ENTER_FRAME * to capture snapshots of each sample in an Array byte
  • ByteArray contains 512 values โ€‹โ€‹(256 for each channel). These values โ€‹โ€‹represent the FFT spectrum, from 0 to 1.
  • I cannot use the peak frequency for each of the samples (as I found out!), Because the highest value is not necessarily the main frequency! As a result, I get a lot of random values โ€‹โ€‹everywhere! Of course, I also get some corrections, but this is not enough!

I found out about autocorrelation ...
Can someone give me an example of how I can use it?

Or links or sample scripts, even from other scripting languages, to capture it?

Regards
initcode

+5
source share
4 answers

It sounds like you already understand how to get the FFT spectrum, right?

spectrumhttp://flic.kr/p/7notw6

But if you are looking for a fundamental (green dot), you cannot just use the highest peak. This is not necessarily fundamental. In my example, the actual fundamental level is 100 Hz, but the highest peak is 300 Hz.

, . comp.dsp "FFT, , /-, AMDF/ASDF".

100 , , , , , - , (1f, 3f, 5f). , , . , , .

. , ( ). FFT, .

  • (FFT () โ‹…FFT () *)

* . Python, :

correlation = fftconvolve(sig, sig[::-1], mode='full')

fftconvolve() : https://github.com/scipy/scipy/blob/master/scipy/signal/signaltools.py#L133

+7

Harmonic Product Spectrum ( ) ( FFT), , ( ).

, ( ). , . . , , .

+1

?

computeSpectrum(), DSP.

, , .

, .

, sqrt(left*left+right*right) . . .

fs = 44,1 , - ,

f = (i/255) * (44100/2);

, . , .

0
source

All Articles