A First Course in Electrical and Computer Engineering by Louis Scharf - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Chapter 6Filtering

6.1Filtering: Introduction*

This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

Notes to Teachers and Students:

Filtering is one of the most important things that electrical and computer engineers do. In this chapter we extend everyday understanding of filters to numerical filters. We then study weighted moving averages and exponential averages. We define the important test signals for electrical and computer engineering and show how filters respond to them. The idea that filters are characterized by their response to simple test signals is fundamental. In the numerical experiment, students explore the frequency response of a simple filter, a concept that forms the basis of circuit theory, electronics, optics and lasers, solid-state devices, communications, and control.

Introduction

A filter is any device that passes material, light, sound, current, velocity, or information according to some rule of selectivity. Material (or mechanical) filters are commonplace in your everyday life:

  1. coffee filters pass flavored water while filtering out coffee grounds;

  2. Goretex fibers pass small, warm perspiration droplets while filtering out large, cool droplets of rain or snow;

  3. fiberglass strands in a furnace filter pass warm air while filtering out particles of dirt and dust;

  4. a centrifuge retains material of low density while spinning out (or filtering out) material of high density; and

  5. an electrostatic precipitator filters out dust and other effluents by attaching charge to them and using an electric field to move the charged particles to a high potential drain.

The first three of these examples selectively pass material according to size; the last two selectively pass material according to its mass density.

Typical filters for light are

  1. UV filters on camera lenses and eyeglasses that pass light in the range of visible wavelengths while blocking light in the invisible (but damaging) ultraviolet range;

  2. polaroid lenses that pass light that is randomly polarized while blocking out glare that is linearly polarized;

  3. green fabrics that reflect green light and absorb other colors;

  4. red taillights that pass light in the long wavelength red range and reflect light in the short wavelength violet range (look at the inside of your taillights to see violet); and

  5. glacial ice that absorbs all but the blue wavelengths so that it appears blue.

Exercise 1.

List as many examples of natural and man-made sound filters as you can.

Satellite Television. Among current filters, the tuner in a super-heterodyne receiver is, perhaps, the first example that comes to mind. But satellite TV filters are another fascinating example. A typical C-band satellite has twelve transponders (or repeaters), each of which transmits microwave radiation in a personalized 36 MHz band. (The abbreviation MHz stands for megahertz, or 106 Hz, or 106 cycles per second. Other common abbreviations are Hz for 1 Hz, kHz for 103 Hz, and GHz for 109 Hz.) Each transponder actually transmits two channels of information, one vertically polarized and one horizontally polarized. There is an 8 MHz guard band between each band, and the vertical and horizontal channels are offset by 20 MHz. The transmission scheme for the 24 channels is illustrated in Figure 1. The entire transmission band extends over 540 MHz, from 3.7×109 Hz to 4.24×109 Hz. The satellite receiver has two different microwave detectors, one for vertical and one for horizontal polarization, and a microwave tuner to tune into the microwave band of interest.

Exercise 2.

Check that the transmission scheme of Figure 1 consumes 540 MHz of bandwidth.

Exercise 3.

List as many examples of natural and man-made devices for velocity filtering as you can.

Introduction
Figure 6.1
Satellite TV– Vi, Vertically Polarized Channel i;Hj, Horizontally Polarized Channel j

An Aside on Hertz and Seconds. The abbreviation Hz stands for hertz, or cycles/second. It is used to describe the frequency of a sinusoidal signal. For example, house current is 60 Hz, meaning that it has 60 cycles each second. The inverse of Hz is seconds or, more precisely, seconds/cycle, the period of 1 cycle. For example, the period of 1 cycle for house current is 1/60 second. When we are dealing with sound, electricity, and electromagnetic radiation, we need a concise language for dealing with signals and waves whose frequencies range from 0 Hz (called DC or direct current) to 1018 Hz (visible light). Table 1 summarizes the terms and symbols used to describe the frequency and period of signals that range in frequency from 0 Hz to 1012 Hz.

Table 6.1. Terms and symbols for Sinusoidal Signals
FrequencyPeriod 
HzTermUnitsSecondsTermUnitsExample
Hzhertz1 Hzsecsecond1 secbattery current: 0 Hz
house current: 60 Hz
kHzkilohertz103 Hzmsecmillisecond10-3 secmidfrequency sound
MHzmegahertz106 Hzµsecmicrosecond10-6secclock frequencies in microcomputers
GHzgigahertz109 Hznsecnanosecond10-9secmicrowave radiation for satellite communication
THzterahertz1012 Hzpsecpicosecond10-12 secinfrared radiation

