Biomedical Engineering Reference
In-Depth Information
design package such as WaveWorks' Pro to create the desired signal, and then use software
that is freely available on the Web, which can play data written in plain ASCII straight through
the PC's sound card. For example, SoundArb version 1.02 (sasetup.exe freeware for Windows
9x, NT) by David Sherman Engineering Co. is a free PC sound card signal generator program
that not only lets you select standard waveforms but also load and play arbitrary waveforms
from a text wave table
file with full control over frequency, amplitude, and trigger mode.
Updates to SoundArb, as well as more sophisticated arb software, are available from David
Sherman at www.wavebuilder.com.
The output jack of a typical sound card carries an ampli
fi
fi
ed ac-coupled signal (20 Hz
speakers with some 2 W of power. The
actual output level is uncalibrated and will depend on the settings of the volume lever
(which you can access by double-clicking the speaker icon in the Windows tray). The
only way to set the amplitude to a known voltage is by observing the waveform on an
oscilloscope. Since sound cards are meant to output sound, the volume control usually
has a limited number of discrete steps (e.g., 16) that follow a two-part piecewise-
logarithmic curve.
to 20 kHz) capable of direct driving of 8-
Converting the Sound Card into a Precision DC-Coupled Arb
Unfortunately, the typical 20-Hz high-pass cutoff
frequency of consumer-grade sound
cards makes them unsuitable for simulating most physiological signals. In addition, the
output stage of sound cards does not usually have the output linearity or passband
ff
atness
required for accurate reproduction of low-frequency signals. However, a phase-locked loop
(PLL) circuit and some software can turn a sound card into a precision dc-coupled arb. The
idea is to use a software FM modulator to turn the arbitrary signal to be generated into an
audio tone that is played through the PC sound card. The tone's frequency varies as a func-
tion of the arbitrary signal desired. The arbitrary signal is then recovered by hardware FM
demodulation of the audio signal.
Matlab has a function (vco.m) that simulates operation of a voltage-controlled oscilla-
tor, essentially an FM modulator. The following code shows how easy it is to use this func-
tion to generate an FM signal by modulating a carrier (of frequency Fc) with an arbitrary
signal contained in vector x (sampled at a rate Fs of more than twice Fc, with an ampli-
tude range of
fl
1):
Fs 5000; % Select arbitrary signal sampling frequency in Hz
Fc 1687; % Select VCO carrier frequency in Hz
moddev 40; % Percent FM frequency deviation
y vco(x, [1-moddev/100 1+moddev/100]*Fc, Fs); % VCO simulation
sound(y, Fs)
% Play modulated signal through PC sound card
You can use the following Matlab command to look at the spectrum of the FM signal that
is played through the sound card:
specgram(y, 512, Fs, kaiser(256, 5), 220)
If you are not a Matlab user, you can write a program to generate the FM signal from
the arbitrary waveform by remembering that an FM signal s ( t ) is expressed by
t
0 m (
∂τ
s ( t )
A c cos
2
π
f c t
2
π
k f
τ
)
where m ( t ) is the modulating signal (the arbitrary waveform), f c the carrier frequency, A c the
carrier amplitude, and k f de
fi
nes the frequency deviation caused by m ( t ). The instantaneous
Search WWH ::




Custom Search