% This example demos the effect of FFT for purely periodic signals au=myAudioRead('welcome.wav'); frame=au.signal(2047+15:2126+15); % A full fundamental period zeros=0*frame; frame=[frame; zeros; zeros; zeros; zeros; zeros]; %frame=au.signal(2047:2047+512-1); %frame=frame.*hamming(length(frame)); [mag, phase, freq, powerDb]=fftOneSide(frame, au.fs, 1); lMaxIndex=find(localMax(mag)); subplot(3,1,2); line(freq(lMaxIndex), powerDb(lMaxIndex), 'color', 'r', 'marker', 'o', 'linestyle', 'none'); fprintf('F1 = %f Hz\n', freq(lMaxIndex(1))); fprintf('F2 = %f Hz\n', freq(lMaxIndex(2))); fprintf('F3 = %f Hz\n', freq(lMaxIndex(3)));