Digital Signal Processing Reference
In-Depth Information
Chapter 8
Digital Filter Implementation Using C
In the previous three chapters we discussed the nature of digital filter design. We
are now ready to discuss the implementation of these digital filters. We begin this
chapter with a discussion of several important issues in digital filter selection and
implementation. These issues include the differences between real-time and
nonreal-time implementation, as well as the effects of finite precision
representation of input signals and filter coefficients. Then, we discuss the C code
for implementing IIR and FIR filters. Efficient algorithms will be developed to
increase the speed of execution. Each filter type will use a different technique
appropriate to the specific filter's representation. Finally, we conclude with a
discussion of the format for a popular sound file on the PC. We will consider how
we can use sound files to investigate the characteristics of the filters we have
designed.
8.1 DIGITAL FILTER IMPLEMENTATION ISSUES
The first decision to make when designing a system with a digital filter is whether
an IIR or FIR filter should be used. Some of the advantages and disadvantages of
each type have been discussed in the previous two chapters, so we will summarize
those points here. First, and foremost, the correct filter type must be determined by
the requirements of the application. IIR (recursive) filters have the advantages of
providing higher selectivity for a particular order and a closed form design
technique that doesn't require iteration. The design technique also provides for the
rather precise solution to the specifications of gain and edge frequencies.
However, IIR filters also have the disadvantages of nonlinear phase characteristics
and possible instability due to poor implementation. FIR (nonrecursive) filters, on
the other hand, can provide a linear phase response (constant group delay) that is
important for data transmission and high-quality audio systems. Also, they are
always stable because they are implemented using an all-zero transfer function.
Since no poles can fall outside the unit circle, the filter will always be stable. But
187
Search WWH ::




Custom Search