% Richard Duncan
% ECE 3133 - 01
%
% Matlab Assignment No. 5:
% 
%  - Construct the signal:
%
%    x(t) = 0.5 exp(-alpha*abs(t)) + 0.25 exp(-beta*abs(t))
%
%    For the following constants:
%
%         alpha = 0.001           beta = 0.005
%         alpha = 0.0001          beta = 0.0005
%
%    Compute and plot the magnitude and phase of the Fourier transform.
%    Use a dB scale for the magnitude, and a linear scale for the frequency.
%
%  - Demonstrate the use of the Java Spectrum Analysis applet.
%
% This assignment is due by 02/27/98.
%

clear all;

syms a b t xf range f w;
x = 0.5 * exp(-a * abs(f)) + 0.25 * exp(-b*abs(f));

% take the fourier transform of x
%


%range = 20; 
a=.001;
b=.005;


%xf = int(eval(x) * exp(j*-2*pi*f*t), t, -range, range);

xf = fourier(x);
xf_eval = eval(xf)
for w = -49:50
	w
	y(w+50) = eval(xf_eval);
end;

w = [-49:1:50];
plot(w,20 * log10(y), 'k*');
figure
plot(w,angle(y));

% plot 2: a = 0.0001, b = 0.0005 
%
syms a b t xf range f w;
a=.0001;
b=.0005;

xf = fourier(x);
xf_eval = eval(xf)
for w = -49:50
	w
	y(w+50) = eval(xf_eval);
end;

w = [-49:1:50];
figure
plot(w,20 * log10(y), 'k*');
figure
plot(w,angle(y));
