% alpc - LPC arrow
%
% alpc ::
%    N:natural   ~'size of waveform blocks to expect',
%    M:natural   ~'order of LPC to do'
%    options {
%       specfn :: ([[N,T]]->[[dftbins(N),T]])/ @powspec ~'function to compute spectra';
%       window :: (N:natural->[[N]])         / @hanning ~'function to compute window'
%    }
% -> arrow({[[N,1]]},{[[M,1]]},empty).

function o=alpc(N,M,varargin)
	opts=prefs('window',@hanning,'nargout',1,varargin{:});
	w=spdiag(opts.window(N));
	if opts.nargout<=1
		o=arr(@fn);
	else
		o=arr(@fn2);
	end

	function y=fn(x)
		y=lpc(w*x,M);
	end

	function [y,v]=fn2(x)
		[y,v]=lpc(w*x,M);
	end
end
