function S = fdescrip(s)

% Input:  s (vector in form of x + j*y)
% Function calculates:
% FFT of s
% Plots IFFT of s with ranging number
% of fourier descriptors

figure,plot(s)
title('Modeled Square: 84 points; s = x+j*y')
xlabel('x')
ylabel('y')

S = fft(s);

pause;

figure,plot(abs(S))
title('Fourier Transform')
xlabel('S = fft(s)')
ylabel('abs(S)')
pause;
s_reconstruct1 = ifft(S(1:2),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 2 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:8),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 8 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:16),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 16 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:56),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 56 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:64),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 64 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:72),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 72 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:81),84);
figure,plot(s_reconstruct1)
title('Reconstruction with first 81 FDs');
xlabel('x')
ylabel('y')

pause;
s_reconstruct1 = ifft(S(1:84),84);
figure,plot(s_reconstruct1)
title('Reconstruction with all 84 FDs');
xlabel('x')
ylabel('y')

