%% fftperformance %%% define signal, sample rate, sample domain N = 1024; t = (0:1:(N-1)); dft = t.^2; CT = t.*log(1+t); figure(1) clf plot(t,dft,t,CT); title('DFT and FFT performance, powers of 2'); xlabel('data size N'); ylabel('number of flops'); axis tight disp('press a key'); pause ops = []; for n = 1:N flops(0); fft(rand(1,n)); ops = [ops,flops]; end figure(2) clf plot(1:N,ops); title('FFT performance, dependence on N'); xlabel('data size N'); ylabel('number of flops'); axis tight