function fhndls = dfsymfirparse
%DFSYMFIRPARSE  Parser for DFSYMFIR filter objects.
%   FHNDLS = DFSYMFIRPARSE 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.4 $  $Date: 2000/06/13 21:22:45 $ 

% Reuse the parsing function for DF objects, however don't use the third
fhndls = dfparse;

fhndls(3) = @checkdfsymfir;

%----------------------------------------------------------------------------------
function [c,msg] = checkdfsymfir(c)
%CHECKDFSYMFIR  Check if input argument is a cell of vectors of symmetric coeffs.

msg = '';
b = c{1};

if isempty(b),
    b = 0;
end

if (prod(size(b)) ~= max(size(b))),
    msg = 'Coefficients must be specified in a vector.';
    return
end

b = b(:).'; % Always store polynomial coeffs as a row

% Make sure coefficients are symmetric
symstr = signalpolyutils('symmetrytest',b);

if ~strcmpi(symstr,'symmetric'),
    msg = 'Coefficients must be symmetric.';
    return
end   

c = {b};


