%% Frequency response of Daub6 filters
%
% I use the daub.m command from Uvi_Wave.300 to create the daub6 filters, then create the z-transforms of the analysis filters evaluated at e^{-i\omega } and plot their absolute values.
%

syms w
[h,g,rh,rg]=daub(6);
v = exp(-5*i*w);
for j=2:6
    v = [v exp(-(6-j)*i*w)];
end
H0 = v*h';
H1 = v*rh';
fplot(abs(H0))
hold on
fplot(abs(H1))
axis([0 pi 0 1.5])
xticks([0 pi/4 pi/2 3*pi/4 pi])
xticklabels({'0','.25','.5','.75','1'})
xlabel('frequency \omega (multiples of \pi')
annotation('textarrow',[0.2894 0.4344],[0.6475 0.7713],'String','lowpass filter')

annotation('textarrow',[0.6778 0.6122],[0.6948 0.804],'String','highpass filter')

title('Frequency response of Daub6 analysis filters')

%
% Notice that the highpass filter is the mirror image of the lowpass filter about \omega =\frac{\pi }{2}, which we expect since Daub6 is an orthogonal filter bank.