Anda di halaman 1dari 6

International Journal of Electrical & Computer Sciences IJECS-IJENS Vol: 10 No: 01 13

Performance Analysis of FIR Filter Design by


Using Optimal, Blackman Window and
Frequency Sampling Methods
S. M. Shamsul Alam , Md. Tariq Hasan
Electronics and Communication Engineering (ECE) Discipline, Khulna University
Khulna 9208, Bangladesh.
E-mail: alam_ece@yahoo.com , mdthasan@gmail.com

frequency response. To follow this philosophy, there are three


Abstract— Digital filter plays an important role in today’s techniques to design FIR filters. In this paper, the spectral
world of communication and computation. On the other hand to responses of those methods are analyzed.
design a digital finite impulse response (FIR) filter satisfying all Since this is FIR system so it has an impulse response of finite
the required conditions is a challenging one. In this paper, design duration length, N. The general equation of frequency
techniques of low pass FIR filters using Blackman window response function H (ω) for odd number of N [1] is given by
method, Frequency sampling method and Optimal method are
presented. The magnitude responses are demonstrated for the ⎧ ⎛ N −1 ⎞ ( N −3) / 2 ⎛ N − 1 ⎞⎫
different design techniques of digital FIR filters and those are H (ω ) = e− jω ( N −1) / 2 ⎨h⎜ ⎟ + 2 ∑ h(n) cosω⎜ − n ⎟⎬ (1)
compared with ideal response curves. In this paper, we have ⎩ ⎝ 2 ⎠ n =0 ⎝ 2 ⎠⎭
introduced an iterative method to find the optimal solution of Now comparing Eq. (1) with the polar representation of
optimal FIR filter design. It is shown that in optimal FIR filter H (ω ) , the magnitude is
H (ω ) = H 1 (ω )
design the passband and stopband ripples of response curve
depend on the width of transition band. Further, Remez
exchange algorithm is applied on optimal method to analyze the where H 1 (ω ) is a real quantity given by
response of FIR filters. This shows that the degree of flatness in ( N − 3 )/ 2
⎛ N −1⎞ ⎛ N −1 ⎞
passband and stop band depend on the weighting factor and H 1 (ω ) = h ⎜ ⎟ + 2 ∑ h (n )cos ω ⎜ − n⎟ (2)
width of the transition band. Filter design by using Blackman ⎝ 2 ⎠ n=0 ⎝ 2 ⎠
window and frequency sampling technique, the degree of flatness
varies with the length of filter. The magnitude of H (ω) has been analyzed for different design
techniques by taking equal filter parameters.
Index Terms—Blackman window, FIR filter, Optimal method,
Rectangular window, Remez exchange algorithm
II. ANALYTICAL DESIGN OF OPTIMAL FIR FILTER
I. INTRODUCTION To design a low pass filter, the desired frequency response
is given by
I N general case filter is applied to illustrate a device that
distinguishes, according to some attribute of the objects
applied at its input. For frequency domain concept this is
⎧1
H d (ω ) = ⎨
⎩0
0 ≤ ω ≤ ωp ⎫

ωs ≤ ω ≤ π ⎭ (3)
For this system, consider N = 51, ωS = 1 rad/s and the
used to pass the frequencies of passband and attenuates all corresponding frequency response, determined by from Eq. (2)
other frequencies out side the passband. So the properties of 24
the filtering depend on the frequency response function H (ω ) , H 1 (ω ) = h (25 ) + 2 ∑ h (n ) cos ω (25 − n )
n=0 (4)
which settles on the choice of system parameters. Indeed FIR There are various methods to determine the filter coefficients.
filters are used to design a filter where there is a requirement Among these, the most widely used method is that of
for a linear phase characteristic within the pass band of that McClellan, Parks and Rabiner [2]. Their program is capable of
filter. The performance of different methods depends on the designing optimal FIR filters including low-pass; high-pass,
similarities of its frequency response with the desired band-pass and band reject filters. We wish to design a low
pass linear phase FIR frequency response H1 (ω ) such that it
S. M. Shamsul Alam has very flat passbands and low stopbands ripples. Also
Electronics and Communication Engineering Discipline,
Khulna University, Khulna-9208, Bangladesh. assume that the response has very sharp attenuation slop. To
Phone:+8801712163906; e-mail: alam_ece@yahoo.com determine the filter coefficients of Eq. (4), it is required to
Md. Tariq Hasan sample the desired frequency response of Eq. (3) considering
Electronics and Communication Engineering Discipline, non uniform frequency spacing and put the values of those
Khulna University, Khulna-9208, Bangladesh.
Phone:+8801914066244; e-mail: mdthasan@gmail.com samples into Eq. (4). The values of filter impulse response
International Journal of Electrical & Computer Sciences IJECS-IJENS Vol: 10 No: 01 14

