function [b,a] = tf(h)
%TF  Parallel object to transfer function conversion.

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

% Initialize transfer function
b=0; a=1;

% Form transfer function recursively
for n = 1:nsections(h),
    
    [bt,at] = tf(section(h,n));

    conv1 = conv(b,at);
    conv2 = conv(bt,a);
    
    
    % Make sure they are of the same length to add
    conv1 = [conv1 zeros(1,length(conv2)-length(conv1))];
    conv2 = [conv2 zeros(1,length(conv1)-length(conv2))];
    
    % Add to get numerator
    b = conv1 + conv2;
        
    a = conv(a,at);
end

% [EOF] - TF
