VB FFT - stuck understanding relationship of results to frequency

Posted by WaveyDavey on Stack Overflow See other posts from Stack Overflow or by WaveyDavey
Published on 2008-09-26T10:01:29Z Indexed on 2010/03/26 17:23 UTC
Read the original article Hit count: 598

Filed under:
|
|

Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling)

Input is an array of 512 data points which are a sample waveform. Test data is generated into this array. fft transforms this array into frequency domain. Trying to understand relationship between freq, period, sample rate and position in fft array. I'll illustrate with examples:

========================================

Sample rate is 1000 samples/s. Generate a set of samples at 10Hz.

Input array has peak values at arr(28), arr(128), arr(228) ... period = 100 sample points

peak value in fft array is at index 6 (excluding a huge value at 0)

========================================

Sample rate is 8000 samples/s Generate set of samples at 440Hz

Input array peak values include arr(7), arr(25), arr(43), arr(61) ... period = 18 sample points

peak value in fft array is at index 29 (excluding a huge value at 0)

========================================

How do I relate the index of the peak in the fft array to frequency ?

© Stack Overflow or respective owner

Related posts about vb

Related posts about audio