function [out, t] = sumcos(ampl, frqs, t_max, fs)
%function [out, t] = sumcos(ampl, frqs, t_max, fs)
%
% SUMCOS: Performs Fourier synthesis using cosine waves.  That is,
%         this function adds up cosine waves with given amplitudes,
%         frequencies, and phases.
%
% Input Parameters:
%   ampl   -- vector of complex amplitudes of the sinusoids.  The 
%             magnitude of the amplitudes determines the amplitude of
%             the sinusoid; the angle determines the phase (relative to
%             cosine phase).
%   frqs   -- vector of sinusoid frequencies in Hz
%   t_max  -- this function produces it sinusoids over a time range from
%             zero to t_max seconds.  (Default: 1)
%   fs     -- sampling frequency in Hz (Default: 8192)
%
% Output Parameters:
%   out    -- signal resulting from the fourier synthesis.
%   t      -- the time axis used to generate the sinusoids
%
% Usage:
%   out = sumcos([3 2 1],[1 3 5],1,500);
%      --> creates one period of a signal with three sinusoidal components 
%          at 1 Hz, 3 Hz, and 5 Hz.  The sampling frequency is 500 Hz.
%


