   Where to find a DFT library
  Hi, I already posted a similar question a long time ago with very little responces. I just want to know why a normal DFT library is so rare? Do everyone who want to use it write it themselves? All I want is something that gives me the frequency and amplitude at certain points of the sound. I found some hobby written libs which still require you to understand quite a lot of the DFT formula to get it to work. Is there any for dummies libs? Thanks.   
  Take a look at FFTW. You will need at least a basic understanding of the DFT to use any library that I know of, but fftw is one of the best.   ;Quote:Original post by VanillaSnake21I just want to know why a normal DFT library is so rare?Because they are too slow for practical use. DFT is general method, but implemented as FFT.FFT packages are trivial to use, they don't really require any specific knowledge. You pass an array (needs to be of 2^n elements, or some other constraint), and you get what you want in another array or two.   ;  Thanks, I remember looking at this lib a while ago, can you guys briefly walk me through the steps of getting the amplitude/frequency. Lets say I have I have an audio file and I'm plying it with DirectMusic or whatever what do I do now?   ;  Are you asking about using this API specifically, or in general how you would accomplish this using the DFT? Perhaps knowing more about your application would allow us to offer specific advice...The FFTW output from your real-valued audio signal of length N will be N/2 complex data points representing the frequency content of the input signal. (Note that the imaginary part of the first value will actually be the nyquist point data with this implementation, but you can likely ignore this for audio signals since you should not be concerned with the DC or nyquist frequencies). The frequency of an arbitrary output point, k, is equal to:Fs * k / Nwhere Fs = audio signal sampling frequency k  = output index of the complex data point N  = length of FFTThe amplitude can be calcuated from the complex data using sqrt(re^2 + im^2).When using the FFTW API, you will first allocate what they call a 'plan'. This is a (relatively) time consuming process where the FFT algorithm is internally selected and twiddle factors created so that each FFT call will only preform the minimum required calculations. You will need a unique plan for each FFT type and size, if I recall correctly. After this plan exists, you can supply input and output data buffers with the plan to the FFT call and obtain your output frequency data. If you are trying to create a spectrogram type information set, you might have to experiment with FFT sizes, input overlap, and windowing techniques to obtain acceptable results. These are more advanced topics which you might not need to worry about at all, so the best thing to do might be to just play around and see what different transforms look like.Helpful?   ;Quote:Original post by save yourselfHelpful?Yea, somewhat I guess, but could you give an even more down to earth explanation (not of the actual FFT process - i've read many papers on it, and still pretty much understand almost nothing). I'm pretty new to audio programming, the top thing I've done was like playing a music sample with DirectAudio. Lets say I have a song, in .wav format, how do I plug it into the FFTW library? How do I make it fit into the input arrays? As for my application, I don't have one yet, I'm just doing a few studies on this subject for it's own sake, if I'm able to pull anything decent out of this then maybe I can incorporate it into one of my games. Thanks.;  Based on your needs, FFTW might not be what you are actually looking for. A quick search shows a couple of libraries that sound like they make audio analysis a bit more user friendly and higher level. You will have to check them out for yourself as I have never used any of them, but you might find support for reading .wav files to raw audio data and calculating the power spectrum a lot easier than doing it all yourself with a low level DFT library.http://clam-project.org/http://marsyas.sness.net/   