coefficients, h(n) are cited in the Table 1. From these values


the desired equation of |H(ω)|, that is H1(ω) is found in terms
of impulse response, h(n) and from this we can get the Fig. 1
and Fig. 2 which show flat, that is ripple less passband and
there are ripples in the stopband which are gradually
decreasing.

| H (ω)| in dB
Table. 1 Optimal FIR lowpass filter
Filter Length = 51
Impulse Response
h(0) -0.0053 h(50)
h(1) 0.0081 h(49)
h(2) 0.0070 h(48)
h(3) -0.0121 h(47)
h(4) -0.0068 h(46)
h(5) 0.0035 h(45) ω in rad/s
h(6) 0.0107 h(44)
Fig. 2: Optimal FIR filter response.
h(7) 0.0064 h(43)
h(8) -0.0061 h(42)
h(9) -0.0137 h(41)
III. ANALYTICAL DESIGN OF LINEAR PHASE FIR FILTER
h(10) -0.0067 h(40) USING BLACKMAN WINDOW
h(11) 0.0099 h(39)
h(12) 0.0186 h(38) Here we begin to determine the impulse response hd (n) [1]
h(13) 0.0073 h(37) from the desired frequency response H d (ω ) . The impulse
h(14) -0.0158 h(36) response sequence is obtained from
h(15) -0.0263 h(35)
sin ω c (n − τ )
h(16) -0.0080 h(34) hd (n ) = n ≠τ
h(17) 0.0260 h(33) π (n − τ )
(5)
h(18) 0.0398 h(32) ωc
= n =τ
h(19) 0.0086 h(31) π
h(20) -0.0479 h(30) N −1
h(21) -0.0711 h(29) where τ = = 25
2
h(22) -0.0090 h(28)
The Blackman window [1] is defined by
h(23) 0.1321 h(27)
2π n 4π n
h(24) 0.2797 h(26) w b (n ) = 0 . 42 − 0 . 5 cos + 0 . 08 cos
N −1 (6) N −1
h(25) 0.3425 h(25)
for 0 ≤ n ≤ N − 1 .
The values of filter impulse response coefficients, h(n) for
Blackman window are following:
Table. 2 Lowpass Filter (Blackman Window)
Filter Length = 51
Blackman Window
Impulse Response
h(0) 0.0000 h(50)
| H(ω) |

h(1) 0.0000 h(49)


h(2) 0.0001 h(48)
h(3) 0.0000 h(47)
h(4) -0.0003 h(46)
h(5) -0.0005 h(45)
h(6) 0.0001 h(44)
h(7) 0.0015 h(43)
ω in rad/s
h(8) 0.0014 h(42)
Fig. 1: Frequency response of an optimal FIR lowpass filter.
h(9) -0.0013 h(41)
h(10) -0.0043 h(40)
h(11) -0.0022 h(39)
h(12) 0.0052 h(38)
h(13) 0.0093 h(37)
h(14) 0.0011 h(36)
International Journal of Electrical & Computer Sciences IJECS-IJENS Vol: 10 No: 01 15

h(15) -0.0142 h(35) coefficients. The filter coefficients are then determined as the
h(16) -0.0164 h(34) inverse discrete Fourier transform (IDFT) [3] of this set of
h(17) 0.0058 h(33) samples. For this design technique, the frequency samples are
h(18) 0.0323 h(32) chosen to be
h(19) 0.0242 h(31) 2π k k = 0, 1, 2, …………, N-1
ω k =
h(20) -0.0275 h(30) N
h(21) -0.0712 h(29) Sampling the desired frequency response we get
h(22) -0.0304 h(28) N −1 (7)
H (k ) = ∑ h (n ) e − 2 π kn / N
h(23) 0.1156 h(27) n = 0
h(24) 0.2887 h(26) and finally the impulse response, h(n) is obtained [3] by taking
h(25) 0.3661 h(25) IDFT of Eq. (7).
1 ⎧ ( N −1) / 2 ⎛ 2πk ⎛ 1 ⎞ ⎞⎫
h(n ) = ⎨G (0) + 2 ∑ G (k )cos⎜⎜ ⎜ n + ⎟ ⎟⎟⎬
N⎩ k =1 ⎝ N ⎝ 2 ⎠ ⎠⎭
⎛ 2πk ⎞ N −1
where G (k ) = (− 1)k H ⎜ ⎟ k = 0, 1, ………
⎝ N ⎠ 2
The coefficients of impulse response, h(n ) for frequency
sampling technique are listed in Table 3.
| H (ω)|

