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

function o=aspectrum(N,varargin)
	opts=prefs('specfn',@powspec,'window',@hanning,varargin{:});
	specfn=opts.specfn;
	w=spdiag(opts.window(N));
	o=arr(@fn);
	function y=fn(x)
		y=specfn(w*x);
	end
end
