• Aucun résultat trouvé

By Bruce Eckel

Dans le document The PC Video Frame (Page 57-60)

e I

10 100 1K

Frequency (Hz)

Figure 2-Bode Frequency Plot at 6 KHz. By limiting the gain of each stage to 30, we get a bandwidth of about 30 KHz. The amplifiers will pass all the relevant infonnation, and the filter will do the work of removing the high-frequency components.

Filters

Usually, we describe a filter, or the fil-tering properties of any electronic device (even if it isn't specifically designed to be a filter), with a frequency plot. A frequency plot (also called "Bode plot") shows the size (amplitude) of the signal (usually as a ratio of output size to input size) on the vertical axis and its frequency in a logarithmic scale on the horizontal axis.

In a Bode plot, the vertical axis is 20*log(base 1O} of the output amplitude over the input amplitude (i.e., the gain in deciBels). Although there's an interesting history to these numbers, you shouldn't worry too much about why you use 20*log(base lO}(output/input} instead of just (output/input).

Pole at 1 O~ hz

(

K

\..

\

10K

By Bruce Eckel

Revolution2 308 Meredith St.

Kennett Square, P A 19348 BIX: beckel Compuserve: 72072,3256

20dB/decac e

\

\ \

100K 1M 10M

Figure 2 shows an example Bode plot, similar to what you'll see in electronic data books when you're looking for parts. Where the line is straight, signals of that frequency (shown on the x-axis) pass uniformly. Where the line bends, signals fall off. Figure 2 shows the signals passing up to 10 KHz, where the bend begins.

You can create any wavefonn by com-bining simple sine waves of different amplitudes and frequencies (we call this Fourier analysis). Thus, your voice con-tains components of 20 Hz, 500 Hz, 5 KHz, etc.

H your filter has a bend at 2.5 KHz and you pass a voice signal through it, all the frequency components of your voice above 2.5 KHz will be reduced or eliminated. There might still be enough infonnation in the lower frequencies for you to hear the words, but they'll sound different.

The straight-line part of the plot (called the passband) shows which frequencies pass. After the bend, you MICRO CORNUCOPIA, #50, Nov-Dec, 1989 55

enter the stopband, because the filter doesn't pass the signals anymore. The sharpness of the bend shows how quickly the filter switches from passing signals to stopping them.

Here the poles of the filter come in-the poles determine how quickly in-the fil-ter switches from passband to stopband.

The more poles at the cutoff frequency (10 KHz in Figure 2), the sharper the cut-off.

The quality factor Q, which you'll see mentioned in the databooks, measures the sharpness of a filter. The ideal filter turns out to be a multi-way tradeoff.

First, more poles require more com-ponents, which costs money. If you don't need a 12-pole filter, don't buy one. Also, adding poles can cause other side-effects, like "rippling" in the passband (which causes distortion). Thus, you won't often see a filter that is more than 4 poles (the one used in this project has 3).

Why Call Them Poles?

To design a filter, you represent it mathematically. The mathematical equa-tion for a filter has a numerator and de-nominator, which have points passing through zero. When the denominator goes to zero, the expression becomes in-finite. If you look at the equation in a three-dimensional space, a pole looks like a tent-pole under the plane (the canopy) representing the function.

Each pole of the function causes the Bode plot to bend and start decreasing at 56 MICRO CORNUCOPIA, #50, Nov-Dec, 1989

20 deciBels (dB) per decade (change in the numerator goes to zero) have the op-posite effect-they make the Bode plot increase by 20 dB/decade. Thus, design-ing a filter is a matter of figurdesign-ing out how to manipulate the poles and zeros of

+ 100uF 16Voll these poles and zeros, and these ways are named after their inventors. In this cir-cuit, I used Mr. Butterworth's method ($5 says Dave inserts a comment about syrup here).

Editor's note: $10 says I don't. Just proves you can't sweet-talk me into adding editorial comments to your articles.

Usually you don't have to think about poles and zeros, since most reference books have the equations worked out for you; all you need to know is the cutoff and the quality factor you want.

If you want to know more about fil-ters, an excellent reference is An Introduc-tion to Filter Theory,. by David Johnson, Prentice-Hall,1976.

Power Supply

Figure 3 shows the power supply cir-cuit. To achieve a voltage swing between -5 V and +5 V at the input of the A/D converter, we need to reduce the ±12 volt

supplies brought out from the PC on the XB40 prototype board. To do this, use a 9.1 V zener diode on each line along with an electrolytic capacitor to smooth out the noise caused by the diode.

The diode will turn on whenever the voltage at its cathode exceeds the voltage at its anode by 9.1 V. Thus, the top diode will maintain its cathode at +9.1 volts, and the bottom diode will maintain its anode at -9.1 volts.

The 150 ohm resistors in Figure 3 are essential. Without them, the zener diodes would suck current until they fried something. These resistors also determine

11

which is more than enough.

Buying Parts

I needed to shop at two outlets to get the parts. Digi-key has the electret micro-phone and the IN4739A zener diodes.

(Digi-key also has an extensive line of re-sistors and capacitors. If you do projects like this a lot, you should look into their prepackaged assortments.) You can get their catalog by calling (800) 344-4539.

JDR Microdevices «800) 538-5000) and Jameco «415) 592-8097) both have the RC4136N quad op-amp (four amplifiers on a chip).

