BASS.NET API for the Un4seen BASS Audio Library

UtilsFFTIndex2Frequency Method

BASS.NET API for the Un4seen BASS Audio Library
Returns the frequency of a specific index in FFT data.

Namespace:  Un4seen.Bass
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public static int FFTIndex2Frequency(
	int index,
	int length,
	int samplerate
)

Parameters

index
Type: SystemInt32
The index within the FFT data array (half the requested).
length
Type: SystemInt32
The FFT data length (e.g. 4096 for BASS_DATA_FFT4096).
samplerate
Type: SystemInt32
The sampling rate of the device or stream (e.g. 44100).

Return Value

Type: Int32
The frequency (in Hz) which is represented by the index.
Remarks

Example: If the stream is 44100Hz, then bin 191 of a 512 sample FFT (191*44100/512) will represent 16451Hz. Or, if you are using BASS_DATA_FFT4096 on a stream with a sample rate of 44100 an index of 50 will represent a tone of 538Hz: 50*44100/4096 = 50.
See Also

Reference