This is only a preview of the August 2002 issue of Silicon Chip. You can view 24 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Digital Storage Logic Probe":
Items relevant to "A Digital Thermometer/Thermostat":
Items relevant to "Sound Card Interface For PC Test Instruments":
Items relevant to "Direct Conversion Receiver For Radio Amateurs; Pt.2":
Purchase a printed copy of this issue for $10.00. |
By PETER SMITH
Any PC with a sound card can
function as a digital oscilloscope,
spectrum analyser, voltmeter and
signal generator. It’s just a matter
of installing the right software,
much of which can be downloaded for free or at low cost from the
Internet.
E
LSEWHERE IN THIS ISSUE, we describe a simple
adapter that provides a safe and easy way of
connecting test probes to your sound card. Below
we introduce some of the important principles of sound
card-based digital instrumentation and follow up with
a quick rundown on some of the more popular software
packages that are available.
Digital instrument basics
Digital instruments have many advantages over their
analog cousins. Take the oscilloscope, for example. Digital ’scopes can store waveforms in memory or on disk for
www.siliconchip.com.au
comparison with “live” waveforms, or play them back at a
later time for detailed examination. And once a waveform
is stored digitally, it is easily manipulated (level-shifted,
filtered, transformed to the frequency domain, etc) for
display in a variety of formats.
The downside is that digital instruments are often
expensive, standalone devices with a CRT or LCD display,
multiple CPUs and complex data capture electronics.
However, much cheaper solutions based on the PC platform are now readily available. These utilise the existing
processing power and graphics capabilities built into all
PCs, thereby greatly reducing costs.
PC-based solutions range from small external data
acquisition pods (we reviewed such a device in the June
2000 issue) through to add-on cards that plug into a free
expansion slot. These are cheap by comparison to the
standalone devices but still too costly for those of us on
tight budgets.
PC sound card
The simplest and cheapest solution utilises hardware
that already exists in all multimedia PCs – the sound
card. It might seem unusual that a PC sound card could
be used as the basis of any data acquisition system. However, one of the main components of all sound cards is an
analog-to-digital (A-D) converter, a core function of even
August 2002 7
amplitude of that signal. The digital values are then
processed by software to drive on-screen voltmeter
displays or to plot waveforms on an oscilloscope X-Y
grid.
Let’s look at some of the more important aspects of
the analog-to-digital conversion process in a little more
detail.
Resolution
Fig.1: Oscilloscope 2.51 uses large vertical sliders for
programming the sweep, gain, trigger level and delay
settings for both channels.
A-D converter resolution is characterised by the number of digital bits that it takes to represent the results
of a conversion. Older sound cards, such as the classic
SoundBlaster 2.0 and SoundBlaster Pro, have only 8-bit
resolution. All recent PC sound cards have 16-bit (or
higher) resolution, which equates to 216 (65,536) possible
discrete values.
To make some sense of this, we need to know the upper
and lower limits of the voltage that can be sampled by
the converter. Sound cards typically have a 0-2V input
span. Applying some simple maths, we find that 2V divided by 65,536 gives 30.5µV – a respectably small slice
indeed.
Bandwidth
Fig.2: real-time signal spectra can be examined in FFT
(Fast Fourier Transform) display mode. In this shot,
Oscilloscope 2.51 plots a simple 4kHz square wave (the
large spike) and its harmonics.
Fig.3: many ’scopes support an X-Y mode, where the
amplitude of the second channel is plotted against the
amplitude of the first. Here we’re using Oscilloscope
2.51’s delayed sweep function and X-Y mode to get a
new perspective on our measurements!
the most expensive digital instruments.
In simple terms, the A-D converter’s job is to periodically sample the incoming analog signal and come up
with a digital value that represents the instantaneous
8 Silicon Chip
Equally important as the signal amplitude is its frequency. Sound card converters operate at a known
(programmable) sampling period under control of a
crystal-locked clock. All this means is that each conversion cycle occupies a precise period, easily measured and manipulated by software to glean the signal
frequency.
Naturally, the faster the input signal can be sampled,
the more accurate the displayed result. Imagine, for example, a sinewave signal with a period of 100µs. If the A-D
converter samples at, say, 20µs intervals, then what you
would see on an oscilloscope display wouldn’t look much
like a sinewave. Instead, it would look like an ascending
and descending “staircase”.
It follows that the faster the signal is sampled, the
smaller the steps will be and the less visible the staircase
effect. When the sampling rate is much higher than the
signal frequency, software interpolation removes virtually all traces of this “digitisation” and the waveform
looks much the same as it would on a traditional analog
scope.
Apart from affecting how waveforms appear on an
oscilloscope display, the sampling frequency is important for another reason. It must always be at least twice
the frequency of the signal being measured, otherwise a
problem called “aliasing” occurs (see Fig.12). Most sound
cards have a maximum sampling rate of 44kHz, so the
highest frequency you can expect to measure accurately
is 22kHz.
The minimum frequency that can be measured is
about 20Hz, due to AC-coupling at the sound card
inputs and a high-pass filter in the A-D block. This
can be an annoying limitation when the signals
you’re measuring contain a DC component but a good
multimeter will usually fill in the gaps.
Storage
As each A-D conversion is completed, software reads
the result and stores it sequentially in a block of memory
www.siliconchip.com.au
Fig.4: this view shows TrueRTA’s oscilloscope and signal
generator. The signal generator and righthand toolbar can
be detached from the main display if required.
(or “storage buffer”). As mentioned above, each cycle occupies a precise period, so the storage locations also act as
time markers. Once the buffer is full, oscilloscope software
can be used to read the contents and plot the traditional
amplitude versus time waveforms.
Of course, this is a very simplified description of the
process. Depending on the particular software and the
active instrument, mathematical calculations may need
to be performed on all or part of the buffer contents
before the results can be displayed in the appropriate
format. For example, voltmeter software might need to
extract average, crest factor and RMS values from the
raw data.
Triggering
The storage buffer is in effect “circular”. Once full, old
data is overwritten with new as the entire cycle repeats.
However, although the A-D converter may be sampling
and converting at full speed (called “free-running”), the
software does not neces
sarily immediately write the
results to the buffer. Rather, it monitors the incoming
data for predefined trigger conditions. On most sound
card-based software, the triggers are programmable to
specific voltage levels – either positive (rising) or negative (falling).
Without some means of synchronising the signal with
the beginning of the buffer, even simple waveforms would
be impossible to comprehend on an oscilloscope; they
Fig.6: the “front panel” of Osci – it’s almost as easy to use
as rotary dials and switches!
www.siliconchip.com.au
Fig.5: plot of a 2kHz square-wave on TrueRTA’s spectrum
analyser. This is the “level 3” version of the product,
which allows up to 60 frequency bars (1/6 octave) across
the horizontal axis. Display update speed can be traded off
with accuracy to suit the speed of your hardware – necessary because this analyser is a real CPU hog.
would appear to jitter and jump across the horizontal axis.
In fact, most digital instruments need reliable triggering
in order to make accurate measurements.
For greater versatility, many digital ’scopes provide a
variable pre-trigger (or “delay”) time. This simply means
that a certain number of samples are written to the buffer
before the trigger condition is met.
Generating output
So far, we’ve only talked about instruments that utilise sound card inputs. Not surprisingly, a good deal of
software is available that makes use of the outputs as
well.
In operation, an analog output voltage is generated by
the sound card’s digital-to-analog (D-A) converter. Software
feeds a stream of 16-bit digital data into the D-A block,
where it’s converted to analog, filtered and then amplified
before appearing on the card’s output sockets. As you can
see, this process is similar to the signal input side, except
in reverse!
Digital signal generators are the most-used output
Fig.7: Osci’s waveform display can be dragged away from
the main window and resized as required. The dark lines
on the display are measurement cursors that we used to
determine the frequency and amplitude of the sinewave.
August 2002 9
What’s A Spectrum Analyser?
Most of our readers will already
be familiar with the oscilloscope.
These instruments display signals
in the time domain. The horizontal
axis is graduated in time and the
vertical in amplitude. This format
is ideal for determining time, phase
and amplitude information.
On the other hand, spectrum
analysers display signals in the
frequency domain. Frequency is
displayed on the horizontal scale,
and is divided into bands, or octaves. The lower frequency bands
are on the left, with progressively
higher frequency bands to the
right. The scale is logarithmic,
such that each octave or fractional
octave is equal in width. The amplitude of the signal is displayed
on the vertical axis, which is graduated in decibels.
A spectrum analyser enables us
to see certain information that is
just not visible in the time domain.
For example, a sinewave may look
good in the time domain but show
visible distortion in the frequency
domain. Also, a noise signal may
look totally random in the time domain but in the frequency domain
one frequency may be dominantly
present.
In audio frequency work, the
spectrum analyser is commonly
used to measure signal-to-noise
instruments. Together with the instruments we mentioned
earlier, they provide a convenient means of analysing a
host of analog circuitry. Just like their analog counterparts,
digital signal generators provide the usual sinewave and
square-wave outputs with programmable frequencies
and amplitudes. Some even include sweep generators
and noise sources for frequency response and distortion
analysis.
The software
OK, now that you’re familiar with some of the basic
terms, let’s examine a few of the more popular digital
instrument packages that are available on the Internet.
We have selected five quite different software packages
that we think demonstrate the capabilities of sound cardbased instrumentation quite well. These are all listed in
Table 1, along with the links to their download sites. Some
are free for non-commercial use, while others are offered
on a shareware basis.
Many more are available – too many for us to seriously
evaluate here. Our advice is to shop around and be sure to
“try before you buy”! For additional software, point your
browser to www.google.com and search for sound card
oscilloscope software.
Oscilloscope 2.51
The first package we examined is titled simply “Oscillo
scope 2.51”. It runs on Windows 95 & 98 (a Windows
3.1 version is also available) and requires only an 80486
processor and an 8-bit sound card. In common with most
packages, it includes a dual-trace storage ’scope, as well
as a real-time spectrum analyser.
All major functions are controlled via a series of “clickand-drag” sliders on the righthand side of the display (see
Fig.1). Vertical trace position, gain, and trigger level are
all independently programmable for left (Y1) and right
(Y2) channels.
In single trace (YT) mode, two trigger delay sliders
pro
vide coarse and fine adjustment of the amount of
10 Silicon Chip
ratio, distortion, intermodula
tion distortion and frequency
response.
A mathematical process called
Fast Fourier Transforms (FFTs)
is used to convert signal information from the time domain to
the frequency domain. To complicate matters further, analyser
software often includes several
complementary FFT “windowing”
functions. Unfortunately, a detailed
explanation of windowing, or FFTs
for that matter, is well beyond the
scope of this article. However,
plenty of information on the subject is available on the Internet and
in printed form.
pre-trigger data written to the buffer. In dual trace and
X-Y mode, these sliders vary the time delay between the
Y1 and Y2 channels.
The gain settings control software gain only; hardware
gain must be varied via the Windows audio mixer software. In addition, the product of the left and right sliders
is used to determine gain when in spectrum analyser
mode. This provides a convenient, faster-than-linear
adjustment rate.
The sampling rate can be set to 11.025kHz, 22.05kHz or
44.1kHz. On all but the slowest (486) hardware, it makes
sense to sample at the maximum supported frequency
for best accuracy. The buffer (and hence display) refresh
rate can be programmed to any realistic value, with the
default of 330ms being too slow for smooth updates.
High-performance PCs will support a much faster rate
than this.
Frequency measurements are made by left and
right-clicking on the oscilloscope display. Oscilloscope
2.51 measures the period between the selected points and
displays the result on the status line. In Spectrum Analyser
mode, it’s only a matter of running the mouse over the
area of interest, as the frequency of the plot at the cursor
position is displayed in real time.
A snapshot of the buffer can be saved to disk as an ASCII
file for use by other CAD packages. Of course, you can
also cut and paste the 8 x 10 graticule display into your
favourite graphics program for documentation purposes
as needed.
All up, this tidy little package uses few resources but
offers a lot. However, it lacks a means of calibrating the
input signal levels, so all amplitude measurements should
be considered relative rather than true.
TrueRTA
TrueRTA (Real Time Audio Spectrum Analyser) is a
complete suite of audio test instruments. The latest release (V2.0 as we write) is available in four distinct levels.
The levels differ in functionality and price, with level 1
www.siliconchip.com.au
Fig.9: if you need
a simple no-cost
generator, check
out SoundArb. You
can even roll your
own waveforms!
Fig.8: WaveGen can generate just about any
waveform you care to name. Digital signal
generators are quite frequency-accurate but
distortion at the high and low ends of the
scale must be considered.
available free of charge.
TrueRTA runs on all 32-bit versions of Windows and requires a Pentium 200 (or equivalent) processor with 64MB
of RAM and a 16-bit sound card as a minimum. Included
in the package is a spectrum analyser, oscilloscope, digital
multimeter and signal generator.
This package is aimed squarely at the audio test and
development area. The built-in signal generator (with
digital sweep function) and the spectrum analyser enable
quick evaluation of audio circuit performance. In addition, support is provided for a calibrated microphone
input, enabling loudspeaker and acoustic environment
testing.
As with most packages, the input sampling rate can be
set to any one of the standard sound card values between
8kHz and 48kHz.
User controls are intelligently arranged and clearly
labelled (see Fig.4) and the instruments are dead easy
to drive. You simply select between the oscilloscope or
spectrum analyser instruments and then fine-tune the
settings using buttons and drop-down menus on a detachable toolbar.
The digital ’scope provides both single (left or right
channel) and dual-trace (left & right channel) modes, as
well as channel addition and subtraction. The horizontal
axis can be programmed from .05ms to 200ms per division, while the vertical axis ranges from a low 100µV
per division right up to 5V per division. The ranges are
variable in the traditional 1-2-5 steps via rows of buttons
on the toolbar.
The digital voltmeter displays the RMS value of the
reference channel in the top left corner of the graticule.
If you decide to purchase one of the higher-level versions, you get additional voltmeter readouts of dBu,
crest factor in dB (ratio of peak to RMS level) and crest
factor in mV/V.
The reference channel, by the way, is the one that
you select as the trigger source. Triggering is automatic
– no provision has been made for varying the level or
polarity.
A single click on the toolbar switches to spectrum
analyser mode (see Fig.5). The graticule is now displayed
in logarithmic format – the vertical axis in dB and the
horizontal axis in bands of frequencies. The free version
of the software provides only a single octave across the
horizontal, which equates to 10 bands (or bars) in the
10Hz-22kHz spectrum. Pay money, and you can select
from 1/3, 1/6, 1/12 or 1/24 octave (30, 60, 120 or 240
bar) displays.
The horizontal scale can be expanded for detailed
examination of a particular frequency range by modifying
the upper and lower frequency limits. Similarly, vertical
scale limits can be adjusted to zoom in on an area of
interest.
TrueRTA’s signal generator includes both sinewave
and pink noise output. The output level is variable
MORE FROM YOUR EFI CAR!
Own an EFI car? Want to get the
best from it? You’ll find all you
need to know in this publication
Making Your EFI Car Go Harder Building A Mixture Meter D-I-Y
Head Jobs Fault Finding EFI Systems $70 Boost Control For 23% More
Grunt All About Engine Management Modifying Engine Management
Systems Water/Air Intercooling How To Use A Multimeter Wiring
An Engine Transplant And Much More Including Some Awesome Engines!
AVAILABLE DIRECT FROM SILICON CHIP PUBLICATIONS
PO BOX 139, COLLAROY NSW 2097 - $8.95 Inc P&P
To order your copy, call (02) 9979 5644 9-5 Mon-Fri with your credit card details!
www.siliconchip.com.au
August 2002 11
over the entire range of the
sound card’s D-A circuitry
and the sinewave frequency
is variable from 5Hz to 24kHz.
Higher-level versions of the
product include a logarithmic
sine sweep function for more
accurate frequency response
measurements.
Unlike the previous package,
this one includes comprehen
sive calibration features. The
Fig.10: if you want to do serious work
Fig.11: AudioTester’s spectrum analyser
professional version (level
in the audio spectrum, AudioTester
is a dual-channel affair, allowing direct
4) even includes a feature to
offers a comprehensive range of FFT
comparison between reference and test
functions.
signals.
remove the “coloration” that
sound cards inevitably add to
Trigger levels are independently programmable for
your distortion and frequency
channel 1 (left) and channel 2 (right) via vertical sliders
response measurements.
and can be of either positive or negative polarity. Auto
As this package focuses on the real-time aspect of
triggering is also provided, as is variable trigger delay and
audio work, it does not have a number of features that
a single sweep mode.
are handy for general electronics bench work, such as
Left and right channels can be added, subtracted and/
moveable measurement cursors, triggering options and
or inverted. The inversion function could be handy if you
storage capabilities.
have a sound card that inverts input signals (don’t laugh,
Osci
we’ve heard of some that do!).
Waveforms are displayed on a standard 8 x 10 gratiThis is one of the best of the low-cost digital ’scopes
cule that can be detached from the main window and
that we’ve seen. Although the shareware version is not
resized to suit your needs (see Fig.7). Optionally, the
crippled in any way, it does have a maximum use period
X and Y-axis settings can be displayed right on the
of 15 minutes. Once this expires, the program terminates
graticule – a very handy feature for documentation
and you need to relaunch it. Of course, if you like the
purposes.
product, you can license it for a nominal fee and get rid
Osci’s display can be printed on demand or copied to
of this annoyance.
the Windows clipboard for pasting into your favourite
Osci runs on Windows 95, 98 and NT4 and requires at
application. In addition, the buffer contents can be saved
least a Pentium 266 with 32MB of RAM and a 16-bit sound
as an ASCII file for use in other programs.
card. If you want to run a signal generator in parallel with
The storage buffer generally holds more than can
the ’scope, your sound card and its driver software must
be dis
played on-screen at one time, so a horizontal
support “full-duplex” mode. This applies to all packages,
scroll bar at the bottom of the display allows quick
by the way, not just Osci.
panning from buffer beginning to end. A nearby “x10
All sound card sample rates up to 96kHz are accomMag” button allows you to instantly zoom into areas of
modated, as is 24-bit resolution for those cards that
interest.
support it. In addition, Osci supports up to three sound
Getting accurate waveform measurements is easy with
cards, so you don’t need to dismantle your existing audio
this package. Click on the start point with your left mouse
setup.
button, drag the horizontal and vertical rulers that appear
The Osci user interface is uncomplicated and easy to
to the end point and release, and hey-presto – the period,
drive (see Fig.6). Vertical (Y) axis settings are variable from
frequency and amplitude of the bounded area appear as
100µV per division up to 2V per division, while horizontal
if by magic!
(X) axis (or “timebase”) settings are variable from 20µs to
Finally, all your settings can be saved as “presets” for
200ms per division in the usual 1-2-5 steps.
quick restoration later.
Table 1: PC Instrumentation Software
Package
Licence
Download Link
Oscilloscope 2.51
Freeware
polly.phys.msu.su/~zeld/
osci ll.html
True RTA
Level 1 is free, Levels 2-4 are
acti vated on purchase
www.trueaudi o.com
Osci, WaveGen, AudioTester Shareware (30-day eval uation)
www.sumuller.de/audiotester
SoundArb
Freeware
Analyzer 2000
Shareware (30-day eval uation)
www.brownbear.de
Freeware
hel iso.tripod.com/download/
download.htm
Digital Sound Generator
12 Silicon Chip
www.wavebuilder.com
WaveGen
WaveGen is a comprehensive
standalone signal generator. Tone,
impulse and sweep generators are
all included and accessible from the
front panel. WaveGen can be used
in conjunction with Osci (they’re
from the same author), so system
requirements are the same for both
packages.
The maximum D-A conversion
rate of the sound card determines
the highest output frequency. For a
www.siliconchip.com.au
typical 48kHz card, the highest frequency will be 24kHz.
The minimum frequency is listed as 0.1Hz but this seems
a bit optimistic as it dips well under the lower frequency
limit of around 20Hz for most sound cards. Generator
frequency can be programmed in 0.1Hz, 10Hz and 1kHz
increments.
As you can see from Fig.8, all the usual waveform types
can be generated. In addition, WaveGen will play back any
user-defined WAV file.
Output levels can be adjusted with either “analog” or
“digital” control buttons. As far as we could determine
from the documentation, the 0dB to -96dB digital level
adjustment is software-based, whereas the 0dB to -48dB
analog adjustment controls the Windows mixer.
No calibration is provided for the line output socket.
Instead, when using WaveGen for frequency response and
distortion measurements, the documentation suggests that
you feed the right line output directly back to the left line
input, so creating a “reference” channel.
The right output also connects to the input of the circuit
under test, while the output of the circuit under test is con
nected back to right line input. This method allows you
to compare the differences in the two waveforms on an
oscilloscope or spectrum analyser display. The spectrum
analyser instrument in AudioTester (which we mention
below) expects this connection and can automatically
compensate for sound card amplitude and fre
quency
response characteristics.
Virtually all generator parameters can be configured via
setup buttons on the front panel. We won’t bore you with
all the details here. Instead, why not download WaveGen
and check them out for yourself!
SoundArb
This is a no-frills, easy-to-drive signal generator. It runs
on Windows 95 and above, requires a 16-bit sound card
and only minimal PC hardware – and it’s free!
A shot of SoundArb’s super-simple front panel is shown
in Fig.9. Sine, square, triangle, sawtooth and white noise
wave
forms can all be generated, as can user-defined
arbitrary waveforms. These are loaded from a simple
ASCII file, which can be manually created or generated
by software.
Normally, SoundArb outputs the selected waveform
on both the left and right channels. Optionally, a synchronisation signal can be output on the right channel
Fig.12: the A-D converter must sample the input signal at least twice as fast as its frequency otherwise
“aliasing” results. Here, the input signal (shown in red)
would need to be sampled at least twice each period
but instead it’s sampled only once every 2/3 period.
Therefore, the frequency of the signal is erroneously
calculated to be much lower than it really is (as shown
in green).
instead by choosing the “Right channel sync” option.
The output amplitude is set by a horizontal slider and
is uncalibrated.
SoundArb provides simple triggering options and these
include “Free run”, “One-shot” and “Burst”. The burst
mode length is programmable in cycles.
AudioTester
AudioTester boasts just about every feature imaginable. Like TrueRTA, it includes an oscilloscope, spectrum
analyser and signal generator but lacks a separate voltmeter.
We’ve mentioned this package only because it originates
from the same author as Osci and WaveGen. These two
standalone instruments are apparently intended to replace
the oscilloscope and signal generator that are part of the
AudioTester suite. To date, the author has not released a
standalone version of the spectrum analyser, so AudioTester is still available to fill in the gaps.
Like Osci and WaveGen, the spectrum analyser in
AudioTester is packed with features. We’ve run out
of space to describe them here but we’ve included
a couple of screen shots (Figs.11 & 12) to whet your
SC
appetite!
UM66 SERIES TO-92
SOUND GENERATOR.
THESE LOW COST IC’S
ARE USED IN MANY TOYS,
DOORBELLS AND NOVELTY
APPLICATIONS
1-9
$1.10
10-24 $0.99
25+
$0.88
www.siliconchip.com.au
August 2002 13
|