Types Of Capacitors

I ordered parts (from Digi-key) before I realized I didn't have the right capaci-tors in my parts cabinets. JDR (where I bought the op-amp) didn't have a great

selection of capacitors. I asked Brink if I couldn't substitute ceramic disk capaci-tors for some of the values I couldn't find in tantalum or monolithic.

He said that ceramic disk caps are the scuzziest type around and should only fin-gers and see a radical change!

There are many types of capacitors:

electrolytic, tantalum, monolithic, silver mica, ceramic disk, polyester, polypropy-lene, metalized film, etc. They vary in production cost and properties. Electro-lytic capacitors, for example, come in large values and some can handle high voltages (they're also physically large), so they're ideal for smoothing the ripples in power supplies. But they're polarized;

you get the plus lead hooked to the minus side of the supply, and poof!

Ceramic disk capacitors are cheap and good for bypassing chips (routing supply line noise to ground). But their capaci-tance isn't stable (they drift with time and temperature) so you can't use them in critical applications, such as filters.

Silver mica capacitors (they sound ones in stock, so I got smaller values and paralleled them to generate approxi-mately the right values.

Editor's note: Ceramic and electrolytic capacitors are relatively cheap. However both are unstable, capacitance-wise, and con-sidered lossy. That means that some DC frequencies, use a tantalum capacitor. If you need a capacitor for frequency (e.g., filter) ap-plications, you can use just about anything dy-namically, and talk to the AID board.

• • •

Products Mentioned Prom Kit - $179 Annabooks

12145 Alta Carmel Ct., Suite 250-262 San Diego, CA 92128

(619) 271-9526 AD1000 - $295 Real-Time Devices P.O. Box 906

State College, P A 16804 (814) 234-8087 FAX 234-6864 Advantech PCl-812 or 712E Rapid Systems Santa Qara, CA 95051

Goodbye BASIC, C, COBOL-hello PASCAL! Now, to make this most advanced language available to more micro us-ers, we've cut our price-to an amazing 529.95! This astonishing price includes the complete JRT Pascal sys-tem on diskette and the comprehensive new user manual.

Not a subset, it's a complete Pascal. Check the features.

Separate compilation of external procedures • AutD-loading • 14 digit FLOATING POINT arithmetic • True dynamic storage • Verbal

error messages • Fast one-step compiler:

no link needed • Graphing procedures • Statistics procedures • Activity analyzer prints program

use histogram • Operating system interface THIS IS THE SAME SYSTEM WE SOLD FOR 5295!

So how can we make this offer?-why the unbelievable deal? Very simply, we think all software is overpriced. We want to build volume with the booming IBM market, and our overhead is low, so we're passing the savings on to you.

AND AT NO RISK!

When you receive JRT Pascal, look it over, check it out.

If you're not completely satisfied, return the system within 30 days and your money will be refunded in full! THAT'S

Schematics prepared with OrCAD SDT OrCAD Systems Corp.

1049 SW Baseline Street, Suite 500 Hillsboro, OR 97123

(415) 592-8097 FAX 592-2503

I •

RIGHT-COMPLETE SATISFACTION GUARANTEED OR YOUR MONEY BACK!

In addition, if you want to copy the diskette or looseleaf manual-so long as it's not for resale-it's o.k. with us.

O.K. You've sold me. Send me JRT Pascal by return mail.

I understand that if I'm not complete~ satisfied, I can retum it within 30 days for a full refund.

I need 0 51/4" disk or 0 3'/2" disk. 0 Send me the JRT Pascal program formatter too, for only $14.95.

Name ________________________ _ Address _ _ _ _ _ _ _ _ _ _ _ __

City State _ _ Zip _ _

o Check/M.D. 0 COD 0 Company P.O. [add $20)

PA residents add sales tax. Add $10 for shipping outside US/Canada. US funds on a US bank only. Needs only 192K and 1 floppy drive.

L--_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ . . . .

Reader Service Number 154

MICRO CORNUCOPIA, #50, Nov-Dec, 1989 57

Dans le document The PC Video Frame (Page 57-60)

Documents relatifs