function signal = glottal_source(f0,time)
%function signal = glottal_source(f0,time)
%
% GLOTTAL_SOURCE -- a function to generate a glottal source signal
%                   with sampling frequenc 8192
%
% Input Parameters:
%   f0   -- fundamental frequency of the glottal signal
%   time -- length of signal in seconds
%

fs = 8192;
t = 0:(1/fs):(time-1/fs);

signal = 0;

for f=f0:f0:fs/2
    signal = signal + cos(2*pi*t*f);
end

A = [1.0000   -1.3900    0.4840];
signal = filter(1,A,signal);

signal = signal/max(abs(signal));