function Pulse = GaussPulse( L, BT, fsT)
% Gauss_pulse - generate Gaussian shaped pulse for GMSK
%
% Generate the pulse used for generating GMSK via function CPM.
%
% Inputs:
%   L    - length of pulse in symbol periods
%   BT   - Time-bandwidth product of pulse
%   fsT  - number of samples per symbol period
%
% Output:
%   Pulse - vector containing pulse
%
% Example:
%   Pulse = GaussPulse( L, BT, fsT)
%
% See also:
%   CPM

%% Initialization:
% map BT to sigma of Gaussian
sigma = sqrt(log(2)/(4*pi^2*BT^2));

% time axis
tt = -L/2:1/fsT:L/2-1/fsT;

%% Generate the pulse
% The basic pulse
Pulse = Q((tt-0.5)/sigma) - Q((tt+0.5)/sigma);

% Deal with truncation effects:
% make smallest sample = 0
Pulse = Pulse - min(Pulse);

% scale so integral equals 1/2
Scale = sum(Pulse);
Pulse = Pulse/Scale * fsT/2;

