bool IsPowerOfTwo( unsigned int p_nX ) { if( p_nX < 2 ) return false; if( p_nX & (p_nX-1) ) return false; return true; }
http://www.codeproject.com/Articles/6855/FFT-of-waveIn-audio-signals