CMP EMBEDDED.COM

Login | Register     Welcome Guest  
HOME DESIGN PRODUCTS COLUMNS E-LEARNING CONFERENCES CODE FORUMS/BLOGS NEWSLETTERS CONTACT FEATURES RSS RSS


DESIGNER FILTERS

Many tools for filter design are available today. Math packages, such as MATLAB, provide a rich set of functions that can help or completely design a large variety of filter characteristics. With these tools, it’s possible to analyze, design, and simulate the operation of the filter.

With reference to previous years—when the math packages were lean, often command line driven, and sparse in complete filter design technique—this functionality is a real boon. It can take only a moment to design a filter, such as a Butterworth or Chebyshev, and in that time you can also simulate its operation and display its phase response and step response. I remember what it was like to fashion my own analog prototype to fit an application, perform a bilinear transformation with a hand-held calculator, move the transfer function to the z -plane, and decompose it into a difference equation. And I remember doing this over and over until I had just what I wanted.

Now, all of this is done on a GUI. Even so, I am grateful for the experience. I am grateful because though we can satisfy many applications or requirements using pre-defined filter types and the filter functions available in these math packages, you will always find those that need more. Sometimes you must satisfy the constraints of hardware, such as step response or phase. Another application might require a certain spectral feature that some pre-defined response doesn’t satisfy. And sometimes, these special responses are a combination of several different elements.

The fact is that a filter may be described by any of its characteristics: phase, group delay, magnitude response, step response, and more. It’s possible to design a filter with any of these parameters in mind, not just corner frequency and order. Designing to these parameters can not only be convenient, but even necessary when these are criteria you must satisfy (or the only characteristics you know). And it’s true that many of the math packages do provide for parameterized modeling, but you have to know what you’re looking for.

This month, I’d like to look at one of the basic parametric features that you might use to design a filter.

The quality factor, or Q

I’ll start by providing a better definition of the components of the filter and what the Q parameter really means. Not surprisingly, at the bottom of it all is the simple harmonic oscillator. It may come as a surprise to some that very little difference exists between a filter and an oscillator, which explains why some filters oscillate.

It seems that all things in this universe (including ideas) are composed of at least one element that wants to move or vibrate at a frequency particular to itself—this is the natural frequency of the element. Given an initial impulse, this element could simply vibrate at that frequency until it runs out of energy. To keep it going, you would have to keep supplying some form of drive to it.

This flicker of vibration that dies away is called the impulse response . If we supply a sufficiently narrow and tall impulse to a device, it will produce a response at its natural frequency (or frequencies, if a number of such elements are involved) that dies away proportional to its internal (and external) damping. With the impulse response, the entire character of any device can be derived.

If a device or algorithm has at least two elements that want to vibrate, and these two elements are equal and opposite in phase to one another, that device or algorithm will oscillate. It could oscillate forever in the absence of resistance because each element exchanges energy with the other. We call this combination an oscillator .

By definition, an oscillator is a device or algorithm that produces a signal (or pattern) that swings back and forth between alternate extremes at regular intervals. The period of this oscillation is the time it takes to complete one full swing to both extremes and back to the starting point. This is one cycle of oscillation. The frequency of oscillation is the inverse of the period and describes the number of such cycles occurring each second.

The frequency at which the oscillator will want to vibrate (in the absence of any driving source) is its natural frequency, or its resonant frequency . In an electronic circuit, resonance exists when the individual reactances are equal and opposite, resulting in a net circuit reactance of zero. Below resonance, the vector sum of the voltages is in the low right quadrant of the complex plane—current is leading the voltage. At resonance, the sum of the voltages across the inductance and the capacitance becomes extremely small and is in phase with the current. Above resonance, current trails and the voltage vector lie in the upper right quadrant. At resonance, then, the energy stored in the elements is constant—the inductance absorbs it as fast as the capacitance gives it up, releasing it again just as the capacitance needs it.

With the introduction of resistance, we find that the oscillator cannot continue on its own for very long. The energy is drained from the circuit or algorithm over a period of time—long or short—and the oscillator stops. If the damping is not so great that we can still get a twinkling of a signal through, we can still use this device as a filter, however. A filter is a forced oscillator .

A forced oscillator operates somewhat like a marriage or dance (a metaphor I credit to the incredible Richard Feynman). When the partners are in step and moving in the same direction, the dance flows freely and unrestrained. When one partner wants to move at a step or speed other than his partner’s, the motion is jerky, slow, and requires a great deal of effort.

