function xx = sumcos(f,X,fs,dur)
%SUMCOS     Function to generate a sum of cosines
%   usage:
%         xx = sumcos(f,X,fs,dur)
%
%          f = row vector of frequencies
%          X = row vector of complex phasors
%         fs = sampling rate
%        dur = total time duration of signal
%
%   Note:
%         f and X must be the same length.
 
xx = real(X*exp(j*2*pi*f'*(0:1/fs:dur)));
