I need to calculate spectrum of the signal and plot its magnitude and phase in matlab. I have figured out how to do the magnitude plot, but cant understand how to do a phase plot
N = 1000; Ts = 0.05; Fs = 1/Ts;
t = [0:Ts:(N*Ts)-Ts];
xc = 4*exp(1i*5*pi*t) + 6*exp(1i*12*pi*t);
f=[-Fs/2:Fs/N:Fs/2-Fs/N];
Xc=fft(xc);
figure;
subplot(211)
plot(f,fftshift(abs(Xc))) ;title('Magnitude as a function of Hz');
xlabel('f in Hz');ylabel('|Xc|');grid on;
subplot(212)
w=2*pi*f;
plot(w,fftshift(abs(Xc))) ;title('Magnitude as a function of w');
xlabel('w');ylabel('|Xc|');grid on;
Any help would be appreciated