I have a homework assignment to take the $64$ DFT of $\cos((5\pi/32)n)$ and $\cos((5\pi/64)n)$. However, for the second case I obtained DFT spectrum such that I have that famous symmetry in real part and imaginary part of it because it is real valued signal. However, for the first signal I found something that has no symmetry in imaginary part of the DFT, but it's real too.
Why there is no symmetry although signal is real? Does it have anything to do with "windowing" the signal?
I wanted to calculate it analytically so that here is my code and the results:
....
t = 0:63;
x1 = cos(5*(pi/32)*t);
X1_analytic = zeros(1,64);
temp = 0;
for k = 0:63
for n = 0:63
temp = temp + x1(n+1)*exp(-1i*2*pi/64*k*n);
end
X1_analytic(k+1) = temp;
temp = 0;
end
subplot(5,1,1);
stem(0:63,abs(X1_analytic),'--*r');
subplot(5,1,2);
stem(0:63,(X1_analytic+conj(X1_analytic))*(1/2));
title('Real part');
subplot(5,1,3);
stem(0:63,imag((X1_analytic)));
title('Imaginary part');
subplot(5,1,4);
stem(0:63,abs(X1_analytic));
title('Abs value ');
subplot(5,1,5);
stem(0:63,angle(X1_analytic));
title('Phase ');