
IN CASE YOU MISSED IT!
Designing a filter need not be a daunting, time-consuming, costly, computer-intensive task. Often the design engineer is confronted with the onerous task of quickly designing a digital filter to clean up a noisy signal. Most tools on the market today require the user to be a programmer, or be able to act like one, but this isn’t what the accomplished professional design engineer was trained to do. Usually, it’s also not what he or she gets paid to do.
Software now exists to make this project simple, obvious, and straightforward by melding the power of the computer with the knowledge of the engineer, without requiring the latter to be an expert in the former.
By combining a rich repertoire of signal processing, digital filtering, and mathematical functionality in an extensive series of pull-down menus and a spreadsheet environment, DADiSP software allows the engineer to easily implement even complex filters with time-saving and cost-saving simplicity.
Maybe someday recorded signals will be so perfectly clear that filters will become obsolete. Engineers won’t need to know about designing a filter to eliminate high frequency noise, or cleaning up a signal so that analysis of that signal is worth their time. Until then, we’ll have to keep slogging through the design and testing of digital filters. Various software can make that task easier, since designing and simulating a digital filter with software can be done either with or without programming. The following goes through the steps of designing and simulating a digital filter in a non-programming environment using a software package called DADiSP.
Filter Design/Background
Let me begin by explaining how DADiSP begins the process of designing a filter. Using the Filters module, the user has the ability to select the type of filter they are interested in designing. From the built in menus, the user can design either an infinite impulse response (IIR) filter or a finite impulse response (FIR) filter.
The FIR filter can be modeled by the following difference equation:

where y[n] is the output data, x[n] is the input, b[k] the filter coefficients and N the filter order. The FIR filter module determines b[k] given the filter specifications. Two methods for FIR filter design are supported with DADiSP/Filters:
Remez Exchange - optimal design
Kaiser Window - ideal response multiplied by a Kaiser window.
Both designs result in linear phase filters throughout the pass band. The Remez Exchange algorithm generates filters with the fewest number of coefficients. The Kaiser Window method is preferred when the pass or stop band occupies only a small percentage of the entire filter bandwidth. The resulting filter coefficients also represent the impulse response of the filter. Once the FIR filter has been designed, DADiSP has the ability to analyze the frequency domain characteristics by looking at the magnitude and phase responses of the filter, simply by clicking on a menu command.
The second type of filter design DADiSP supports is the infinite impulse response (IIR) filter. IIR filters can be modeled with the following difference equation:

where y[n] is the output data, x[n] the input, a[k] and b[k] the filter coefficients, and N is the filter order. To minimize numerical roundoff error, the IIR module converts the coefficients to cascaded 2nd order stages as represented by the following transfer function where H(z) is equal to:

In this form, the given transfer function H(z) is factored into small second order sections, and is represented as a product of these sections. Each section is implemented directly, and the entire filter is implemented as a cascade of sections. DADiSP/Filters determines the coefficients (the a's and b's above) given the filter specifications using the Bilinear Transform. The coefficients are generated in the following order:
| Butterworth | largest number of coefficients, small passband ripple |
| Chebychev I | ripple in passband, flat in stopband |
| Chebychev II | flat in passband, ripple in stopband |
| Elliptical | ripple in both bands, fewest number of coefficients |
Unlike FIR filters, IIR filters do not exhibit linear phase. However, the IIR design often results in filters with fewer coefficients than an equivalent FIR design. The filter coefficients do not represent the impulse response of the filter, although DADiSP has a function to view the impulse response of the filter. Similar to the FIR filter, the frequency domain characteristics of the filter can be computed to see how good the filter design is for a specific application.
Figure 1 gives an illustration of the ease in designing a 4th order, lowpass butterworth filter from DADiSP and looking at different characteristics.

All the functions used in the figure are accessible through the DADiSP menus. We began by designing a 4th order, lowpass butterworth filter displayed in table format, so the user can see all the filter coefficients for this design.
Through the menus, the user is prompted to input the following arguments for the filter design:
After these parameters are entered into a menu, DADiSP computes the filter coefficients for these or the specific design criteria. Then by the use of DADiSP/Filters functions, the impulse, magnitude, and phase responses of this filter were computed and displayed in windows 4 - 6 in Figure 1. The operations of DADiSP works on the same principle as a spreadsheet. The impulse, magnitude, and phase response functions are set into the formulas for windows 4 through 6. Therefore, if the user changes any of the design parameters for the filter, these dependent windows will automatically update with the new responses for the new filter design.
Filter Implementation
Once the filter design is complete, the user may opt to use these coefficients in two ways. One is by taking these coefficients and using them for hardware realization/implementation schemes. Figure 2 shows an example of how you can use these coefficients to design your hardware.


In Figure 3, we generated a simple sine wave through the menus by inputting a sampling rate of 100 Hz and a frequency of 5 Hz. We then designed a filter where we specified all the parameters into the lowpass butterworth filters menu. Once the filter was designed, we applied it to the sample sine waveform. Finally, we overplotted the filtered waveform over the original sine waveform to observe the change in phase after the filter was applied.
All of the steps in the figure were produced by simply entering parameters into DADiSP menus. Keep in mind the fact that we used a simple sine waveform for our simulation. With the spreadsheet paradigm of DADiSP in mind, the user has the ability to change any of the input parameters for the sine waveform and all the subsequent windows will automatically update with this change. Also, with the click of the mouse the user can change the input signal altogether. The user has the ability to experiment with the designed filter by changing the input waveform to anything from a step function to a speech waveform, or any other measured noisy signal and have all the ensuing windows update.
Summary
The purpose of this article was to demonstrate how easy it is to use commercially available software to design filters for implementation and/or hardware realizations. The advantage of using products like DADiSP is that all of your work can be performed without any programming or calculations. The user does not have to be a filter design expert to use filtering for their analysis. By using some simple functions and menus the user simply needs to input their filter specifications and the software will do the rest. DSP Development Corp., One Kendall Square, Cambridge, MA 02139.
Back to Articles and Applications


