966 Chapter 25
with new, and/or yet other samples. Fig. 25-135A shows
this diagrammatically. A time delay (a number of
samples’ delay) is included in a loop and fed back at a
level determined by the controlling coefficient. Picking
off different samples and treating them with differing
coefficients allows great control over the nature of the
feedback and the dynamic nature of the loop. The most
important thing to note is that once a signal has entered
the loop, it just carries on going around and around,
being summed with fresh input samples each time. The
time taken for a signal to die away is determined by the
coefficients in the feedback loop—this can very loosely
be paralleled to the analog concept of Q; the more posi-
tive feedback in a filter the tighter its response, with the
drawback that ill attention to its control can result in
oscillation. Such is exactly the case with digital recur-
sive stages. Even if controlled, the signal never actually
dies away completely; in DSP this can result in leftover
bits rattling around, manifesting as repetitive cyclical
errors. Sufficient accumulator width needs to be avail-
able to round or noise-shape results off nicely.
The first big advantage of recursive processing is
that significantly less memory accesses are needed than
with FIR—history (equating to length of the filter and
its temporal resolution) is built up within the loop rather
than being necessary individually and sequentially. The
second advantage is that far fewer coefficients and oper-
ations are needed.
25.21.2.1 IIR Filters
A filter built up around recursive techniques is known
as an infinite impulse response filter or IIR, Fig.
25-135B, so called because once in the loop, an impulse
just keeps trundling around indefinitely, infinitely. In
practice it gets rounded off sooner or later, but it makes
the distinction from the FIR.
Additionally, an output appears from an IIR at the
same time as input samples are applied and the filter
starts behaving as a filter immediately; the only delay is
the group delay of the filter, exactly as in analog; there’s
no waiting for sufficient data to be affected by sufficient
coefficients for the nature of the filter to become
formed, as occurs in symmetrical FIRs.
IIRs are presently easier, quicker, and carry less time
and memory overhead than FIR filters; consequently,
they tend to be much more popular for audio DSP.
25.21.2.2 The Biquad
There are many different ways of implementing IIRs;
the one in Fig. 25-135B is known to its chums as direct
form 1 biquad and serves to illustrate the process well.
(Others may use less memory space, or run a bit
quicker, but they come up with the same results.) It’s
known as a biquad since it essentially calculates a
biquadratic equation. There is no real limit to the
number of input and output delays, multiplie, and
summations; it’s just that those longer than a classic
biquad tend to be rather high-strung creatures that are
far less easy to calculate coefficients for and to keep
tame (read stable).
There are two halves to the filter: the input stage
consists of a short, 3 tap, FIR. The applied input signal is
multiplied by a coefficient (b0) and the result put in the
accumulator; the two delay line outputs are multiplied by
their coefficients (b1 and b2) and added to the accumu-
lator. The output stage is a two-delay recursive section;
each of the two delay-line outputs are multiplied by their
respective coefficients (a1 and a2), the results adding to
the accumulator, the total contents of which now repre-
Figure 25-135. Recursive Processing. sent the output. Once used in a sample time’s calcula-
Accumulator
Loop
Input sample Output sample
Delay multiplied by
feedback coefficient Delay train of samples
A. Simple recursive processing.
Input
delay 1
Input
delay 2
Output
delay 1
Output
delay 2
Input samples Output samples
Input FIR structure Output recursive structure
BO
B1
B2
A1
A2
B. Direct-form 1 biquad IIR filter.