Numerical Filters. Rather amazingly, these ideas extend to the domain of numerical filters, the topic of this chapter. Numerical filters are just schemes for weighting and summing strings of numbers. Stock prices are typically averaged with numerical filters. The curves in Figure 2 illustrate the daily closing average for Kellogg's common stock and two moving averages. The 50-day moving average is obtained by passing the daily closing average through a numerical filter that averages the most current 50 days' worth of closing averages. The 200-day moving average for the stock price is obtained by passing the daily closing prices through a numerical filter that averages the most current 200 days' worth of daily closing averages. The daily closing averages show fine-grained variation but tend to conceal trends. The 50-day and 200-day averages show less fine-grained variation but give a clearer picture of trends. In fact, this is one of the key ideas in numerical filtering: by selecting our method of averaging, we can filter out fine-grained variations and pass long-term trends (or vice versa), or we can filter out periodic variations and pass nonperiodic variations (or vice versa). Figure 2 illustrates that moving averages typically lag increasing sequences of numbers and lead decreasing sequences. Can you explain why?

We will call any algorithm or procedure for transforming one set of numbers into another set of numbers a numerical filter or digital filter. Digital filters, consisting of memories and arithmetic logic units (ALUs), are implemented in VLSI circuits and used for communication, control, and instrumentation. They are also implemented in random–or semicustom–logic circuits and in programmable microcomputer systems. The inputs to a digital filter are typically electronic measurements that are produced by A/D (analog-to-digital) conversion of the output of an electrical or mechanical sensor. The outputs of the filter are “processed,” “filtered,” or “smoothed” versions of the measurements. In your more advanced courses in electrical and computer engineering you will study signal processing and system theory, assembly language programming, microprocessor system development, and computer design. In these courses you will study the design and programming of hardware that may be used for digital filtering.

Terms and symbols for Sinusoidal Signals
Figure 6.2
Dow-Jones Averages (Adapted from the New York Stock Exchange, Daily Graphs, William O'Neil and Co., Inc., Los Angeles, California)

6.2Filtering: Simple Averages*

This module is part of the collection, A First Course in Electrical and Computer Engineering. The LaTeX source files for this collection were created using an optical character recognition technology, and because of this process there may be more errors than usual. Please contact us if you discover any errors.

The simplest numerical filter is the simple averaging filter. This filter is defined by the equation

(6.1)
_autogen-svg2png-0001.png

The filter output x is the average of the N filter inputs u1,u2,... , uN. These inputs may be real or complex numbers, and x may be real or complex. This simple averaging filter is illustrated in Figure 1.

Figure 6.3
A Simple Averaging Filter
Example 6.1

If the averaging filter is excited by the constant sequence u1=u2=⋯=uN=u, then the output is

(6.2)
_autogen-svg2png-0004.png

The output is, truly, the average of the inputs. Now suppose the filter is excited by the linearly increasing sequence

(6.3)
_autogen-svg2png-0005.png

This sequence is plotted in Figure 2. How do we sum such a sequence in order to produce the average x ? For N even, the average may be written as

(6.4)
_autogen-svg2png-0008.png

Each pair-sum in parentheses equals N+1, and there are _autogen-svg2png-0010.png such pair-sums, so the average is

(6.5)
_autogen-svg2png-0011.png

This is certainly a reasonable answer for the average of a linearly increasing sequence. See Figure 2.

Figure 6.4
Linearly Increasing Sequence
Exercise 4.

Write _autogen-svg2png-0012.png as a sum of pair-sums for N odd. What does x equal?

General Sum Formula. Suppose the input to the simple averaging filter is the polynomial sequence

(6.6)
_autogen-svg2png-0015.png

where k is a non-negative integer such as k=0,1,2,.... The output of the filter is

(6.7)
_autogen-svg2png-0018.png

We rewrite x as _autogen-svg2png-0020.png to remind ourselves that we are averaging N numbers, each of which is nk. For example, when N=8 and k=2,

(6.8)
_autogen-svg2png-0025.png

Rather than study the average _autogen-svg2png-0026.png, we will study the sum _autogen-svg2png-0027.png and divide by N at the very end:

(6.9)
_autogen-svg2png-0029.png

The sum _autogen-svg2png-0030.png may be rewritten as the sum

(6.10)
_autogen-svg2png-0031.png

This result is very important because it tells us that the sum _autogen-svg2png-0032.png, viewed as a function of N , obeys a recursion in which _autogen-svg2png-0034.png is just the sum using one less input, namely, _autogen-svg2png-0035.png, plus Nk. Now, since polynomials are the most general functions that obey such recursions, we know that _autogen-svg2png-0037.png must be a polynomial of order k+1 in the variable N :

(6.11)
_autogen-svg2png-0040.png

Let's check to see that this polynomial really can obey the required recursion. First note that _autogen-svg2png-0041.png is the following polynomial:

(6.12)
_autogen-svg2png-0042.png

The term (N–1)k+1 produces _autogen-svg2png-0044.png. (Remember the binomial expansion?) Therefore the difference between _autogen-svg2png-0045.png and _autogen-svg2png-0046.png is

(6.13)
_autogen-svg2png-0047.png

This recursion is general enough to produce the difference Nk provided we can solve for a0,a1,... , ak+1 to make c0=c1=⋯=ck–1=0 and ck=1. We know that _autogen-svg2png-0052.png for N=