This is only a preview of the March 1999 issue of Silicon Chip. You can view 34 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:
Items relevant to "Simple DIY PIC Programmer":
Articles in this series:
Items relevant to "Easy-To-Build Audio Compressor":
Items relevant to "Low Distortion Audio Signal Generator; Pt.2":
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
1-Chip Microphone
Audio Compressor
This simple project can be used for a number
of audio effects, including compression,
automatic level control, sustain and limiting.
It can be used with a guitar, microphone or
any other low-level signal source.
By JOHN CLARKE
Many audio enthusiasts would
argue that a signal shouldn’t be altered in any way from its original
source, whether it is from a guitar,
a microphone or any other source.
However, in many cases it is necessary
to change the signal so as to provide
the very best intelligibility or simply
to produce a sound effect to add life
to a musical score.
A microphone in a PA setup, for example, can be called upon to respond
56 Silicon Chip
to a huge variation in sound levels. At
one extreme, you have people who
speak very softly at some distance
from the microphone while at the
other you have people who speak very
loudly and get quite close to the microphone. This means that some type
of automatic level control is necessary
to maintain a relatively constant audio
output level, regardless of the volume
from the person speaking.
Generally, this automatic control
takes the form of signal compression,
whereby the lows are made louder
and the highs are made softer. Set
correctly, signal compression can
greatly increase the intelligibility of
the amplified signal. In many cases,
it may even be necessary to prevent
severe signal overload (and the high
distortion that results).
As well as signal compression, this
unit can be used for other special
effects. Guitarists, in particular, are
always keen to add effects to their
music – the more controls and adjustments the better, it seems.
To this end, we have designed a
versatile compression unit which has
controls to allow for adjustment of
the major parameters. This includes
the amount of compression, ranging
from 1:1 where there is no effect on
the signal up to a 15:1 compression.
The threshold and limiting signal
MAIN FEATURES
• Low noise
• Low distortion
• Adjustable compression
ratio
•
Adjustable limiting level for
large signal clamping
•
Adjustable minimum level
for compression
•
•
•
•
Adjustable gain
Adjustable output level
Signal bypass switching
Facility for electret microphone supply
level positions are also adjustable and
there is an overall gain control facility.
So the four controls, from left to
right, are: (1) Gain; (2) Threshold; (3)
Compression Ratio; and (4) Limit.
The compression setting produces
a range of effects on the signal. Low
compression settings, ranging from
say 2:1 to 5:1, will restrict the dynamic
range of the signal but there will still
be some variation in volume. This
effect is usually called “compression”
or “dynamic range control”.
Higher compression ratios will produce a sound level that’s reasonably
constant, regardless of the input level.
This effect is called “automatic level
control” or “sustain”.
The Limit control effectively produces a constant output level even
if the input level is increasing. It is
useful for preventing excessive noise
levels from being amplified, as can
occur if a microphone or a guitar is
dropped.
The Threshold control operates at
the other signal level extreme and
prevents compression from occurring
below a preset input level. This reduces noise and hum on the output when
little or no signal is present.
Finally, the Gain control allows
a wide range of signal levels to be
tailored to the compressor circuit. It
can provide extra gain, ranging from
0dB (x1) up to 20dB (x100).
Fig.1 shows the response of the
compressor for different compression
ratios. Below the noise gate threshold,
the signal is “downward expanded”,
which means that the signal is attenu-
Fig.1: this graph shows the response of the compressor for different
compression ratios. The limiting threshold is adjustable and sets the
point where compression ceases and limiting occurs
Fig.2: block diagram of the SSM2166 preamplifier/compressor IC.
The buffer stage accepts the input signal and in turn applies a sample
signal to the level detector. The level detector then produces a DC
voltage output and this controls the internal voltage controlled
amplifier (VCA).
ated below its normal level. The noise
gate threshold is adjustable and above
this is the compression region.
Note that you can adjust the
compression between the ex
tremes
shown (from 1:1 to 15:1). The limiting
threshold is also adjustable and sets
the point where compression ceases
and limiting occurs. Any gain added
to the compressor simply shifts the
graph upwards by the gain value.
Block diagram
Fig.2 shows the block diagram
for the Microphone Compressor. It’s
based on a single SSM2166 preamplifier/compressor IC which includes
a buffer, a level detector, a control
circuit and a voltage controlled amplifier (VCA). The buffer stage accepts
the input signal and in turn applies
a sample signal to the level detector.
The level detector then produces a DC
voltage output that follows the buffer
output signal.
The output from the level detector
charges an “average” capacitor which
is connected to pin 8 and this in turn
sets the voltage applied to the control
circuit. Note that the value of the
MARCH 1999 57
Fig.3: the complete circuit for the microphone compressor. R1 is only necessary
if an electret microphone is to be used, while C1 should be 22µF for voice
signals and 2.2µF for music signals (eg, from a guitar).
“average” capacitor sets the attack
and decay times for the compression
response.
Finally, the control circuit has
facilities to allow adjustment of the
three affects parameters – ie, the compression ratio, the rotation point (or
limit) and the noise gate threshold.
Its output in turn controls the voltage
controlled amplifier (VCA), which ad-
justs its gain accordingly. In addition,
the VCA is fitted with a separate gain
control facility, so that its overall gain
can be adjusted.
Circuit details
Refer now to Fig.3 for the full circuit
details of the Microphone Compressor. Apart from the SSM2166 preamplifier/compressor, it consists of four
Specifications
Gain control
Anticlockwise 0dB; mid-setting 10dB; clockwise 20dB
Threshold control at 0dB gain
Anticlockwise at noise floor; mid-setting 0.2mV; clockwise 30mV
Ratio control
Anticlockwise 1:1; mid-setting 7:1; clockwise 15:1
Limit control at 0dB gain 1:1 ratio
Clockwise 600mV; mid-setting 10mV
Total Harmonic Distortion at minimum gain before limiting
0.16% at 1kHz and 200mV input; 1.2% at 10kHz and 200mV input; 0.32% at
1kHz and 200mV input; 3% at 10kHz and 500mV input
Frequency response
-3dB at 30Hz and -1dB at 30kHz
Signal-to-noise ratio with respect to 300mV, input threshold anticlockwise
1:1 ratio and 600mV limit: 75dB with 20Hz to 20kHz filter, 78dB A-weighted. 15:1
ratio: 60dB with 20Hz to 20kHz filter, 64dB A-weighted
58 Silicon Chip
pots, a couple of 6.35mm jack sockets
and a handful of minor parts.
The input signal is fed in via a jack
socket and applied to the pin 7 input
(Buffer In) of IC1 via a 0.1µF capacitor.
Resistor R1 (2.2kΩ) is included to provide for an electret microphone input
(an electret microphone requires a
bias current in order to function).
The buffer amplifier has a gain of
-1, as set by two 10kΩ feedback resistors. One of these resistors is connected between pins 5 & 6 (ie, between
the buffer amplifier output and its
inverting input), while the other is
connected between ground and the
inverting input via a series 1µF capacitor. This 1µF capacitor provides
low-frequency rolloff below 16Hz.
Different values are used for the
“average” capacitor at the output for
the level detector (pin 8), depending
on whether the circuit is to be used
for speech signals or music signals.
If the circuit is used predominantly
for speech signals, a value of 22µF is
used. Conversely, if the circuit is used
mainly for music signals, a value of
2.2µF is best.
If the circuit is to be used for both
music and speech on a regular basis,
you can add a switch to select between
two different capacitors.
Potentiometer VR1 sets the VCA
gain, while VR3 between pin 10 and
ground sets the compression ratio.
Similarly, VR2 sets the noise gate
threshold, while VR4 sets the limit.
The output from the VCA appears
at pin 13 and is fed to the output
socket via VR5, a 1µF capacitor and
switch S1. S1 is a bypass switch – it
simply switches the compressor circuit in or out of circuit. In the OUT
position, the signal at the input is fed
straight through to the output socket,
bypassing IC1.
VR5 is a level control. This trimpot is adjusted during the setting up
procedure so that the output from the
compressor matches the sensitivity of
the amplifier that’s being used.
Power for the circuit is derived from
a 12V DC supply (eg, a plugpack or a
battery). Diode D1 provides reverse
polarity protection, while the 470µF
capacitor provides filtering of the
supply line. Regulator REG1 then
provides a 5V rail for IC1, while LED1
is the power indicator.
Construction
Building it is easy since all the
parts are mounted on a PC board
coded 01303991 and measuring 104
x 57mm. Note that IC1 is available
in two versions – either as a normal
14-pin DIP IC or in a surface-mount
package. In the latter case, a second
small PC board (coded S0-14) is required to mount the IC. This board is
then mounted on the main board in
the normal IC position (see photo).
This technique allows the main
board to accommodate both versions
of the IC.
Start the construction by checking
the PC board against the published
pattern. Repair any broken tracks or
shorts that may be evident. If you
have the surface-mount version of
IC1, this can now be mounted on the
small S0-14 board using a fine-tipped
soldering bit.
You will need keen eyesight and
preferably a magnifying lamp for this
job. To mount the IC, position it so that
Fig.4: install the parts on the PC board and complete the wiring as shown here.
The bypass switch (S1) is optional and can be left out if not required. If you do
leave it out, be sure to link the IN and COM terminals on the PC board. Take
care when installing the potentiometers, as their values differ.
Resistor Colour Codes
No.
2
2
2
1
2
1
Value
100kΩ
10kΩ
4.7kΩ
2.2kΩ
1kΩ
680Ω
4-Band Code (1%)
brown black yellow brown
brown black orange brown
yellow violet red brown
red red red brown
brown black red brown
blue grey brown brown
5-Band Code (1%)
brown black black orange brown
brown black black red brown
yellow violet black brown brown
red red black brown brown
brown black black brown brown
blue grey black black brown
MARCH 1999 59
This photo shows how the bodies of the potentiometers are connected together
and earthed using a single length of tinned copper wire. This is done to prevent
hum injection into the signal whenever a pot is touched.
its pins contact the pads on the top
of the board and lightly solder each
pin in turn. Once this has been done,
insert short lengths of tinned copper
wire into the holes down the outside
edges of the board and solder these
in position.
The assembly can now be installed
on the main PC board, just like a regular 14-pin IC. Alternatively, if you
have the DIP version of the IC, solder
it in instead. In either case, make sure
that the IC is oriented correctly, with
pin 1 adjacent to the 100µF capacitor
at the back of the board.
Next, install the diode (D1), the
resistors and the link in the locations
shown. You should also install a link
between the “IN” and “COM” pads
(near the output socket) if you don’t
intend installing a bypass switch.
Note that D1 must be oriented with
the polarity shown. The banded end
is the cathode (K).
R1 is only installed if an electret
microphone is to be used. Table 1
shows the resistor colour codes but it
is a good idea to also measure them
using a digital multimeter.
Install the PC stakes now, followed
by the capacitors. Apart from the
0.1µF unit adjacent to the input socket, the capacitors are all electrolytic
types so make sure they are correctly
oriented. Use a 22µF capacitor for C1 if
you intend using the compressor with
Fig.5: the full-size etching pattern for the PC board.
The section labelled “S0-14” is required only if you
have the surface-mount version of the SSM2166 IC.
60 Silicon Chip
a microphone. Alternatively, make
C1 2.2µF if you intend using the unit
with a guitar or other music sources.
The regulator can be mounted next,
then trimpot VR5 and the four potentiometers (VR1-VR4). Take care when
mounting the pots to ensure that you
use the correct type and value in each
position. In particular, note that VR1
is a logarithmic pot, while VR2-VR4
are linear pots. It’s quite easy to tell
them apart – log pots are marked with
an “A”, while linear pots are marked
with a “B’.
Use the 50kΩ log pot for VR1, the
1MΩ linear pot for VR2, and the 50kΩ
linear pots for VR3 and VR4.
The LED and the two 6.35mm jack
sockets can go in next. Watch the orientation of the LED – its anode lead
(which is the longer of the two) goes
towards the nearby wire link.
Finally, the PC board assembly
can be completed by connecting the
bodies of the pots together using a
length of tinned copper wire. One end
of this wire is then connected to the
GND PC stake adjacent to the input
socket. This measure is necessary to
prevent hum from being injected into
the signal whenever a pot is touched.
Fig.4 shows how the bypass switch
(S1) is connected, using shielded
cable. This will usually be required
for guitar use and with line level inputs but not when the compressor is
used with a microphone. In the latter
case, simply short the IN and COM
terminals by installing a wire link, as
described previously.
Testing
The circuit can be powered up using
a battery or power supply which can
deliver 9-12V at about 50mA. Check
that the voltage between pins 1 and
14 is 5V and that LED1 illuminates
when power is applied.
Next, feed a signal into the input (either from a guitar, a line level source or
a microphone) and connect the output
to an audio amplifier. This done, set
VR1, VR2 & VR3 fully anticlockwise
and VR4 fully clockwise. Trimpot VR5
should also initially be set to its full
clockwise position.
Now check that the signal can be
heard. At this stage, the sound will
not appear any different from normal
because the compression is 1:1. Assuming that a signal can be heard, you
can now adjust VR3 for the desired
compression effect.
Parts List
1 PC board, code 01303991,
104 x 57mm
1 PC board (S0-14) for
surface-mount 14-pin IC (S
version only)
2 6.35mm PC mount mono or
stereo jack sockets
1 16mm 50kΩ log pot (VR1)
1 16mm 1MΩ lin pot (VR2)
2 16mm 50kΩ lin pots
(VR3,VR4)
1 10kΩ horizontal trimpot (VR5)
1 SPDT toggle switch (S1)
1 500mm length of 0.8mm tinned
copper wire
1 500mm length of single
shielded cable
7 PC stakes
Semiconductors
1 SSM2166P or SSM2166S
preamplifier with variable
compression (IC1); available
from Insight Electronics,
phone (02) 9585 5511
1 78L05 low power regulator
(REG1)
1 5mm red LED (LED1)
1 1N4004 1A diode (D1)
Capacitors
1 470µF 16VW PC electrolytic
1 100µF 16VW PC electrolytic
1 22µF 16VW PC electrolytic
(C1) – see text
2 10µF 16VW PC electrolytic
1 2.2µF 16VW PC electrolytic
(C1) – see text
2 1µF 16VW PC electrolytic
1 0.1µF MKT polyester
Resistors (0.25W, 1%)
2 100kΩ
1 2.2kΩ (R1)
2 10kΩ
2 1kΩ
2 4.7kΩ
1 680Ω
Protect Your Valuable Issues
Silicon
Chip
Binders
REAL
VALUE
AT
$
12
+$5 ea.95
P&P
Or buy
5a
get th nd
postag em
e free
Each binder holds up to 14 issues
Heavy board covers with 2-tone green vinyl covering
SILICON CHIP logo printed in gold-coloured lettering on spine &
cover
Just fill in & mail the handy order form below; or fax (02) 9979 6503; or ring (02)
9979 5644 & quote your credit card number.
Yes! Please send me ________ SILICON CHIP binder(s) at $A12.95 each
plus $5.00 p&p. Australia only – not available elsewhere.
Enclosed is my cheque/money order for $__________ or please debit my
Bankcard Visa Card MasterCard
Card No.
Signature_________________________ Card expiry date______/______
Name _____________________________________________________
Street _____________________________________________________
Suburb/town __________________________ Postcode______________
SILICON CHIP PUBLICATIONS
PO Box 139, Collaroy Beach, NSW 2097, Australia.
Phone (02) 9979 5644 Fax: (02) 9979 6503.
✂
VR2 (the Threshold pot) is adjusted to reduce the noise level with no
signal. Don’t set it too high though,
otherwise it will adversely affect the
compression process at low signal levels. VR4, the Limit control, is adjusted
anticlockwise to allow compression
up to a selected level before limiting
occurs.
Finally, VR1 (Gain) is adjusted to
give the required signal sensitivity,
while trimpot VR5 is adjusted so that
the output level matches the sensitivSC
ity of the following amplifier.
MARCH 1999 61
|