%% Gaussian Monopulse
% Consider a Gaussian monopulse with center frequency f_c=2 GHz and sampled at a rate of 100 GHz. Determine the cutoff time t_c using the 'cutoff' option and compute the monopulse between -2t_c and 2t_c.

fc = 2e9;
fs = 100e9;

tc = gmonopuls('cutoff',fc);
t  = -2*tc:1/fs:2*tc;

y = gmonopuls(t,fc);

%
% The monopulse is defined by the equation
% y(t)=e^{1/2}(t/\sigma)\exp(-(t/\sigma)^2/2),
% where \sigma=t_c/2=1/(2\pi f_c) and the exponential factor is such that y(\sigma)=1. Plot the two curves and verify that they match.

sg = 1/(2*pi*fc);

ys = exp(1/2)*t/sg.*exp(-(t/sg).^2/2);

plot(t,y,t,ys,'.')
legend('gmonopuls','Definition')

% Copyright 2012 The MathWorks, Inc.