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 TONE GENERATION TECHNIQUES<br />

459<br />

., ,<br />

~<br />

....,: '0" . '.' '. .<br />

'.i<br />

(AI<br />

(8)<br />

Fig. 13-21. Generating an arbitrary frequency sine wave with the FFT. (A)<br />

Record boundaries with a 256-Hz wave. (8) Phase correction<br />

between records.<br />

tially in time to produce a continuous string <strong>of</strong> samples suitable for further<br />

processing or output to a DAC. Generally, the record size is chosen once and<br />

remains constant throughout the synthesis but a dynamically variable record<br />

size is conceivable. If the synthesis result is intended for human consumption,<br />

record sizes in the lO-msec to 50-msec range provide the best trade<strong>of</strong>f<br />

between frequency and time resolution consistent with human perceptual<br />

capabilities.<br />

In order to get acquainted with some <strong>of</strong> the problems and their<br />

solution, let's first consider the task <strong>of</strong> generating a sine wave <strong>of</strong> an arbitrary<br />

but constant frequency using the FFT. For the purpose <strong>of</strong>illustration, we will<br />

assume a sample rate <strong>of</strong> 10 ks/s = 0.1 msec/sample, a record size <strong>of</strong> 256 =<br />

25.6 msec, and a sine wave frequency <strong>of</strong> 200 Hz. The first problem that will<br />

be noted is that 200 Hz is not an exact harmonic <strong>of</strong> 1/25.6 msec = 39.0625<br />

Hz. The closest harmonic is the fifth, which is 195.3 Hz, an error <strong>of</strong> about<br />

one-third semitone. If FFT synthesis is to be useful, a way must be found to<br />

produce such intermediate frequencies accurately.<br />

Figure 13-21A illustrates the problem. Shown is an exact sampled<br />

200-Hz waveform and the record boundaries for 256-sample records. Obviously,<br />

the phase <strong>of</strong> the desired wave with respect to the record boundaries is<br />

different for each record. In fact, the phase advances by<br />

(200 - 5 X 39.0625)/39.0625 = 0.12 cycle every record period. Since the<br />

spectrum fed to the FFT includes phase, one can increment the phase <strong>of</strong> the

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

Saved successfully!

Ooh no, something went wrong!