DSPs: What They Are and Why They Are Used
By, Amir Majidimehr
Let’s take a look at the
typical spec sheet for an Audio/Video processor, in this case an
Anthem D2v:
“Two dual-core digital signal processing (DSP) engines, our own
DSP design, offer a total of 800 MIPS to allow decoding of the new
HD audio standards: Dolby Digital Plus, Dolby TrueHD, DTS-HD
High-Resolution Audio and DTS-HD Master Audio. More than enough
processing power to handle even the most complex program material
with matchless precision.”
Some terms in there should make sense to you such as the compressed
audio standards used in DVD and Blu-ray disc (DTS, Dolby, etc). But
what on earth is a DSP?

DSP stands for Digital Signal Processor. As the last word implies,
this is a device that is akin to the processor in your computer.
Its job is to read instructions, work on data, and generate results.
An engineer with knowledge of the above tasks creates a program
for it that it loads and runs as instructed. In the case of above
examples, it will decode a Dolby TrueHD compressed stream into PCM
audio samples ready to be output to the DAC (Digital to Audio
Converter).
The above may sound like what is also going on in your computer but
DSP’s function and design are optimized for a different task. To
understand that we need to step back and talk about what type of
processing we need to perform in audio domain.
Take the functions of the Anthem AV processor. In addition to the
above decoders it also performs functions such as room equalization
and bass management. How these “algorithms” (methods) work is
beyond the scope of this article. What is important to understand
about them is that we can reduce them into a sequence of math
operations. For example there is math function where we multiple
one number by another and keep accumulating the result. Such a
function can then be used to implement a filter to for example route
high frequencies to your speakers and low ones to the subwoofer.
This operation is so common that it has its own name called “MAC”
which stands for multiply-accumulates.
Now imagine having to figure out the above sum for every audio
sample. If you are playing most movie soundtracks, the sampling
rate is 48,000/sec meaning there are 48,000 samples per second. For
every audio sample we may be performing hundreds of arithmetic
operations. Since our system is “real time” we need to keep up with
the incoming audio rate and compute our operations in the same
allotted time. So in my hypothetic example of 100 operations per
audio sample, we need to perform nearly five million operations per
second (48,000 * 100). This is per channel! And the number scales
up with sampling rate. If we have 7 channels of audio and at 192
KHz sampling rate, the number of operations climbs to 33
million/second. If this doesn’t impress you, remember, this is just
for one function the processor is performing. In real life, it
would be performing cascaded functions of many, decoding audio,
performing room EQ, bass management, etc.

DSPs are purpose built devices that are optimized to perform
repeated mathematical operations. In the above example, the same
bit of math is applied to every audio sample repeatedly millions of
times. Having this knowledge allows one to build a processor that
is a) faster, b) cheaper, c) lower power or all of these. Why?
Well, we know certain things about how the processor will ultimately
be used. For example, the values used to multiply the audio samples
are a small set that are used over and over again. So what we can
do is to have very high-speed memory inside the processor that keeps
this data. This memory would be instantly accessible to use as
opposed to traditional computer systems where data is normally kept
in slower main memory. Similarly a single instruction can tell
the DSP to perform a sequence of math functions so the overhead of
telling it what to do relative to the work it has to do is very low.
Traditionally DSPs had a major leg up over processors in your
computers when it came to arithmetic operations. They could use all
of their silicon real estate for math functions allowing them to
have what we call very high “peak” computational power. Indeed the
“super computers” of the past were built the same way. You don’t
hear much about those super computers any more (at least not the
traditional ones). For the same reasoning, this advantage of DSPs
in sheer power is mostly lost as compared to modern CPUs.
How did
that happen? Well, CPU designers stole the DSP technique and ran
with it! It used to be that CPUs only knew how to fetch and execute
one math operation at a time. That created a loss of efficiency as
instruction after instruction had to be executed to perform the same
math operation (on different data). Some 20 years ago Intel started
a trend of adding so called “SIMD” extensions to mainstream computer
processors. SIMD stands for Single Instruction, Multiple Data. As
the name implies, one instruction can tell the CPU to perform
multiple ones which is precisely the type we need to match what the
DSP does. While the solution is not quite as optimized as it is
with DSPs, it comes awfully close. And with it, your mainstream
CPU now can perform these specialized math functions with very high
peak speed.
So why do we do we not use a computer CPU in our AV processor? One
answer is the cost. The CPU and its associated circuitry cost
considerably more than a DSP since they have to be good at many
things and not just arithmetic.
Another reason is power consumption. All else being equal, a
simpler circuit uses less power. DSPs are streamlined to perform a
set of mathematical functions. This translates into less digital
circuits “toggling” and with it, less power consumed. The Anthem
processor is not battery operated so you might think it shouldn’t
care about power but it does. With so much functionality in today’s
AV processors, we need to manage the total amount of heat generated
and avoid having fans and such that many of our computers sport.
High power can also translate into more cost in the form of heat
sinks and larger power supply.
Is there a down side to DSPs? Technically yes. They “hate” doing
work that is not repetitive. Telling it to do something if a number
is less than another but something else if not, sharply reduces its
performance. For this reason, they make lousy general purpose
computers and hence the reason your computer doesn’t use them.
By the way, there is even a more optimized way to perform these
functions and that is through purpose built “hardware.” That is a
circuit that is designed to do one and only one thing. It goes by
the names “FPGA” or “ASIC.” Video decoding for example is done
using these techniques as using DSPs or CPUs to do the same would be
much more expensive. The advantage DSPs have is that they are
flexible. As you see implied in the Anthem spec, we can load up the
DSP with different audio decoder programs and have it perform that
function. If we had done the same with FPGA/ASIC, we would have
needed to have a chip with all of those functions simultaneously
implemented since there is no program to load and tell it to run.
Since we never need to decode Dolby and DTS at the same time this
approach would have been a waste. This is why you always see a
DSP in an AV processor dedicated to audio tasks.
So another way to think of DSPs is as programmable hardware. It is
good for semi-fixed function tasks that typify audio processing.
I should mention that programming DSPs is a difficult thing. It is
specialized skill that requires knowledge of the task needing to be
done and the best way to get it to be a long sequence of math
operations as anything else would run too slow. For this reason, I
personally have a lot of respect for those who can do it well!
Back to Articles