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.

490 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

desirable properties. First, it was a second-order filter with independent control<br />

<strong>of</strong> center frequency and Q. Next, a single circuit simultaneously provides<br />

low-pass, bandpass, high-pass, and notch outputs from a single input. Finally,<br />

it could be tuned over a very wide range <strong>of</strong> both frequency and Q<br />

merely by varying just three resistors (two for frequency and one for Q) or<br />

alternatively, three gain factors. Precise matching <strong>of</strong> the two frequencydetermining<br />

controls was not necessary unless a deep notch was desired.<br />

Since all second-order response functions are available from this one circuit,<br />

it is an ideal building block for sharper and more complex filters.<br />

Figure 14-6 shows the analog state-variable filter in terms <strong>of</strong>amplifiers<br />

and integrators. Taking this and the diagram <strong>of</strong> a digital integrator, the<br />

digital state-variable filter follows almost trivially. (Note that the configuration<br />

<strong>of</strong> the first integrator has been altered somewhat. It is necessary to have a<br />

delay inside the overall feedback loop for the network to function.) All <strong>of</strong> the<br />

desirable characteristics <strong>of</strong> the state variable have been retained. The four<br />

different outputs are still present and frequency and Q are independently<br />

adjustable. A count <strong>of</strong> arithmetic operations reveals that five additions (six if<br />

the notch output is needed) and three multiplications per sample are required.<br />

Although more efficient structures are possible for single-function<br />

filters such as bandpass, they are not nearly as flexible and give up independence<br />

between center frequency and Q control.<br />

Using the rules just discussed, let us convert this diagram into a series<br />

<strong>of</strong> BASIC statements. Before starting, the names <strong>of</strong> variables must be established.<br />

For convenience with the limited names allowed in BASIC, the<br />

following will be arbitrarily assigned:<br />

I Input sample<br />

L Low-pass output sample<br />

B Bandpass output sample<br />

H High-pass output sample<br />

N Notch output sample<br />

F 1 Frequency control parameter<br />

Q 1 Q control parameter<br />

D1 Delay associated with bandpass output<br />

D2 Delay associated with low-pass output<br />

The first task is to compute all <strong>of</strong> the outputs. The sequence <strong>of</strong> computation<br />

is important in order to minimize the statements and to avoid having a<br />

variable depend on itself in the same time period. Careful examination <strong>of</strong> the<br />

diagram reveals that if the low-pass output is evaluated first, everything else<br />

falls into place. Thus, the first step is accomplished by the following<br />

statements:<br />

1000 LET L=D2+Fl*D1<br />

1001 LET H=I-L-Q1*D1<br />

1002 LET B=F1*H+D1<br />

1003 LET N=H+L

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

Saved successfully!

Ooh no, something went wrong!