% File: E4_001.M

clear;

fc = 10;
fa = 1;
Ta = 1/fa;
dt = 4*Ta/200;
wc = 2*pi*fc;
wa = 2*pi*fa;

t = 0:dt:4*Ta;
x = cos(wa*t);
x = x(:);
y = zeros(length(t),1);
y = pulse(y,t,Ta,2*Ta);

j = sqrt(-1);
g = x + j*y;
phase = exp(j*wc*t);
g = g(:);
phase = phase(:);
v = real(g.*phase);

subplot(211);
plot(t,x,t,y,':');
xlabel('t');
title('x(t) (solid)  y(t) (dotted)');

subplot(212);
plot(t,v);
xlabel('t');
ylabel('v(t)');
subplot(111);




