% File: E5_016.M

clear;

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

t = 0:dt:2*Ta;

% Hilbert Transform from Table A-7
x = sin(wa*t);
x = x(:);
y = -cos(wa*t);
y = y(:);

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

plot_pr(2);
axis([0 2*Ta -1.5 1.5]);
plot(t,x,t,y,':',t,abs(g),'--');
xlabel('t');
title('x(t) (solid) y(t) (dotted) |g(t)| (dashed)');  
pause;

subplot(211);
plot(t,cos(wc*t));
xlabel('t');
ylabel('cos(wc*t)');

% Note that the frequency of v(t) is now fc+fa
% instead of fc.  This is UPPER SSB.

subplot(212);
plot(t,v);
xlabel('t');
ylabel('v(t)');
title('UPPER SSB');
axis;
subplot(111);



