% routine for FFT -- curve fitting

clear all, close all

% your will write your values to replace c1 c2 c3 c4 and c5
% respectively 64, 128, 256, 512 and 1024 points FFT

c1=237217;
c2=310000;
c3=420245;
c4=692787;
c5=1288863;

C=[c1;c2;c3;c4;c5];
A=[];
for N=2.^(6:10)
    A=[A;[(N*log2(N)),1 ]];    
end    
k = pinv(A)*C;
N=2.^(1:10);
y=k(1).*(N.*log2(N))+k(2);
plot(N,y,'--','color',[0,0,0]);

hold on;
N=2.^(6:10);
plot(N,C,'*','color',[1,0,0]);
legend('Interpolated computational cost (Nlog2(N))','Recorded computational costs');
xlim([0,1050])
ylim([0,max(y)*1.3])
ylabel('Cycles')
xlabel('N')
