clear all; close all;
%% Part a
Ts = 1;
S = [1-1j, 1+1j, 1 , 1-1j, -1-1j, 1, 1-1j, -1+1j];
N = length(S); 
L = 2^5; % Use overversampling to get more accurate plot
s = L*sqrt(N)*ifft(S,L*N)
t = Ts/(L*N)*[0:(L*N-1)];
Rs = real(s);
set(plot(t,Rs,'k'),'LineWidth',1.5)
ylabel('Re\{s(t)\}'); xlabel('t'); grid on; 
%% Part d
s_2 = L*sqrt(N)*ifft(conj(S),L*N)
Rs_2 = real(s_2);
a = (Rs+Rs_2)/2; b = (Rs_2-Rs)/2
figure
hold on
set(plot(t,a,'m'),'LineWidth',1.5); set(plot(t,b,'b'),'LineWidth',1.5);
xlabel('t'); grid on; 
legend('a(t)','b(t)')




