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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

502 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

impulse is equally simple: an infinite number <strong>of</strong> frequency components all <strong>of</strong><br />

equal amplitude and all with zero phase angles.<br />

The filter's output in response to an impulse input tells everything<br />

about its amplitude and phase response but in an easy to use form. Since the<br />

input spectrum is flat and has zero phase, the output spectrum will directly<br />

represent the amplitude and phase response <strong>of</strong> the filter under test! This<br />

means that the characteristics <strong>of</strong> a digital filter can be plotted merely by<br />

taking the Fourier transform <strong>of</strong> its impulse response. This, in fact, is how<br />

many <strong>of</strong> the filter response curves in this book were plotted. Conversely any<br />

amplitude and phase response may be inverse Fourier transformed to get the<br />

corresponding impulse response. These are very important points and are<br />

illustrated in Fig. 14-14.<br />

If two widely separated impulses are fed to a filter, one would expect to<br />

see two copies <strong>of</strong> the impulse response. If the first impulse is twice the height<br />

<strong>of</strong> the second, the first response will have twice the amplitude as well but the<br />

same basic shape. If the impulses are moved closer together, they start to<br />

overlap. Since filters are linear, the composite output is simply the pointby-point<br />

sum <strong>of</strong> the responses due to each impulse. This applies to any<br />

number <strong>of</strong> impulses at any spacing.<br />

Although it is already being taken for granted, sampled analog signals<br />

are really strings <strong>of</strong> impulses, the height <strong>of</strong> each being proportional to the<br />

sample values. According to the previous paragraph, the output <strong>of</strong> a filter<br />

receiving such impulses as input is equal to the sum <strong>of</strong> the responses to each<br />

individual sample impulse as illustrated in Fig. 14-15. This then is the crux<br />

<strong>of</strong> direct convolution digital filtering.<br />

I mplementatwn<br />

The first step in implementing the algorithm is to obtain the impulse<br />

response in usable form. For digital filtering, samples <strong>of</strong> the impulse response<br />

are needed, The samples must be taken at the same sample rate as the signal<br />

to be processed. If the rate is different, all filter response frequencies will be<br />

altered in direct proportion to the ratio <strong>of</strong> the sample rates. Any stable<br />

impulse response will be bounded on both sides by zeroes, which can then be<br />

discarded. Unfortunately, most responses do not suddenly cut <strong>of</strong>f, so a<br />

truncation decision must be made. Since the computation time is directly<br />

proportional to the number <strong>of</strong> response samples retained, there is an incentive<br />

to retain as few as possible. Very broadly speaking, if all <strong>of</strong> the response<br />

samples omitted are less than 0.01 <strong>of</strong> the largest response sample, then only<br />

filter attenuation beyond 40 dB is likely to be disturbed to any significant<br />

degree. Accordingly, retaining samples down to 0.001 will not disturb<br />

attenuation curves less than 60 dB. In any case, the impulse response becomes<br />

a string <strong>of</strong> numbers.<br />

The calculations involved are quite simple. Assuming that some data<br />

has already gone through the filter, the Ith output sample is equal to the Ith

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

Saved successfully!

Ooh no, something went wrong!