Advertisement
Articles
Advertisement

Filter Design Tools and Wizards

Thu, 08/13/2009 - 9:53am
Hank Zumbahlen, Sr. Staff Applications Eng., Analog Devices

 

Filters are common in electronic equipment. From antialiasing filters used before A to D converters, to reconstruction filters after D to A converters, to intermediate frequency (IF) strips applications for filters are everywhere. The common thread is the desire to pass some frequencies, while blocking others.

An ideal filter will have an amplitude response that is unity (or at a fixed gain) for the frequencies of interest (called the passband) and zero everywhere else (called the stopband). The frequency at which the response changes from passband to stopband is referred to as the cutoff frequency.

MainCircuit-Fig1-0809Figure 1(A) shows an idealized lowpass filter. In this filter the low frequencies are in the passband (shaded area) and the higher frequencies are in the stopband.

The functional complement to the lowpass filter is the highpass filter. Here, the low frequencies are in the stopband, and the high frequencies are in the passband. Figure 1(B) shows the idealized highpass filter.

If a highpass filter and a lowpass filter are cascaded, a bandpass filter is created. The bandpass filter passes a band of frequencies between a lower cutoff frequency, f l, and an upper cutoff frequency, f h. Frequencies below f l and above f h are in the stopband. An idealized bandpass filter is shown in Figure 1(C).

A complement to the bandpass filter is the bandreject, or notch filter. Here, the passbands include frequencies below f l and above f h. The band from f l to f h is in the stopband. Figure 1(D) shows a notch response.

The idealized filters defined above, unfortunately, cannot be easily built. The transition from passband to stopband will not be instantaneous, but instead there will be a transition region. Stop band attenuation will not be infinite.

MainCircuit-Fig2-0809The five parameters of a practical filter are defined in Figure 2.

The cutoff frequency (Fc) is the frequency at which the filter response leaves the error band (or the ?3dB point for a Butterworth response filter). The stopband frequency (Fs) is the frequency at which the minimum attenuation in the stopband is reached. The passband ripple (Amax) is the variation (error band) in the passband response. The minimum passband attenuation (Amin) defines the minimum signal attenuation within the stopband. The steepness of the filter is defined as the order (M) of the filter. M is also the number of poles in the transfer function.  A pole is a root of the denominator of the transfer function. Conversely, a zero is a root of the numerator of the transfer function. Each pole gives a –6 dB/octave or –20 dB/decade response. Each zero gives a  +6dB/octave, or  +20 dB/decade response. 

Note that not all filters will have all these features. For instance, all-pole configurations (i.e. no zeros in the transfer function) will not have ripple in the stopband. Butterworth and Bessel filters are examples of all-pole filters with no ripple in the passband.

It should also be pointed out that the filter will affect the phase of a signal, as well as the amplitude. For example, a single pole section will have a 90? phase shift at the crossover frequency.  A pole pair will have a 180? phase shift at the crossover frequency. The Q of the filter will determine the rate of change of the phase.

A filter is often specified in terms of its Fo and Q.

Fo is the cutoff frequency of the filter. This is defined, in general, as the frequency where
the response is down 3dB from the passband. It can sometimes be defined as the frequency at which it will fall out of the passband. For example, a 0.1dB Chebyshev filter can have its Fo at the frequency at which the response is down > 0.1dB.

Q is the “quality factor” of the filter. If Q is > 0.707, there will be some peaking in the filter response. If the Q is < 0.707, rolloff at F0 will be greater; it will have a more gentle slope and will begin sooner. Q = 0.707 is considered critically damped.

There is another type of filter that leaves the amplitude of the signal intact but introduces
phase shift. This type of filter is called an allpass. The purpose of this filter is to add phase shift (delay) to the response of the circuit. The amplitude of an allpass is unity for all frequencies. The phase response, however, changes from 0? to 360? as the frequency is swept from 0 to infinity. The purpose of an all pass filter is to provide phase equalization, typically in pulse circuits. It also has application in single side band, suppressed carrier (SSB-SC) modulation circuits. Allpass filters are encountered infrequently.

Filters can be built in several ways.

Active filters will be the main thrust of this article. They are commonly used in the frequency range of DC to about 10 MHz. While it is possible to build active filters at higher frequencies with the present op amp technology, several effects tend to start creep in as frequency increases which compromise the filter.

Active filters are built with resistors (R), capacitors (C) and active elements, either op amps or some other type of gain element. One nice feature of active filters is that because of the use of active elements, each section of the filter can be handled more or less independently, making the design of more complex filters a bit easier.

