Subject:From:Re: Frequency Content Paul Boersma <paul.boersma(at)HUM.UVA.NL>Date:Wed, 31 Jul 2002 17:32:17 +0200Dear Marius, very compact C code for Fourier transforms is available in a book called Numerical Recipes by Press et al., which is widely available. Copy your 512 chars to an array of 512 floats, then use the function "realft" to convert this inline to a spectral representation (you also have to type in the function "four1"). As for the result, data[1]*data[1] is the direct-current power (f = 0), and data[2]*data[2] is the power in the highest frequency, which is half of the sample rate. The first genuine frequency power (f = sample rate divided by 512) is data[3]*data[3]+data[4]*data[4], the second frequency power (f = 2 * samplerate/512) is data[5]*data[5]+data[6]*data[6], and so on, up to data[511]*data[511]+data[512]*data[512], which is the power at f = 255 * samplerate/512. Best wishes, Paul -- Paul Boersma Institute of Phonetic Sciences, University of Amsterdam Herengracht 338, 1016CG Amsterdam, The Netherlands http://www.fon.hum.uva.nl/paul/ phone +31-20-5252385

This message came from the mail archive

http://www.auditory.org/postings/2002/

maintained by: DAn Ellis <dpwe@ee.columbia.edu>

Electrical Engineering Dept., Columbia University