function isminphaseflag = isminphase(f,sec)
%ISMINPHASE  Determine if filter object has minimum-phase sections.
%   FLAG = ISMINPHASE(F) determines if the filter object F has
%   minimum-phase filter sections, and returns 1 if true and 0 if
%   false.
%
%   FLAG = ISMINPHASE(F,I) determines if the I-th section of the
%   filter object F is a minimum-phase section and returns 1 if true
%   and 0 if false.
%
%   See also DFILT/ISMAXPHASE, DFILT/ISLINPHASE, DFILT/ISFIR,
%   DFILT/ISSTABLE, DFILT/ISALLPASS.

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

error(nargchk(1,2,nargin));

if nargin == 2,
    f = section(f,sec);
end

isminphaseflag = 1; % Initialized assuming minimum-phase
n = 1;

while isminphaseflag & n <= nsections(f),
    
    fsec = section(f,n);
    
    if ~isa(fsec,'latcma'),
        % We check if each section is latcma for the case of cas and par filters
        
        [b,a] = tf(fsec);
        
        if ~signalpolyutils('isminphase',b);
            isminphaseflag = 0;        
        end
    end
    
    n = n + 1;
    
end



    
    

    
