Linear-Phase Filters

Zeros of Linear-Phase FIR Filters

Examples

Type I

b = [ 1 0 1 ]/2;
plotfir(b);

Type II

b = [ 1  1 ]/2;
plotfir(b);

Type III

b = [ 1 0 -1 ]/2;
plotfir(b);

Type IV

b = [ 1 -1 ]/2;
plotfir(b);

Moving Average Filters

All of these filters are generated by b = ones(1,M)/M.

M = 2 (Type II)

b = ones(1,2)/2;
plotfir(b);

M = 3 (Type I)

b = ones(1,3)/3;
plotfir(b);

M = 4 (Type II)

b = ones(1,4)/4;
plotfir(b);

M = 5 (Type I)

b = ones(1,5)/5;
plotfir(b);

Cascaded Smoothing Filters

This filters are obtained by repeated convolution of a M = 2 moving average filter.

b2 = ones(1,2)/2;
b3 = conv(b2,b2);
b4 = conv(b2,b3);
b5 = conv(b2,b4);

Base filter (M=2)

b2 = [1 1]/2;

One convolution (M=3)

b = [ 1 2 1]/4;

Two convolutions (M=4)

b = [ 1 3 3 1]/8;

Three convolutions (M=5)

b = [ 1 4 6 4 1]/16;

Matlab plotfir function

function PLOTFIR(b)
%
%  PLOTFIR
%
%    generates set of plots for rational transfer function
%    defined by a set of zeros and poles.
%
%	PLOTFIR(b)

N = length(b)-1;

a = [ 1 zeros(1,N) ];

[h,w] = freqz(b,a,2*pi*linspace(-0.5,0.5,100));

h = h.*exp(j*w*N/2);

if (max(abs(imag(h))) > 0.5) 
   h = -j*h;
end

h = real(h);

subplot(1,2,2);
plot(w/pi,h,'k');
grid
xlabel 'Normalized frequency (Nyquist == 1)'
ylabel 'Amplitude Response'
subplot(1,2,1);
[z,p,k] = tf2zp(b,a);
zplane(z,[]);
axis([-1.5 1.5 -1.5 1.5]);

Maintained by John Loomis, last updated 30 Oct 1997