Passive filters use inductors (L), capacitors (C) and resistors (R) to build the filter. Passive filters can be used in applications where active filters are not practical, such as frequencies where active filters won’t work or in areas where the voltage and/or current levels are not conducive to active filter implementation, such as in power line filters.

One drawback of passive filters is that each section is the load for the previous section and the source for the following section. Each section requires both the source and the load. This dependence makes design of more complex filters a bit more demanding.

Digital filters are a whole other ballgame. With a digital filter, the signal is digitized with an ADC and the filtering is done in the digital domain. While the filter functions can mimic those in the analog domain, digital filters can be built which are not possible in the analog domain.

Filter design is a two part process. The first part is to figure out what it is you want to build. By this I mean what the response shape of the filter should be. The second part of filter design is to decide how to build it. By this I mean what topology would be used. Each topology choice has its advantages and issues.
 
The majority of the time the simpler is better, so often we would use one of the filter topology that uses one op amp. The most common choices here would be the Voltage Controlled Voltage Source (VCVS, otherwise known as the Sallen-Key) or the Multiple Feedback (MFB). Comparison of these options is beyond the scope of this article. I recommend the discussions in Ref.1 and Ref. 2.

Another option is to use a topology that uses more op amps, such as the State Variable or the Biquad. The major advantage here is that the various parameters are independently adjustable and more stable. Again, more detailed discussions are available in Ref.1 and Ref. 2.

In general, higher order filters are made up of cascaded 2-pole and 1-pole sections. There are topologies that can be used to create 3-pole and even 4-pole sections with a single active element, but component sensitivities tend to be much higher.

Another option might be a Switched Capacitor topology. In this topology, the resistors are replaced by a switched capacitor arrangement.  The filter center frequency is set by the clocking rate of the switch. The advantage of this topology is high integration; the disadvantage is the potential for clock feedthrough and other switching artifacts.

CAD Programs, Tools and Wizards

So with this background in filter design we will look at what we want and what is available in design tools.

Since the primary function of a filter is to separate wanted signals from unwanted signals, it is safe to assume that in the vast majority of cases we are interested in the frequency response of the filter. Many times this is all that we are interested in. Depending on the application we might also be interested in the phase response of the filter as well. Applications that use in-phase and quadrature modulation schemes will have some sensitivity to the phase response. In addition, audio designs (as an example) might want to look at the group delay of the filter. The group delay is the rate of change of phase vs. frequency. In some applications, such as when the filter might be enclosed in a feedback loop, such as in a servo system, we might also want to look at the pole-zero plot of the filter to check for stability of the loop.

These parameters can be grouped together as frequency domain responses.

In addition, we may want to look at the transient behavior of the filter. Typically what is used here is the impulse response and step response of the filter. The impulse response of a filter is the response to an infinitely high, infinitely narrow pulse. It is also the inverse of the frequency response. The step response is the response to an instantaneous change of the input from zero to unity.

Lower frequency filters will tend to spread out the impulse response. High Q sections of filters will tend to add overshoot and ringing to the step response.

These parameters can be grouped together as time domain responses.

Once the transfer function of the filter is set, we need to calculate the components to actually build the filter.

The simplest form of design tool is one that calculates the components for a particular filter.  This implies that you already know what type of filter you need. Often the analysis part of the design is lacking.

One caution should be given here. Many of these packages will give you the calculated values of the components. The problem is, it is difficult to order resistors and capacitors with four significant places of accuracy. Better packages will give you standard values. Better yet would be a package that gave an indication of the change in Fo and Q and the effect that this will have on the transfer function of the filter.

Another caution is that if the package does not specify the op amp type, the results may be suspect. A practical filter is actually the transfer function of the filter and the response of the op amp in series. A closed loop op amp is actually a low pass filter in its own right. Therefore the filter response will be in turn filtered by the op amp response. And the phase response of an op amp can start changing a decade or more before the cutoff frequency.

