%% Design of the allpass mapping filter
% This example shows how to design allpass mapping filter, changing the complex bandpass filter with the band edges at W_{o1}=0.2 and W_{o2}=0.4 to the new band edges of W_{t1}=0.3 and W_{t2}=0.6. Find the frequency response of the allpass mapping filter:

Wo = [0.2, 0.4]; Wt = [0.3, 0.6]; 
[AllpassNum, AllpassDen] = allpassbpc2bpc(Wo, Wt);
[ha, f] = freqz(AllpassNum, AllpassDen, 'whole');
plot(f/pi,-angle(ha)/pi, Wt, Wo, 'ro')
title('Mapping Function Wo(Wt)'); 
xlabel('New Frequency, Wt'); ylabel('Old Frequency, Wo');

% Copyright 2015 The MathWorks, Inc.