% Program 10_10 % Frequency Responses of Tree-Structured QMF % Filters % clf; % Type in prototype lowpass filter coefficients B1 = input('Filter coefficients = '); B1 = [B1 fliplr(B1)]; % Generate the complementary highpass filter L = length(B1); for k = 1:L B2(k) = ((-1)^k)*B1(k); end % Determine the coefficients of the four filters B10 = zeros(1, 2*length(B1)); B10([1: 2: length(B10)]) = B1; B11 = zeros(1, 2*length(B2)); B11([1: 2: length(B11)]) = B2; C0 = conv(B1, B10);C1 = conv(B1, B11); C2 = conv(B2, B10);C3 = conv(B2, B11); % Determine the frequency responses [H0z, w] = freqz(C0, 1, 256); h0 = abs(H0z); M0 = 20*log10(h0); [H1z, w] = freqz(C1, 1, 256); h1 = abs(H1z); M1 = 20*log10(h1); [H2z, w] = freqz(C2, 1, 256); h2 = abs(H2z); M2 = 20*log10(h2); [H3z, w] = freqz(C3, 1, 256); h3 = abs(H3z); M3 = 20*log10(h3); plot(w/pi, M0,'-',w/pi, M1,'--',w/pi, M2,'--',w/pi, M3,'-');grid xlabel('\omega/\pi'); ylabel('Gain, dB')