Occasionally these packages will give you the option of outputting a spice netlist. This will allow the filter to be further simulated in a spice type package. Some manufactures provide a spice package to allow customers to do some simulation if they would not ordinarily have that capability. For example, at Analog Devices we provide a version of National Instruments Multisim™ ( http://www.analog.com/en/design-tools/dt-multisim-spice-program-download/design-center/index.html ). These evaluation packages are typically a smaller version of the full packages. For instance they may be limited in nodes available or the ability to save designs or parts.

Component variation can also affect the filter response, both in the center frequency (Fo) and Q. This can be both static error due to component tolerance and dynamic change with temperature or time. Therefore it could be useful to look at the affect of these changes. One way to do this is with Monte Carlo analysis. Monte Carlo analysis a class of computational algorithms that rely on repeated pseudo-random sampling to compute their results. This can be used to estimate the variation that would be encountered in manufacturing.

One way to start to sort out the CAD programs and tools is by whether they are stand alone or as add on to other CAD packages.

As an example of add-on programs, MATLAB® is an interactive environment that enables you to perform mathematically intensive tasks that has found extensive use in electronic design. Plug-in additions, often group under the tag “toolbox”, are available. Given the highly mathematical nature of filter design, this is a natural fit. This is especially true for digital filters. For digital filters the signal data can be use to simulate the filter. The output can then be the code for the specific DSP engine.

Alternatively, there are MATLAB® add on packages that can be used to design, analyze, and simulate active analog filters. They can display time and frequency domain responses, pole/zero plots, transfer function, and circuit schematic.

Many Spice type simulation packages have filter design tools (often called wizards) available. Obviously, since it is a simulation package all of the time domain and frequency domain responses, as well as schematics are available.

There are also some routines that use a spreadsheet program such as Excel as the simulation engine. These can be component calculators, but can also provide simple frequency and time domain results.

There are also a great number of stand alone filter design packages available. They vary widely in both cost and capability.

There are many freeware packages. These tend to be mostly of the component selection type. Typical outputs are the component values for a select number of filter responses and a select number of topologies.

Many manufacturers have design packages either on-line or in a downloadable form. These packages usually are specifically aimed at the particular manufacturer’s product offering.

As an example, here at Analog Devices, we have a filter design package which is available as an on-line tool (http://www.analog.com/en/design-tools/dt-input-stage-filter-design/design-center/dt-input-stage-filter-design/Filter_Wizard/resources/fca.html ). This tool allows you to specify the filter either in terms of standard all-pole responses or by specifying the response in terms of the parameters of Fig. X. It then allows you to choose the topology you want to use to build the filter. Next the program suggests appropriate op amps to use. And finally it determines the components. It will give both the calculated values and standard values, allowing you to set the tolerance of the resistors and capacitors separately. If standard values are used the percentage change in Fo and Q are displayed. In addition, all filter parameters and component values are user alterable. Amplitude and phase responses as well as a BOM are given. A spice netlist is available as an option. Fig. 3 shows the last page of the program, showing the component values.

MainCircuit-Fig3-0809

Beyond the free packages there are several very powerful packages available that are specifically aimed at filter design. This is especially true in the digital filter domain. Typically these programs provide extensive design and analysis capabilities. They may also offer additional functionality. For instance, you may want to have a filter with an arbitrary shape. As an example, in acoustics noise is often weighted with a filter with a response which is roughly the inverse of the ears non-linear response with frequency. This is called an “A-weighting” filter. The response is based on the Fletcher-Munson curves which showed the ears frequency response variation with frequency and level.

Sometimes packages are available in varying levels of complexity, allowing the used to match his expenditure to his requirements.

Some programs are available as demos to allow the designer to use the program to get a feel for it. These demos are typically limited in some respect. They may be lacking the ability to save the design. They could have a limit on the size of the design. They could be only operational for a set period of time. Or, possibly, they could have a combination of these limits.

So now you have a little background in filter design an idea of what to look for in design tools. This should ease your job the next time a filter is required.

References:

1. Hank Zumbahlen, Linear Circuit Design Handbook  Newnes-Elsevier (2008)
ISBN: 978-0-7506-8703-4.

2. A. B. Williams, Electronic Filter Design Handbook, McGraw-Hill, 1981, ISBN: 0-07-070430-9.

3. M. E. Van Valkenburg, Analog Filter Design, Holt, Rinehart & Winston, 1982 ISBN: 0-03-059246-1

4.    Hank Zumbahlen “Analog Filters.” Chapter 5, in Jung, W., Op Amp Applications Handbook. Newnes-
        Elsevier (2006) ISBN-10: 0-7506-7844-5. 
            (Original chapter from ADI Seminar Notes is available online.)

5.    Hank Zumbahlen Basic Linear Design. Ch. 8. Analog Devices Inc.  (2006)  ISBN: 0-916550-28-1.
 

Topics

Advertisement

Share this Story

X
You may login with either your assigned username or your e-mail address.
The password field is case sensitive.
Loading