function [f,g]=filtfun(xfree,x,xmask,n,h,maxbin);
%FILTFUN Returns frequency response and roots for DFILDEMO.

%   Copyright (c) 1990-98 by The MathWorks, Inc.
%   $Revision: 1.9 $  $Date: 1997/11/29 01:23:08 $

x(xmask)  = xfree;
h2=abs(freqz(x(1:n), x(n+1:2*n), 128));
f= h2 - h;     
% Make sure its stable
g=[abs(roots(x(n+1:2*n)))-1];
