%TPTEST generate test Toeplitz matrix
%	 t = tptest(type, n, sigma)
%	input:	index of test matrix: 1-Gaussian, 2-exponential, 3-algebraic
%			(all matrices are symmetric positive definite)
%		dimension n
%		matrix parameter sigma (default 1)
%	output:	first column of Toeplitz matrix

%	Giuseppe Rodriguez,  06-09-04
%	Email: rodriguez@unica.it


function t = tptest(type,n,par)

if nargin<3,  par = [];  end

iv =[0:n-1]';

switch type
case 1
	if isempty(par)
		sigma = 1;
	else
		sigma = par;
	end
	t = sqrt(pi/2/sigma) * exp(-sigma*iv.^2/2);
case 2
	if isempty(par)
		sigma = 1;
	else
		sigma = par;
	end
	t = ((1+sigma*iv)/sigma).*exp(-sigma*iv);
case 3  
	if isempty(par)
		sigma = 1;
	else
		sigma = par;
	end
	t = 2*pi./(sigma*(4*sigma^2+iv.^2));
otherwise
	error( 'matrix type unknown');
end

