Biomedical Engineering Reference
In-Depth Information
Converting the Sound Card into a Precision DC-Coupled A/D
Sound cards su
er serious limitations when used for acquiring physiological signals; for
one, typical PC sound cards are ac coupled through series capacitors on the signal path.
Typical high-pass cutoff
ff
frequencies are above 20 Hz, making it impossible to record wave-
forms containing dc or low-frequency components, a characteristic shared by most biopo-
tential and physiological signals. Furthermore, consumer-grade sound cards often exhibit
poor sound-recording quality characteristics, especially a lack of passband
ff
fl
atness and
harmonic generation, which results in signal distortion.
However, a voltage-controlled oscillator (VCO) and some software can turn a sound
card into a precision dc-coupled A/D. The VCO of Figure 5.13 generates an audio tone
that varies in frequency as a function of a control signal input. The VCO's output is a
whistling sound that is easily recorded even with low-end sound cards. The original sig-
nal is then recovered by software FM demodulation of the VCO audio recorded. IC3 is
an Exar XR-2206 function generator that implements the VCO. The carrier frequency (in
hertz) is given by 1/(R13
R14)C4. Good performance is achieved with most sound
cards by setting the carrier frequency somewhere in the range 2 to 10 kHz. The frequency
of oscillation is modulated by applying a control current in the
3 mA range to pin 7,
which is biased within the XR-2206 at
set voltage of IC2A such
that zero control voltage applied to IC2B results in zero current across R15 and R18. R18
adjusts the modulation level (frequency deviation per volt). A good range for most sound
cards is around
3 V. R16 sets the o
ff
80% of the carrier for the full-control voltage input range. The sound
card sampling rate should be selected to be at least
fi
five times higher than the highest VCO
frequency expected.
R6 and R7 are used to trim the harmonic distortion of IC3's sinusoidal output. The
unadjusted distortion is speci
2.5%, so R4, R6, R7, and R9 are optional. R3
should be adjusted together with the sound card's slider volume control to produce a
clean-sounding tone. Please note that the stability of the VCO circuit depends on the
stability of the frequency-setting components. Proper performance requires the use of
low-temperature-coe
fi
ed to be
cient, high-tolerance components. Resistors should be precision
1% tolerance type of the RN60D variety. Capacitors should be Mylar, polyester
film,
or other types that remain stable with age and which are not sensitive to temperature
variations.
The following Matlab code shows how easy it is to obtain digitized data (vector x) from
the VCO audio (vector y):
fi
Fc 2144; % Select VCO carrier frequency
vcok 0.176; % Select VCO constant
Fs 40000; % Select sound card sampling frequency
samptime 3; % Select sampling time (in seconds)
y wavrecord(samptime*Fs, Fs, 'double'); % Sample sound into y
wavplay(y, Fs); % Play the recorded sound
x (demod(y,Fc,Fs,'fm',vcok)); % FM demodulate the sound
cutoff 100/(Fs/2); % Cutoff frequency for post-demodulator low-pass filter
in radians/s is desired cutoff/(1/2 sampling frequency)
[b,a] butter(4,cutoff); % Design Butterworth low-pass filter
xfilt filter(b,a,x); % Filter demodulated signal
time 1/Fs:(1/Fs):samptime; % Generate time vector
plot(time,xfilt) % Plot filtered data vs time
grid % Overlay grid on plot
xlabel('time [s]') % Label x axis
ylabel('Input [Volts]') % Label y axis
Search WWH ::




Custom Search