function fhndls = latcallpassparse
%LATCALLPASSPARSE  Parser for LATCALLPASS filter objects.
%   FHNDLS = LATCALLPASSPARSE returns a 3 element vector of function handles, 
%   FHNDLS, that point to the three functions required by DFILTPARSE
%   when called form any DFILT constructor.
%
%   For more information on what the 3 functions do, see the help for
%   DFILTPARSE.

%   Author(s): R. Losada
%   Copyright 1988-2000 The MathWorks, Inc.
%   $Revision: 1.3 $  $Date: 2000/06/13 21:22:51 $ 

% We can reuse the same parsing functions that the LATCMA object uses
fhndls = latcmaparse;

% Overwrite the coefficient checking, since we don't force the reflection
% coefficients to be less than one for allpass filters. (That is a filter
% can still be allpass an unstable)
fhndls(3) = @checklatcallpass;

%----------------------------------------------------------------------------------
function [c,msg] = checklatcallpass(c)
%CHECKLATCMA Check if cell contains valid reflection coefficients.

msg = '';

k = c{1};


if isempty(k),
    k = 0;
end

% Check that k is a vector
if prod(size(k)) ~= max(size(k)),
    msg = 'Reflection coeffs. must be given in a vector.';
end

k = k(:); % Always store the coefficients as a column vector

c = {k};

