subplot(121);
x = linspace(-20,20,1000);
A = (sin(x)./x-cos(x))./x.^2;
plot(x,A);
grid on;
xlabel('x=(\omega-\omega_0)\tau');
ylabel('f(w) (units of 4f_0\tau)');
title('Problem 1b: FT of f(t)');

subplot(122);
plot(x,abs(A).^2);
grid on;
xlabel('x=(\omega-\omega_0)\tau');
ylabel('|f(w)|^2 (units of (4f_0\tau)^2)');
title('Power spectrum |f(w)|^2');

% Numerical estimate of FWHM
maxA2 = max(abs(A).^2);
g = abs(A).^2-1/2*maxA2;
g = abs(g);
[m mI] = min(g'); %#ok<UDIM>
x0 = x(mI); 
FWHM = 2*abs(x0); % FWHM = 3.6436