Page 347 - Programming Microcontrollers in C
P. 347
332 Chapter 6 Large Microcontrollers
What is a dot_product( )? In vector algebra, a dot product,
or a scalar product, operates on all of the members of two vectors
and returns a single scalar result. This value is the magnitude of the
projection of one vector on the other. The familiar arithmetic form
for a dot product is
n–1
c= a b
∑ kk
0
Note that all corresponding members of the two vectors are mul
tiplied and summed. The result is a single number. Another important
calculation needed to be accomplished by a DSP is called convolu
tion. A convolution is the time domain operation of a filter. Most of
the time, a designer thinks of a filter as operating on the different
frequencies of the signal being processed. In the frequency domain,
at every frequency the filter has a gain which is complex. “Complex”
in this case means the gain has two dimensions that can be thought of
as magnitude and phase. The signal also has a similar two-dimensional
description in frequency. At each frequency, the magnitude of the
filter gain multiplies the magnitude portion of the signal, and thephase
of the filter gain adds to the corresponding phase of the signal. There
are easy ways to treat this operation in the frequency domain. In fact,
the design of most filters takes place in the frequency domain.
However, the frequency domain is an artifact that we can never
really get our hands on. In reality, the signals we must deal with are
varying voltages or currents. These varying signals can be continu
ous, or when converted to a tractable form for operation in a computer,
they are a series of samples. Let us call them x . Here x is the value
k
of the signal at sample points k. Now k might be thought of as re
lated to time, and in fact different values of k do correspond to samples
taken at different times. Usually, k corresponds to samples taken pe
riodically at carefully spaced, equal intervals.
A filter in the time domain has what is called a weighting func
tion. The weighting function is indeed the Fourier transform of the
complex frequency response of the filter. In the continuous domain,
there is a mathematical trick that allows the weighting function to be
shown. A function called a Dirac Delta function is defined as a func
tion that is 0 everywhere except at one point. The integral across this
point is one. Such a function really does not exist. However, if such