function spec=maspec(tn,N)

% function spec=MAspec(T_n,N) : spectrum of a MA-process with covariance T_n
%
% spec : the power spectrum of a moving average process corresponding to
%        the Toeplitz covariance matrix T_n evaluated at N equispaced
%        points via fft
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
qv=tn(:,1); qh=tn(1,2:length(tn)); q=[fliplr(conj(qv')) qh];
spec=abs(fft(q,N));