%% Complex exponential signal code
% Sampling frequency (in Hz).
fs = 1000;
% Length of the signal (in seconds).
dur_sig = 1;
% Time vector.
t = linspace(0,dur_sig,fs*dur_sig);
% Parameters.
f_0 = 8; A=4; phi=pi/2;
% Signal
x = A*exp(1j*(2*pi*f_0*t+phi));

% Plot
figure(), hold on,
hold off,
xlabel('Time (s)'), ylabel('Amplitude'),
subplot(2,2,1); plot(t,real(x));
xlabel('t'); ylabel('Real{x(t)}');
subplot(2,2,2); plot(t,imag(x));
xlabel('t'); ylabel('Imag {x(t)}');
subplot(2,2,3); plot(t,abs(x));
xlabel('t'); ylabel('|x(t)|');
subplot(2,2,4); plot(t,angle(x));
xlabel('t'); ylabel('Phase{x(t)}');