You are on page 1of 2

% % % % % % % % % % % % %

QUADRATURE MIRROR FILTER(QMF) DESIGN The filter constructed from two filter bank called lowpass and highpass. They are called analysis filter in transmitter section and synthesis filter in receiver section. The Lowpass filter designed by FIR digital filter, other filters are designed for standard QMF filter. The program plots the impulse response of both anlysis and synthesis filter, frequency responce of QMF filter and error in standard QMF design. Reference "Multirate DSP" by Fliege. Copyright 2006-2007 ViMicro Systems Pvt.Ltd., $ Revision: 0 $ $ Date: 2006/11/21 $ % clear command & workspace % % % % number of co-efficients define filter cut-off frequency define filter structure FIR filter design using hanning window, H(

clc; clear; N = 32; f = [0 0.5 0.552 1]; m = [1 1 0 0]; h0 = fir2(N,f,m,hanning(N+1)); z) h1 = (-1).^(0:N).* h0;

% H(-z)

% impulse response plot for analysis filter figure; subplot(2,2,1); stem(h0); xlabel('n'); ylabel('constant'); title('Impulse Response, H_0(Z)'); subplot(2,2,2); stem(h1); xlabel('n'); ylabel('constant'); title('Impulse Response, H_1(Z)'); % For Standard QMF Bank g0 = 2*h0; g1 = -2*h1; % QMF synthesis filter, 2H(z) % -2H(-z)

% impulse response plot for synthesis filter hold on; subplot(2,2,3); stem(g0); xlabel('n'); ylabel('constant'); title('Impulse Response, G_0(Z)'); subplot(2,2,4); stem(g1); xlabel('n'); ylabel('constant'); title('Impulse Response, G_1(Z)'); % QMF filter's frequency response plot figure; [H,W] = freqz(g0/2,1,512); % Determine Frequency Response plot(W/pi,20*log10(abs(H)));grid; % Plotting radian Vs gain hold on; [H1,W] = freqz(g1/2,1,512); % Determine Frequency Response plot(W/pi,20*log10(abs(H1))); % Plotting radian Vs gain xlabel('\omega/\pi (rad)'); ylabel('Gain (dB)'); title('QMF Filter - Frequency Response');

text(0.115, -10, '|{\itH}_0(\omega)|^2','fontsize',12,'fontweight','demi'); text(0.815, -10, '|{\itH}_1(\omega)|^2','fontsize',12,'fontweight','demi'); % Determine Filter Error sum = (abs(H)).^2 + (abs(H1)).^2; % find-out filter error error = 10*log10(sum); % error in 'dB' figure; plot(W/pi,error); axis([0 1 -0.15 0.13]); grid xlabel('\omega/\pi (rad)'); ylabel('Error (dB)'); title('Filter Error'); %-----------------------------------