This is only a preview of the August 1991 issue of Silicon Chip. You can view 41 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. Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
|
----=•
Voice Recorder
Enter the world of digitized speech with this
low-cost PC Voice Recorder. It can record
messages up to 20 seconds long, store them on
hard or floppy disc, and then replay them
when you wish.
By DARREN YATES
If you stop flying your F19 stealth
fighter and think about it for a minute,
the computer (any computer, not just
a PC!) is the most useful gadget ever
to fall into the lap of the electronics
enthusiast.
Not only can you store your latest
project on CAD, including the PC
board, but you can also write it up
and even design it on the computer
using one of the various SPICE packages that are now available. And if
you get stuck at some point, you can
go flying your Spitfire and shoot down
some ME-109s (that's known as executive stress management!).
The problem is, most of these packages (except for the games) cost an
arm and leg and are out of reach for
most hobbyists.
If you look in many of the electron-
a
AID
MIC
CONVERTER
AMPLIFIER
ics and computing magazines, the latest trend is towards talking objects;
things like talking voltmeters and talking clocks. There's even a new IC that's
just been released in the US to which
you connect a microphone, a battery
and a loudspeaker, and it will record
and replay 20 seconds of speech!
Not to be left behind in the race,
we've come up with this low-cost PC
Voice Recorder system. But unlike
most other voice synthesiser projects,
this design doesn't use any hard-toget bits. In fact, you will probably
already have most of the components
lying in your spare parts bin.
Basically, the project comes in two
parts: (1) a PC board assembly; and (2)
a floppy disc with software (see panel).
The PC board assembly provides the
interface between the speech and your
COMPUTER
DIA
CONVERTER
AMPLIFIER
Fig.1: block diagram of the PC Voice Recorder. The incoming speech signal is
picked up by a microphone, amplified, turned into digital data by an analog-todigital converter (ADC), and stored in the computer. Retrieving the audio from
the computer is just the reverse process. The digital data from the computer is
simply turned back into an analog signal by a digital-to-analog converter (DAC),
amplified and fed into the loudspeaker.
38
SILICON CHIP
computer. It takes in speech, turns it
into digital data which the computer
can use, and then later accepts that
digital data and turns it into speech
again.
The software is used to control this
process. It stores the data on either a
hard or floppy disc, retrieves it when
asked, and then feeds the digital data
to the PC board so that it can be turned
back into speech again.
Block diagram
The basics of computer stored
speech are shown in the block diagram ofFig.l.
The incoming speech (audio) signal is first turned into an electronic
signal by the microphone and then
amplified. This signal is then turned
into digital data by an analog-to-digital converter (ADC) and the data fed
into the computer.
The computer, under the control of
the software, can then process these
signals (known as Digital Signal
Processing or DSP) and store them for
later retrieval.
Retrieving the audio from the computer is just the reverse process. The
digital data from the computer is simply turned back into an analog signal
by a digital-to-analog converter (DAC),
amplified and finally fed into the loudspeaker for all to hear.
Computer limitations
Mind you, as versatile and useful
as an XT or even an AT is, there are
some very real practical limits that
have to be considered before we can
come up with a workable system.
Most of these limits revolve around
the PC itself. First, we have to con-
All the parts except for the loudspeaker & the volume control pot are mounted
on a small PC board. The unit plugs into the parallel printer port of the
computer via a DB-25 connector.
sider how we are going to get the data
into the computer.
Without worrying about expansion
sockets and whatever, virtually all PCs
come with a parallel printer socket
and a serial communications socket.
These sockets , at the back of the computer, provide easy access to these
ports without the need for internal
hardware modifications. We arbitrarily decided on the printer port.
Next, we have to consider how the
computer is goi:p.g to process and store
the data we feed in.
To keep the whole project as simple
yet as practical as possible, we limited it to using GWBASIC, which everyone has via MS-DOS. This allows everyone to use this project, whether you
have a 256Kb XT built out of spare
bits or a 16Mb 486 machine going
slightly slower than daylight.
GWBASIC though is pretty slow and
just isn't fast enough on its own to do
the job, so we used assembly language for all the really fast bits such
as receiving and transmitting data.
Storing the data is actually quite easy
and is quick - even using GWBASIC.
It's simply saved as a binary file on
either hard or floppy disc.
The next can of worms we have to
open is how to turn the analog signal
into a digital signal and back again.
If you're a bit sketchy on how analog-digital-analog conversion works ,
then take a look at the article on this
subject in next month's issue of SILICON CHIP.
The powers-that-be limited
GWBASIC to 64Kb of memory, which
leaves us with about 59Kb of free
memory by the time we get to use it.
However, to allow you to expand the
software to suit your own requirements, we've limited the data storage
for the speech to 32Kb bytes.
And that's where we strike problems. If we use standard AID techniques, an 8-bit converter will soon
chew up the limited memory we have
to play with.
Even if we limit the frequency response to 3kHz, we would have to
sample the audio at an 8kHz rate at
least to overcome aliasing problems.
Briefly, aliasing is the effect heard
when the audio mixes with the sampling frequency to produce audible
"errors" in the signal.
But sampling at 8kHz gives us just
32/8 = 4 seconds of storage - and
that's nowhere near enough!
Not only that, but the parallel
printer socket doesn't have an 8-bit
input port anyway!
Delta-sigma modulation
The alternative sampling method
used here is not widely known and is
called Delta-Sigma Modulation or
DSM. The name comes from the Greek
letters "Delta" (the symbol used for
the mathematical process called differentiation) and "Sigma" (the symbol used to denote integration).
The advantage of this system is that
it only has a 1-bit output stream, yet it
contains enough information to reproduce speech.
Fig.2 shows the circuit of an ADC
based on a simple differentiator. It
consists of an op amp, a resistor and a
capacitor. Let's see how it works.
If we assume the circuit has just
been switched on, then there will be
1·BIT
OUTPUT
R
Fig.2: basic op amp differentiator
circuit. This circuit is used for
analog to digital conversion in
the PC Voice Recorder.
Fig.3: this integrator (or low-pass
filter) circuit is used for the
reverse digital to analog to digital
conversion.
AUGUST 1991
39
~
0
+12V
~
I 47j
n
0
I
z
I
10k
f
1001<
0.1
56k
n:r:
PIN 1
-,:;
' '1
.0047!
.0047!
150k
I
I
.0047!
I
I
4.7k
1
.,,:
I
100k
sovw:r-
I
I
I
I
I
I
.0471
, --
INPUT SECTION
1 .,,:
10k
50VW!
.,.
-
/
-
-
-
-
-
-
-
-
PARALLEL PRINTER PORT -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
•
+12V
-
-
-
J
-
. - - - - - - - - - - - - +12V
I
I
I
I
I
I
PIN 140
I
-vu
H, •
)
I
! ,.,.. l ~
22k~
.001
"i#tnw
I
.0047!
...
47k
39k
7
1(".4h
PIN22+
I sv+·
I
10 .I:
16VW+
l10v
.0047+
18k
8
VOLUME~ ~~
10kVRl
LOG ~ · · .
10 ~
16VW+
10 ~
.,.
'
'
---
"( (
.,.
OUTPUT SECTION
16VW!
VM
03
BC558
.0047!
100k
10k
'
D1
1N4004
+V1N O
{ ~· }
•
1our
,~,
•
+12v
1
B
12VDC
PLUG-PACK
+
0,1J
-:-
PC VOICE RECORDER
'"~\
GND
EOc
VIEWED FROM
BELOW
.,.
.,,:
sovwI~
1son
Fig.4 (left): the complete circuit
diagram for the PC Voice Recorder.
The signals picked up by the
microphone are amplified by ICl &
fed to a 6th order low-pass
Butterworth filter (IClb, IClc & ICld).
This filter stage then drives an analogto-digital converter based on IC2,
IC3a, IC3b & Ql. On playback, the
data from the computer is fed to an
integrator, amplified & filtered by
IC4a-d, & then fed to audio amplifier
stage Q2-Q5.
no voltage across the capacitor. If we
now apply an analog voltage to the
non-inverting input, it will be higher
than the inverting input and so the
output of the op amp goes high (ie,
the op amp behaves as a comparator).
This high then charges capacitor C
via resistor R, with a time constant of
RC.
This continues until the voltage
across the capacitor is higher than the
incoming voltage, at which point the
output of the op amp goes low. This
now discharges the capacitor through
resistor R until the input voltage is
higher than that across the capacitor.
The output of the op amp then
switches high again and so the cycle
is repeated indefinitely.
You could also call this circuit a
slope detector, because it detects the
slope of the input voltage; ie, if the
input voltage is rising, the comparator output will be high. Conversely, if
the input voltage is falling, the output
will be low.
Notice we have not said anything
about exact voltage values. In fact,
there is enough information contained
in this single bit output for us to be
able to store it on disc (via the parallel
printer port), retrieve it, and convert
it bact'k into recognisable speech.
To turn the digital data back into
speech, we do the reverse mathematical process, which is known as integration. The basic circuit is shown in
Fig.3. If you think that it looks remarkably like a low-pass filter, you
are absolutely correct.
A lovy-pass filter works perfectly as
an integrator because the charging and
discharging action on the capacitor
replaces ~he slopes that were removed
in the original conversion. So this
simple low-pass filter is all we need
to perform digital to analog conversion. In fact, if you look back at the
ADC section (Fig.2), you'll see that
we had a similar low-pass filter in the
negative feedback loop of the comparator.
The circuit
Refer now to Fig.4 which shows the
complete circuit diagram of the PC
Voice Recorder. It can be split into
two sections: the input section which
converts the speech into the 1-bit data
stream; and the output section which
converts this bit stream back into
speech.
Starting at the input, the speech is
converted into electrical signals by an
electret microphone and then amplified approximately 34 times by noninverting amplifier ICla (which is part
of a TL074 quad op amp). ICla's output is then fed into a 6th order lowpass Butterworth filter with a 3dB
cutoff frequency of 3kHz (IClb, IClc
& ICld).
The idea here is to block the upper
frequencies which can cause aliasing
problems at the 18kHz clock frequency.
The 6th order low-pass filter actually consists of three cascaded 2nd
order stages formed by IClb, IClc &
ICld. The non-inverting inputs of
these stages are all biased to half supply (1/2Vcc) via a voltage divider consisting of two lOkQ resistors, which is
also used to bias ICla. With the exception of IClb, this bias voltage is
fed to each op amp via a lOOkQ resistor.
The output of the 6th order filter
appears at pin 14 ofICld and is fed to
pin 3 of op amp IC2, a TL071. This,
along with NAND gates IC3a and IC3b,
forms the delta ADC; ie, it behaves as
a differentiator. IC3a & IC3b form a
CMOS buffer which ensures that the
output of the ADC swings to both
ends of the supply rail.
Note that because of its tracking
nature, the delta ADC also oscillates
at about 18kHz. This 18kHz oscillation is later filtered out by a 6th order
filter section in the output stage.
The output of the converter appears
at pin 4 of IC3b and is fed to NPN
pull-down transistor Ql, which is connected to pin 1 of the parallel printer
port. This is the -STROBE Jine.
This simple transistor interface can
be used because those pins designated
as port C on the printer port have
4. 7kQ pull-up resistors. Thus, we can
input data without worrying about
PARTS LIST
1 PC board, code SC07107911,
132 x 82mm
1 floppy disc containing
PCVOICE software (see
panel)
1 0B25 male printer port plug
1 8Q mini loudspeaker
1 12V DC 300mA plugpack
1 electret microphone insert
1 10kn log potentiometer (VR1)
Semiconductors
2 TL074 quad op amps (IC1 ,IC4)
1 TL071 op amp (IC2)
1 4011 quad 2-input NANO gate
(IC3)
3 BC548 NPN transistors
(Q1,Q2,Q4)
2 BC558 PNP transistors
(Q3,Q5)
2 1N4004 rectifier diodes
(D1 ,D2)
Capacitors
2 100µF 25VW electrolytics
3 10µF 16VW electrolytics
5 1µF 50VW electrolytics
5 0.1 µF 63VW 5mm-pitch
polyester
1 .047µF 63VW 5mm-pitch
polyester
6 .0047µF 63VW 5mm-pitch
polyester
2 .0015µF 63VW 5mm-pitch
polyester
3 .001 µF 63VW 5mm-pitch
polyester
2 82pF 5mm-pitch ceramic
Resistors (5%, 0.25W)
1 270kn
1 18kQ
2 1S0kQ
4 1Skn
9 100kQ
4 10kQ
1 82kQ
1 5.6kQ
4 56kQ
1 4. 7kQ
1 47kn
1 1kQ
3 39kQ
2 150Q
2 27kQ
1 18Q
4 22kn
1 10n
Miscellaneous
Hookup wire, solder, zippy box
(optiorial), ribbon cable etc.
keeping to the "5V rule" of the port.
As mentioned earlier, the reverse
process is used to turn the digital data
back into speech. The output from the
computer is taken from pin 14 of the
printer port; ie, from the -AUTO FEED
AUGUST 1991
41
Fig.5: follow this wiring
diagram carefully when
installing the parts on the PC
board & take care with
component orientation. The
circuit diagram (Fig.4) shows
the pinout details for the
transistors & 3-terminal
regulators.
line. One of the normal data out lines
could have been used but this would
have necessitated switching the port
addresses.
The digital bitstream is then fed
into an 82kQ resistor and two 0.lµF
capacitors, which together form the
integrator. The signal is then amplified by a bandpass filter stage IC4a
which has a gain of 3.6 and a frequency response of 1Hz-3.3kHz, as
set by the associated l0µF and .00lµF
feedback capacitors.
The output from IC4a at pin 1 is
then fed into another 6th order lowpass Butterworth filter (IC4b-IC4d),
which is an exact copy of the circuit
used in the input stage. As before, the
filter is DC-coupled throughout and
the non-inverting inputs are all biased to 1/2Vcc. The output appears at
pin 14 of IC4d and is coupled to an
audio amplifier via a lµF capacitor
and volume control VRl.
Transistors Q2-Q5 form a fairly
standard class AB audio amplifier circuit. DC bias for Q2 is provided by the
150kQ and 270kQ resistors on its base,
while the 5.6kQ and lkQ feedback
resistors (at QZ's emitter) set the overall gain of the amplifier to 5.6. The
lµF capacitor rolls off the response
below 150Hz.
Q2 is wired as a common emitter
amplifier and also provides much of
the voltage gain. Its collector output
drives the base of Q3 which functions
as a driver stage for complementary
output pair Q4 & Q5. These transistors in turn provide the necessary current gain to drive the loudsp eaker.
Note that the bottom end of Q5's
300Q (2 x 150Q) base bias resistor has
been connected to the output rather
than to ground. Because Q5 functions
as an emitter follower, its voltage gain
is almost unity and so there is almost
no AC signal voltage across the two
150Q resistors. This means that very
little signal current flows in these two
The voice recorder
board is plugged
into the parallel
printer port of the
PC via a 3-wire
cable & a standard
DB-25 connector.
Try to keep the
cable length to less
than two metres.
42
SILICON CHIP
resistors and so the impedance of the
bias network appears to be much
higher than it really is.
This technique is known as "bootstrapping" and results in greater signal output with lower distortion.
D2 and its associated 18Q resistor
provide some forward bias to the output pair under no-signal conditions
to minimise crossover distortion. Finally, a Zobel network consisting of a
lOQ resistor and 0. lµF capacitor has
been connected across the output to
ensure amplifier stability.
Power for the circuit is derived from
a 12V DC plugpack supply. This delivers about 17V when lightly loaded
and is fed to a 7812 3-terminal regulator via reverse polarity protection diode Dl.
The resulting +12V rail from the
7812 is then used to power the various circuit stages.
Software
Once you have obtained your copy
of the software, you will need to load
your copy ofGWBASIC onto the disc. If
you have a hard disc, simply get into
your DOS directory and type:
COPY GWBASIC.EXE A:<enter>
When the file has been copied, type
A:<enter> to go back to your floppy
disc drive, then type GO<enter>.
This will automatically load in and
run PCVOICE. Once it is running, you
will see a menu on-screen asking you
to designate the drive in which you
wish to load and store your PCVOICE
files. You have the choice of either the
A, B or C drive. If you select either the
A or B drives, PCVOICE will automatically store them in the main directory.
However, if you choose the C drive,
CAPACITOR CODES
D
D
D
D
D
D
D
This photograph shows the menu screen of the PCVOICE software package. You
can select different options by pressing the spacebar & then pressing the enter
key when the option you want has been highlighted.
Value
IEC Code
0.1µF
.047µF
.0047µF
.0015µF
.001µF
82pF
100n
47n
4n7
1n5
1n
82p
EIA Code
104
473
472
152
102
82
will show up on the screen over the
first option but you can select any of
the other options simply by further
pressing the spacebar. When the bar
is over the option you wish to select,
press <enter>.
The software copyright is retained
by the author but for those who wish
to experiment further, remarks are included on the operation of the assembly language subroutines.
Construction
PCVOICE will store the files in a
subdirectory called C: \PCVOICE.
Once you have made your choice
by typing in the letter and pressing
<enter>, you will see a new menu
which asks you to choose one of six
options:
(1) record a message;
(2) load & replay a message from
the specified disc drive;
(3) replay the message just recorded;
(4) save the message in memory to
the specified disc drive;
(5) erase an existing PCVOICE file
from the specified disc drive; and
(6) quit PCVOICE.
To select one of the options, first
press the spacebar. A solid white bar
Virtually all the parts for the PC
Voice are mounted on a single PC
board. This board carril:ls the code
number SC07107911 and measures
132 x 82mm. Fig.5 shows the wiring
details.
Start construction by soldering in
PC stakes at the external wiring points,
followed by the seven wire links. This
RESISTOR COLOUR CODES
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
D
No.
1
2
9
1
4
1
3
2
4
4
4
1
1
2
Value
270kQ
150kQ
100kQ
82kQ
56kQ
47kQ
39kQ
27kQ
22kQ
18kQ
15kQ
10kQ
5.6kQ
4.7kQ
1kQ
150Q
18Q
· 10Q
4-Band Code (5%)
5-Band Code (1%)
red violet yellow gold
brown green yellow gold
brown black yellow gold
grey red orange gold
green blue orange gold
yellow violet orange gold
orange white orange gold
red violet orange gold
red red orange gold
brown grey orange gold
brown green orange gold
brown black orange gold
green blue red gold
yellow violet red gold
brown black red gold
brown green brown gold
brown grey black gold
brown black black gold
red violet black orange brown
brown green black orange brown
brown black black orange brown
grey red black red brown
green blue black red brown
yellow violet black red brown
orange white black red brown
red violet black red brown
red red black red brown
brown grey black red brown
brown green black red brown
brown black black red brown
green blue black brown brown
yellow violet black brown brown
brown black black brown brown
brown green black black brown
brown grey black gold brown
brown black black gold brown
AUGUST 1991
43
in front of the loudspeaker to allow
the sound to escape (but don't do this
with the loudspeaker in position).
Where To Buy The Software
The software for this project is only available direct from the author,
Darren Yates. The software for the PCVOICE recorder, PCVOICE .BAS, is
priced at $25 plus $3 p&p, and includes runnin~ instructions and ~II
assembly language routines. The TIME.BAS talking clock software 1s
priced at $15 plus $3 p&p.
All software comes on a single 360Kb 5 1/4-inch floppy disc and will run
on any PC with 256Kb of RAM and a printer port. Payment should be made
by cheque or postal money order to: Darren Yates, PO Box 134, French's
Forest, NSW 2086 .
Note: Copyright of the software is retained by the author.
done, install the resistors. Most of
these lay flat on the board, except for
those around the output amplifier area
which are mounted end-on to save
space.
Check each resistor on your DMM
before installing it on the board, to
make sure you have the correct value.
Next, solder in the 5mm fixed-pitch
capacitors. Check their values carefully against the wiring diagram as
they all look the same and are easy to
mix up . The electrolytics can now be
installed but make sure that they all
go in the right way around.
Now for the semiconductors. Once
again, you must make sure that they
are all correctly oriented. In particular, take care with the orientation of
the transistors in the audio amplifier
stage. Fig.4 shows their pinout details. Mount the 3-terminal regulator
with its metal tab away from D1.
Once all the parts have been installed, connect the volume pot (VRl),
microphone insert and 8Q loudspeaker to the board using suitable
lengths of hookup wire. Finally, connect a 3-wire cable between the DATA
IN, DATA OUT & GND pins on the PC
board and pins 1, 14 & 22 respectively
of a DB-25 printer plug.
It's a good idea to use different coloured leads for these connections if
you intend making up a long cable
run, as this makes the leads easier to
sort out. We used a 2-metre long cable
with the prototype, with no obvious
effect on circuit operation.
We left our board in the "barebones " state but you can mount your
version in a plastic zippy case, or
some other suitable case. The volume
control can be mounted on the front
panel along with the loudspeaker.
Don 't forget to drill a number of holes
Testing
Once you have finished construction, check the PC board carefully for
solder splashes and missed solder
joints. Check also that the correct part
has been installed at each location
and that all parts are correctly oriented.
When you're satisfied that everything is OK apply power but don't
hook the unit up to your computer
just yet. If you have a CRO handy,
take a look at the output (pin 4) of
IC3b. You should get a squarewave of
12V amplitude at about 18kHz or so.
If you don't have a CRO, use a frequency meter to check that pin 4 of
IC3b is oscillating at about 18kHz.
This frequency is not overly critical
however, and can be anywhere in the
region of 16-25kHz. If you don 't have
a frequency meter eith er, use your
DMM to check that the output of the
regulator is at +12V and that pin 4 of
IC3b sits at an average voltage of about
6V under no-signal conditions.
Applications
So what can the unit be used for?
Well, if you write your own software,
you can incorporate this project to
give your programs the added glory of
speech. For example, we wrote a program called TIME.BAS (see panel),
which turns the PCVOICE board into
a talking clock. It 's similar to the talking clock
serv ice provided by
....--.......... SC0? 107911~ Telecom, although the
voice on our unit is nowhere near as refined.
Other possible applications are to use the unit as
a household message machine, as a sales gimmick
or just for experiment. It's
limited only by your imagination.
SC
o,,ci,-o.,u ,.....0~o-o-o-od11h
1111111
:SI
~\.-=--__,--,--- s
1
44
SIUCO,\J CHIP
o-:
Fig.6: use this full-size
pattern to make your own
PC board or to check that
a commercially made
board has been correctly
etched.
|