Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you only want to detect one frequency, can't you jut use the "slow" fourier transform?


Yes, the discrete Fourier transform (DFT) detects N frequencies in parallel, where N is the block size, and you can disregard the uninteresting frequencies. The fast Fourier transform (FFT) is an efficient algorithm that computes the DFT. For detecting M frequencies where M << N, the Goertzel algorithm requires less computation than the FFT. Also, the Goertzel algorithm allows targeting more exact frequencies regardless of the sampling rate (Fs), while the FFT's bins have a fixed spacing of ±Fs/N.

As with everything, there are trade-offs associated with these three options.


This looks like a row of a DFT, but using the history variables and the single cosine to avoid computing the coefficients from scratch.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: