%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This is an all pass filter  %
%enter num and den as vectors%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [poles_tr,zeros_tr] = all_pass(num,den)

freqz(num,den)                                  %returns the frequency response 
                                                %vector h and the corresponding 
                                                %frequency vector w for the quantized filter
                                                %num, plots frequency response.
                               
poles_tr=roots(den);                            %the poles are the roots of the denominator
zeros_tr=roots(num);                            %the zero's are the roots of the numerator. 
figure;
zplane(num,den)                                 %plots z-plane graph 

%% tested, seems to work 
%% a=[1,-1.765,.81];
%% b=[2,1,0];
%% all_pass(b,a)
%% gives frequency response graph and a zero plane graph.
