22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DIGITAL FILTERING 505<br />

When programming according to the diagram, actually shifting the<br />

data is very inefficient. Instead, a pointer to the current sample is maintained<br />

and references to stored previous sample values are made relative to the<br />

pointer. Figure 14-17 is a program in BASIC that implements the transversal<br />

filter. The R array contains the impulse response, the S array contains<br />

previous signal samples, and N is the number <strong>of</strong> impulse response samples.<br />

The input sample is S 1 while the output sample is 52.<br />

In order to make maximum use <strong>of</strong> the algorithm, it is helpful to know<br />

some additional impulse response properties. First, if the filter has zero or<br />

linear phase its impulse response will always be perfectly symmetrical. If<br />

such a phase response is acceptable, the number <strong>of</strong> multiplications needed per<br />

sample can be essentially cut in half by adding the symmetrical parts together<br />

before multiplication as shown in Fig. 14-18.<br />

There are limits to the technique too. Filters with low-frequency discrimination,<br />

sharp cut<strong>of</strong>f slopes, or narrow peaks and dips in their amplitude<br />

response tend to have long duration impulse responses and therefore will<br />

require a lot <strong>of</strong> calculation. Thus, a simple bandpass or low-pass function is<br />

better performed with one <strong>of</strong> the previous techniques. On the other hand, if<br />

the amplitude response has a lot <strong>of</strong> peaks and dips, only the narrowest or<br />

\1<br />

RO<br />

RI<br />

•<br />

•<br />

RN- I<br />

'/ 2<br />

+<br />

• I •<br />

:. .<br />

I<br />

I<br />

: .<br />

, ,<br />

SYMMETRICAL IMPULSE RESPONSE<br />

Fig. 14-18. Simplification <strong>of</strong> Fig. 14-16 for symmetrical impulse response

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!