function X = idceps(c, w)
% X = idceps(c, w)
%
% computes the inverse discrete cepstrum, i.e. given a number of discrete 
% cepstral coefficients, it returns the spectrum.
%
% c contains the discrete cepstral coefficients
% w contains the frequency at which the spectrum is evaluated.
% c and w must be column vectors.
%
% Further details can be found in:
% [1] Diemo Schwarz. Spectral envelopes in sound analysis and synthesis.
% Master's thesis, Universitaet Stuttgart, 1998, pp. 36-38.
% [2] T. Galas and X. Rodet. An improved cepstral method for deconvolution
% of source filter systems with discrete spectra: Application to musical
% sound signals. In International Computer Music Conference, 1990.

pmax = length(c)-1;
numW = length(w);

exponent = sum(  repmat(c', numW, 1) .* cos(w*(0:pmax)), 2  );
X = exp(exponent);