Table. 3 Lowpass Filter (Frequency sampling method)


Filter Length = 51
Impulse Response
h(0) -0.0030 h(50)
h(1) 0.0022 h(49)
h(2) 0.0048 h(48)
h(3) 0.0000 h(47)
ω in rad/s h(4) -0.0064 h(46)
h(5) -0.0051 h(45)
Fig. 3: Frequency response of FIR lowpass filter using h(6) 0.0043 h(44)
Blackman window. h(7) 0.0105 h(43)
h(8) 0.0039 h(42)
h(9) -0.0099 h(41)
h(10) -0.0142 h(40)
h(11) -0.0008 h(39)
h(12) 0.0172 h(38)
h(13) 0.0174 h(37)
| H (ω)| in dB

h(14) -0.0051 h(36)


h(15) -0.0272 h(35)
h(16) -0.0200 h(34)
h(17) 0.0159 h(33)
h(18) 0.0428 h(32)
h(19) 0.0219 h(31)
h(20) -0.0386 h(30)
h(21) -0.0761 h(29)
ω in rad/s h(22) -0.0231 h(28)
Fig. 4: Frequency response of FIR lowpass filter using h(23) 0.1240 h(27)
Blackman window. h(24) 0.2863 h(26)
The frequency responses of Blackman window are shown in h(25) 0.3569 h(25)
Fig. 3 and Fig. 4. From the figures it is clear that passband is
flat and there are ripples in the stopband, which are gradually The frequency responses of the low pass FIR filter designed
decreasing. using frequency sampling method are shown in Fig. 5 and Fig.
6. From the figure it is clear that there are some ripples at the
IV. ANALYTICAL DESIGN OF LINEAR PHASE FIR FILTER edge of passband and the in the stopband are gradually
USING FREQUENCY-SAMPLING METHOD decreasing as the increase of frequency of input signal
A set of samples is determined from a desired frequency increases. Here transition is quite narrow. It is important that
response and is identified as discrete Fourier transform (DFT) the choice of sample points in this method plays a very
significant role. So choosing appropriate number of samples
International Journal of Electrical & Computer Sciences IJECS-IJENS Vol: 10 No: 01 16

and samples positions, one can design the desired FIR filter. on the availability of the design [5].
| H (ω)|

| H (ω)|
ω in rad/s ω in rad/s
Fig. 5: Data for FIR lowpass filter using frequency sampling
Fig. 7: Comparison of frequency responses of FIR lowpass
method.
filters.

| H (ω)| in dB
| H (ω)| in dB

ω in rad/s
Fig. 8: Comparison of frequency responses of FIR lowpass
ω in rad/s filters.
Fig. 6: Frequency response of FIR lowpass filter using
frequency sampling method.

V. SIMULATION RESULT AND PERFORMANCE EVALUATION


The magnitude responses of different design techniques are
illustrated in Fig. 7 and Fig. 8. Optimal method shows the
| H (ω)|

superior passband performance but in this method, there are


relatively large oscillations or ripples near the cutoff
frequency. It decreases with increase in the frequency of the
input signal. While the Blackman window gives much better
stopband attenuation but the Blackman window response
shows poor performance in the transition band. So to achieve a
given transition band performance (narrow transition band)
with a Blackman window, a much higher filter order is needed ω in rad/s
than optimal method. These points are demonstrated clearly in
Fig. 7. On the other hand, filters with arbitrary amplitude and Fig. 9: Frequency response of FIR lowpass filter using optimal
phase response can be designed by frequency sampling method and Remez Exchange Algorithm (when stop band and
method. The frequency sampling method shows sharp stop band have the same weight).
transition band than window response. It lacks precise control
of the band edge frequencies or the passband ripples and relies
International Journal of Electrical & Computer Sciences IJECS-IJENS Vol: 10 No: 01 17

The Remez exchange algorithm is used to find the frequency Fig. 12: Frequency response of FIR lowpass filter using
response of FIR lowpass filter using optimal method. optimal method and Remez Exchange Algorithm (when pass
band has more weight than stop band).
| H (ω)| in dB

