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 439<br />

transform normally deals in sine and cosine components <strong>of</strong> the harmonic,<br />

which can be negative as well as positive. Conversion between the two forms<br />

is avally quite simple. The overall harmonic amplitude, A, is given by<br />

A = S2+C 2 , where S is the sine component value and C is the cosine<br />

component. The effective phase angle (in radians) is listed in the following<br />

table:<br />

c S Phase angle<br />

+ + Tan- 1 (SjC)<br />

+ Tan- 1 (Sj-C)<br />

Tan- 1 (SjC)<br />

+ Tan- 1 ( -SjC)<br />

Note that these formulas always give a positive amplitude and phase<br />

angle. Also, C will have to be tested for zero before calculating the phase<br />

angle to avoid division overflow. When C is zero, the phase is 7T/2 if S is<br />

positive and 37T/2 if S is negative. When translating from amplitude and<br />

phase to sine and cosine the formulas are: C=Acos(P) and S=Asin(P).<br />

Thus, conversion from one form to the other is fairly simple.<br />

The dc and Nyquist frequency components <strong>of</strong>the wave are a special case,<br />

however. The cosine part <strong>of</strong> the zeroth harmonic is the actual dc component,<br />

while the sine part would be expected to be zero, since a zero frequency wave<br />

cannot have a phase angle other than zero. For mathematical completeness, it<br />

is also necessary to consider the harmonic at exactly one-half the sample rate.<br />

As it turns out, the Nyquist frequency harmonic must have a zero sine part<br />

also. Note that if this Nyquist frequency component is very strong, it is an<br />

indication <strong>of</strong>serious aliasing in the data. Thus, in a real audio signal application,<br />

its existence can usually be ignored.<br />

Now, if the harmonic components are counted up, we find that there is<br />

exactly the same quantity <strong>of</strong> numbers forming the frequency domain representation<br />

as are in the time domain representation. Actually, this is a requirement<br />

if the transformation is to be precisely reversible for any arbitrary<br />

sample set as was stated earlier. Fourier transformation is exactly what the<br />

name implies, a data transformation. It alone is not a magic data compression<br />

technique.<br />

Slow Fourie,. Transform<br />

Before delving into the fast Fourier transform, it is necessary to understand<br />

how the straightforward but slow version works. A few pages ago there<br />

was some discussion about filling a waveform table by evaluating a Fourier<br />

series. By making a couple <strong>of</strong> modifications to the procedure, the inverse<br />

(frequency domain to time domain) slow Fourier transform results. The first<br />

modification is that the number <strong>of</strong> samples generated in the output record

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

Saved successfully!

Ooh no, something went wrong!