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.

MUSIC SYNTHESIS SOFTWARE 667<br />

also possible to shift the baseline <strong>of</strong> the waveform t9 force posltlve and<br />

negative symmetry and thus insure use <strong>of</strong> all 256 quantization levels in the<br />

waveform table. Unfortunately, this may also introduce a significant de<br />

component to the waveform, which may cause trouble, such as a "thump"<br />

when a fast amplitude envelope is applied.<br />

Fast Founer Transform for the 68000<br />

For the last example, we will examine a translation <strong>of</strong> the complex FFT<br />

subroutine described in Chapter 13 from BASIC into 68000 assembly<br />

language. The main practical reason for being interested in an assembly<br />

language FFT is its much greater speed relative to one in a high-level<br />

language. For example, to transform 1024 complex data points (which could<br />

be 2048 real data points if a real transformation routine was also written),<br />

only 900 msec are required on a typical-speed 68000 compared to a minute<br />

or more for the BASIC program running on most systems. With smaller<br />

record sizes <strong>of</strong> 64 complex (128 real) points and a fast (l2-MHz) 68000, one<br />

could approach real-time analysis <strong>of</strong> speech bandwidth (8 ks/s) data! For any<br />

practical use with real-world data, the accuracy <strong>of</strong> the routine will be<br />

equivalent to one using floating-point arithmetic.<br />

Before describing the workings <strong>of</strong> the routine itself, let's examine the<br />

scaling properties <strong>of</strong> the FFT algorithm. First refer back to Fig. 13-15, in<br />

which the calculations involved in each "node" <strong>of</strong> the FFT were diagrammed.<br />

These calculations are all <strong>of</strong> the form:<br />

(NEWDATA) = (OLDDATA1) + (OLDDATA2) X COS(A) +<br />

(OLDDATA3) X SIN(A)<br />

where A is some angle, OLDDATA1, 2, and 3 are current values in the data<br />

array, and NEWDATA is a new value stored back into the data array. Doing a<br />

range analysis where the ranges <strong>of</strong> OLDDATA 1, 2, and 3 are all the same, we<br />

find that the range <strong>of</strong> NEWDATA is at most 2.41 times larger than the<br />

OLDDATA ranges, which could occur when the angle A is 45°. In actual use<br />

inside an FFT, it turns out that the range <strong>of</strong> NEWDATA is only twice that <strong>of</strong><br />

the OLDDATA values. The point is that, since all <strong>of</strong> the array data<br />

participates in calculations <strong>of</strong> this type for each column <strong>of</strong> nodes in the FFT<br />

butterfly diagram, it follows thar" the range for the array doubles as each<br />

column <strong>of</strong> nodes is evaluated. Since there are LOG2N node columns in an N­<br />

point FFT calculation, the range <strong>of</strong> the final result array is simply N times<br />

the range <strong>of</strong> the original data array. In actuality, this theoretical result range<br />

will only be approached when the input signal contains a single-frequency<br />

component near full-scale amplitude and it has not been windowed.<br />

There are numerous ways to handle this tendency for data values to<br />

double every iteration through the FFT algorithm. The first is to simply

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

Saved successfully!

Ooh no, something went wrong!