<< Chapter < Page | Chapter >> Page > |
One approach to the design of FIR filters is to ask that $A()$ pass through a specified set of values. If the number of specified interpolation points is the same as thenumber of filter parameters, then the filter is totally determined by the interpolation conditions, and the filter canbe found by solving a system of linear equations. When the interpolation points are equally spaced between 0 and $2\pi $ , then this interpolation problem can be solved very efficiently using the DFT.
To derive the DFT solution to the interpolation problem, recall the formula relating the samples of the frequency response tothe DFT. In the case we are interested here, the number of samples is to be the same as the length of the filter ( $L=N$ ).
Recall the relation between $A()$ and ${H}^{f}()$ for a Type I and II filter, to obtain
For Type III and IV filters, we have
The following Matlab code fragment illustrates how to use this approach to design a length 11 Type I FIR filter for which $\forall k, (0\le k\le N-1)\land (N=11)\colon A(\frac{2\pi}{N}k)=\left(\begin{array}{c}1\\ 1\\ 1\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\\ 1\\ 1\end{array}\right)$ .
>> N = 11;
>> M = (N-1)/2;>> Ak = [1 1 1 0 0 0 0 0 0 1 1}; % samples of A(w)
>> k = 0:N-1;>> W = exp(j*2*pi/N);
>> h = ifft(Ak.*W.^(-M*k));>> h'
ans =0.0694 - 0.0000i
-0.0540 - 0.0000i-0.1094 + 0.0000i
0.0474 + 0.0000i0.3194 + 0.0000i
0.4545 + 0.0000i0.3194 + 0.0000i
0.0474 + 0.0000i-0.1094 + 0.0000i
-0.0540 - 0.0000i0.0694 - 0.0000i
Observe that the filter coefficients
h
are real and symmetric; that a Type I filter is obtained as
desired. The plot of
$A()$ for this filter illustrates the interpolation
points.
L = 512;
H = fft([h zeros(1,L-N)]);
W = exp(j*2*pi/L);k = 0:L-1;
A = H .* W.^(M*k);A = real(A);
w = k*2*pi/L;plot(w/pi,A,2*[0:N-1]/N,Ak,'o')xlabel('\omega/\pi')
title('A(\omega)')
An exercise for the student: develop this DFT-based interpolation approach for Type II, III, and IV FIR filters.Modify the Matlab code above for each case.
For an $N$ -point linear-phase FIR filter $h(n)$ , we summarize:
Notification Switch
Would you like to follow the 'Intro to digital signal processing' conversation and receive update notifications?