Help - Search - Members - Calendar
Full Version: FFT Data
Hydrogenaudio Forums > Hydrogenaudio Forum > General Audio
opius
Could anybody point me in the direction of c++ code for a program that would take in a wav file and output the fft results in a text file? the simpler the better really! thanks : )
Pio2001
Here's a moderately complicated one : http://momonga.t.u-tokyo.ac.jp/~ooura/fft.html

You will have to save the wav file as "raw audio" with a wav editor. The wav editor will ask you what byte order you want. The result will be a file with 4 bytes per sample. Two for the left channel value and 2 for the right channel value. Then you can process it with the above code.

You will have to choose a size. Usually, 4096 samples are converted at once. You might use an overlap : process from 1 to 4096, from 2049 to 6144 etc, and you can use a windowing function too : multiplying the 4096 samples by a Hanning (accurate frequency peaks) or Blackman-Harris (low noise) function.

It's very useful to play with the spectrum analyzer of an audio editor, and it's settings, in order to understand how those parameters work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.