%% Convert Coupled Allpass Filter to Transfer Function Form
% Create a coupled allpass filter.

[b,a] = cheby1(10,.5,.4);

% The tf2ca function returns the denominators of the coupled allpass filter.

[d1,d2,beta] = tf2ca(b,a);

%
% Reconstruct the original and the power-complementary filters using the ca2tf function.

[num,den,numpc] = ca2tf(d1,d2,beta);

%
% Plot the magnitude response of the original filter and the power-complementary one.

fvtool(num,den,numpc,den,'Analysis','magnitude','MagnitudeDisplay',...
    'Magnitude Squared')

% Copyright 2012 The MathWorks, Inc.