Frequency analysis using FFT