I'm writing a small sound recognition program in C++. So I have an mp3 file which I sampled using mpg123 and got a 32-bit float array. Now I passed this array to FFT function and got some data. How do I extract frequencies?
Asked
Active
Viewed 529 times
-1
-
3Welcome to Stack Overflow @chingachgook, I hope that you will take the time to review [How To Ask](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) because this question lacks the detail required for an answer. – Stefan Crain Apr 12 '18 at 15:10
1 Answers
1
"Some data" returned by FFT, must be a signal frequency spectrum. Probably it is an array of complex numbers, and to find "most powerful" frequency, you need to find an element with maximum absolute value (modulus). To calculate frequency, ... here was my mistake ... follow a link in Paul R's comment.

Alexey Birukov
- 1,565
- 15
- 22
-
1The last sentence regarding calculating frequency is not quite right: see [this explanation](https://stackoverflow.com/a/4371627/253056). – Paul R Apr 12 '18 at 16:05
-
1