% File: E5_007.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;

m = 1.5*cos(wa*t);
m = m(:);
% This is 150% modulation


y = zeros(length(t),1);
for (i = 1:1:length(t))
  if (m(i) > -1)
    y(i) = 1;
  end;
end;

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

subplot(211);
plot(t,m,t,abs(g),':');
xlabel('t');
title('m(t) (solid)  |g(t)| (dotted)');

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




