I want to find fft of cos(2pi10*n). I wrote this code but it has two problems. First, the estimated frequency is not 10 Hz. Second, from theory I expected that the amplitude of frequency should be pi. I found that the amplitude is dependent to size of fft. I appreciate any help.
n = 0:1:9;
x = cos(2*pi*10*n);
xdft = fft(x);
w=0:2*pi/(10):2*pi-2*pi/(10);
plot(abs(xdft) )