| H (ω)|
ω in rad/s
Fig. 10: Frequency response of FIR lowpass filter using
optimal method and Remez Exchange Algorithm (when stop
band and stop band have the same weight). ω in rad/s
Fig. 13: Frequency response of FIR lowpass filter using
optimal method and Remez Exchange Algorithm (when stop
band has more weight than pass band).
| H (ω)|

| H (ω)| in dB

ω in rad/s
Fig. 11: Frequency response of FIR lowpass filter using
optimal method and Remez Exchange Algorithm (when pass ω in rad/s
band has more weight than stop band ). Fig. 14 Frequency response of FIR lowpass filter using
optimal method and Remez Exchange Algorithm (when stop
band has more weight than pass band).

If Remez exchange algorithm is applied in optimal method,


frequency response becomes somewhat different. The
magnitude response is illustrated in Fig. 9 and Fig. 10 using
the same weight in passband and stopband. It introduces
ripples in the passband as well as stopband.
| H (ω)| in dB

If the weight of passband is more than that of stopband,


response of the passband becomes flat or ripple less but the
ripples in the stopband become larger, which are shown in Fig.
11. Exactly opposite response is found if the weight of
stopband is more than that of the passband, which is shown in
Fig. 13 and Fig. 14.
If the weight of passband and stopband is same and the
transition bandwidth is increased then almost flat passband
ω in rad/s and stopband response is found, which is shown in Fig. 15.
International Journal of Electrical & Computer Sciences IJECS-IJENS Vol: 10 No: 01 18

But this broadens the transition band, which reduces the ideal good solution to the filter design problem. The major
properties of a filter. disadvantage of the window design method is the lack of
precise control of the critical frequencies, such as ω p and ω s ,
in the design of a low pass FIR filter and its value depends on
the type of window and the filter length N [3]. Fig. 8 shows
the relative performance of the different filtering methods. The
frequency sampling method provides an improvement over the
window design method, since Hr(ω) is specified at the
frequencies ω k = 2πk / N and transition band is a multiple of
2π / N [3]. This filter design method is particularly attractive
| H (ω)|

when the FIR filter is realized either in the frequency domain


by means of the DFT or any of the frequency sampling
realizations.

REFERENCES
[1] J. R. Johnson, “Introduction to Digital Signal Processing,”4th ed.,
ω in rad/s Prentice-Hall of India Private Limited, 1997, pp. 85-95.
Fig. 15: Frequency response of FIR lowpass filter using [2] J. H. McClellan., T. W. Parks, and L. R. Rabiner, “A Computer
Program for Designing Optimum FIR linear Phase Digital Filters,”
optimal method and Remez Exchange Algorithm (when pass IEEE trans.Audio Electroacoust., AU-21, December 1973, pp. 506-526.
band and stop have same weight but transition band is more). [3] J. G. proakis., D. G. Manolakis., Digital Signal Processing principles,
Algorithms, and Application.” 3rd ed., Prentice-Hall of India Private
Limited, 1997, pp. 620-662.
[4] E. C. Ifeachor, B. W. Jervis, “Digital Signal Processing A Practical
Approach,” 2nd ed., Pearson Education Pte. Ltd. 2003, pp. 342-398.
[5] L. R. Rabiner, B. Gold, and C. A. McGonegal, “An approach to the
approximation problem for nonrecursive digital filters,” IEEE trans.
Audio Electroacoustics, Vol.18, Iss. 2, pp. 83- 106.
| H (ω)| in dB

ω in rad/s
Fig. 16: Frequency response of FIR lowpass filter using
optimal method and Remez Exchange Algorithm (when pass
band and stop have same weight but transition band is more).

VI. CONCLUSION
The design of linear phase optimal FIR filters, with very flat
passbands, can be done by solving the frequency response
equations for different frequency components. To solve the
filter parameters, one can use an iterative algorithm like
Remez exchange algorithm [3]. The response of Remez
algorithm is shown in figure 9. We can also do this, by
sampling the desired frequency response with non uniform
frequency spacing as shown the response in Fig. 1. Here we
see that the degree of flatness in passbands and ripples in
stopbans depend on the transition bandwidth. If we set this
bandwidth low then ripples increases and vice versa. We can
get better stopband attenuation using Blackman window
method. In summary, the optimal solution is not always a

Anda mungkin juga menyukai