In a forced oscillator, the driving signal is required to make up for the losses resulting from the resistances in the circuit or function. If a forced oscillator is driven by a signal or pattern that is coincident with the natural frequency of the oscillator, it works wonderfully and requires almost no energy from the driver. In fact, it can even appear to produce an excess of energy. At the same time, if we try to drive the oscillator or filter with a frequency other than its resonant frequency, we find that the output is attenuated to one degree or another.

The difference lies in the damping applied to the system. In electronic terms, damping is equivalent to resistance. Q is a measure of the ratio between the damping and the resistance. It determines the voltage rise at resonance and, most particularly, frequency selectivity. In an electronic circuit, it may be expressed as:

The value of Q increases as the poles of the network approach the j w-axis.

Very often, the Q of a circuit or function is specified in half-power points . These are points on the j w-axis that are ± j w from the natural frequency. The admittance (the inverse of impedance) of the circuit or function has dropped to 1/ at these points. The range of frequencies between the half-power points is called the bandwidth , which varies inversely with Q. A very high bandwidth is equivalent to a very low Q. The half-power point is also the point at which network response is down 3dB. From an electronic point of view, the higher the value of Q for a device or algorithm, the greater the reactance and the less the resistance; the lower the value of Q, the less the reactance and the greater the resistance.

In an electronic circuit or algorithm, the resonance in a system is described by the transfer function of the system. This transfer function is expressed as a rational function that may be decomposed as poles and zeros. In a two-pole filter, we have two reactances that multiply to produce a sharp transition band. In an electronic circuit, this is the result of the reactance of the capacitor decreasing with increasing frequency and the reactance of the inductor (or its simulation) increasing with increasing frequency.

The undamped natural frequency w 0 is computed as the norm of each complex pole with its conjugate:

The parameter Q is equal to the quotient of the natural frequency and the difference between each pole and its conjugate:

(1)

Each of the standard pre-defined filter characteristics has a given Q. Changing the Q means that we have changed the character of that filter. We can, however, begin with a characteristic that is most applicable to our application and then manipulate any given aspect to fit it better to our needs.

Butterworth filter characteristic

A Butterworth characteristic is one of the most popular, so let’s take that as a reference for an example. Assume a second order Butterworth filter. By definition, a normalized second order Butterworth has poles at -0.707+/- j 0.707 and a Q of 0.707 with a natural frequency of one. Using the formula stated above, we see that this all works.

But the problem is that we don’t want a Butterworth characteristic. We want to create a sort of peaking filter that we can use to sharpen the response of a composite filter we are making. Suppose we are starting with a Butterworth characteristic. We know that the Q of a Butterworth Biquad is 0.707 but we want 3.

In Equation 1, if we want a higher Q we need to increase the distance between the poles. Given the prototype transfer function for a Butterworth filter:

We know that b in the above function is:

In the case of a normalized Butterworth, w 0 =1 and , so:

or about 1.414. To change this to a gain of three means that b becomes 6.

To show what this kind of change can produce, I am presenting a series of plots representing the magnitude response and phase response of the same filter with a progressively increasing Q. Part A of Figure 1 is a second order Butterworth with a 3dB frequency of 2,820Hz.

(Note: The above link shows the entire figure. To view the individual Figures a-d, click on the links below)

This technique is useful in lowpass and highpass filters for creating some interesting effects. But there is another purpose for which it is also very useful. Most often, designers will create bandpass filters by concatenating highpass and lowpass filters, but this becomes difficult when the bandpass becomes very narrow. Some interesting narrow filters can be made by manipulating the Q. An example of a narrow bandpass filter created from a Butterworth characteristic by raising the Q is given in Figure 2 .

Next month, we’ll take a closer look at the system function and find some more things we can do with it.

Don Morgan is senior engineer at Ultra Stereo Labs and a consultant with 25 years experience in signal processing, embedded systems, hardware, and software. Morgan recently completed a book about numerical methods, featuring multi-rate signal processing and wavelets, called Numerical Methods for DSP Systems in C . He is also the author of Practical DSP Modeling, Techniques, and Programming in C , published by John Wiley & Sons, and Numerical Methods for Embedded Systems from M&T. You can send him e-mail at dmorga@ibm.net .

Figures
Figure 1
Figure 1a
Figure 1b
Figure 1c
Figure 1d
Figure 2

Return to Table of Contents

Embedded.com Career Center
Looking for a new job?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS





 :