You need to find the peak magnitude then work out the corresponding frequency:
- calculate the magnitude of each DFT output bin:
magnitude = sqrt(re*re+im*im)
- find the bin with the largest magnitude, call its index
i_max
. - calculate the equivalent frequency of this bin:
freq = i_max * Fs / N
, hereFs
= sample rate (Hz) andN
= no of points in FFT.
See this answer for a more detailed explanation of how bin indices and frequency are related.