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.

DIGITAL TONE GENERATION TECHNIQUES 429<br />

time, and return the corresponding ideal tone sample by storing it in S. T<br />

will always be between 0 and 1 but will never equal 1. The range <strong>of</strong> Ss<br />

returned is not important but should be reasonable. The effect <strong>of</strong> a table<br />

lookup tone-generation routine is simulated by quantizing T according to<br />

the specified number <strong>of</strong> table entries and calling the ideal tone-generator<br />

subroutine.<br />

The program executes in two parts. The first part runs 1,000 samples<br />

through and accumulates the mean <strong>of</strong> the ideal samples and the mean <strong>of</strong> the<br />

difference. The second part runs another 1,000 samples to compute the rms<br />

difference as described earlier. Phase shift due to truncation in the table<br />

lookup is also corrected. When complete (the program may run for several<br />

minutes on many systems) it prints a single number, which is the SiN ratio<br />

in decibels. Note that this is an absolute worst case, since all noise frequencies<br />

including those that would be stopped by the DAC's filter are included.<br />

A figure ;n better agreement with actual audible noise would be about 5 dB<br />

better.<br />

Figure 13-0 gives some results from running the program. Table sizes<br />

<strong>of</strong> 256, 512, and 1,024 were tried with no interpolation and with linear<br />

interpolation. Two waveforms were also tried, one being a simple sine wave<br />

and the other being a fairly rich waveform having an equal mix <strong>of</strong>fundamental,<br />

2,3, 5,8, 11, 14, and 17th harmonics.<br />

A. NO INTERPOLATION<br />

1. Sine waveform<br />

a. 256 points 42.99 dB<br />

b. 512 points 49.03 dB<br />

c. 1024 points 55.05 dB<br />

2. Complex waveform<br />

a. 256 points 23.56 dB<br />

b. 512 points 29.55 dB<br />

c. 1024 points 35.41 dB<br />

B. LINEAR INTERPOLATION<br />

1. Sine waveform<br />

a. 256 points 85.19 dB<br />

b. 512 points 97.23 dB<br />

c. 1024 points 109.28 dB<br />

2. Complex waveform<br />

a. 256 points 42.75 dB<br />

b. 512 points 54.76 dB<br />

C. 1024 points 66.82 dB<br />

Fig. 13-6. Worst case table noise for various combinations <strong>of</strong> table length,<br />

stored waveform, and interpolation. (A) No interpolation. (B) Linear<br />

interpolation.

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

Saved successfully!

Ooh no, something went wrong!