CALIFORNIA STATE UNIVERSITY, NORTHRIDGE

DIGITAL FILTER IMPLEMENTATION

FOR AN AUDIO ANALYZER

A thesis submitted in partial satisfaction of the

requirements for the degree of Master of Science

in Engineering

by

Vorarat Harikul

May, 1985 The Thesis of Vorarat Harikul is approved:

G. 'Davis · ·

~··.· ..

mittee Chairman

California State University, Northridge

ii ,, .

TABLE OF CONTENTS

1.0 INTRODUCTION ....•...... •.•...•.••••....•. 1 2.0 SYSTEM IMPLEMENTATION ...... •••..•.••..•.• 3 2.1 FILTER IMPLEMENTATION .•••....•••....•. 6 3.0 BILINEAR TRANSFORMATION ..•••...... •..• 12 3.1 DESIGNING THE .••..••.•• 15 4.0 FOURIER TRANSFORM ••...... •••..•••.•...... 21 4.1 DISCRETE FOURIER TRANSFORM ....•..• : ... 22 4. 2 FAST FOURIER TRANSFORM .....•.••••... ~ ..•• 2 6

5. 0 HARDWARE/SOFTWARE SELECTION •••.•• ~·... ..• ~· ~ •.•• 33 6.0 HARDWARE REQUIREMENTS •.....•.••..••....•••• 37 6.1 PRE-AMP AND CLAMP CIRCUIT .•.••••.....• 39 6. 2 A/D CONVERTER •.•••.••.•••••••...•.•.•• 4 2 6.3 CENTRAL PROCESSING UNIT (CPU) .•.•••••• 45 6 . 4 -R~SET •.•.....•.....•.•.•••.•.••••...•.. 4 5 6.5 CLOCK •••.•.•••. ; •••.•••••.•.....••••.• 48 6.6 READ ONLY MEMORY •.•..•....••.•••••.••. 48 6.7 RANDOM ACCESS MEMORY ••.•.•....•..•.•.• 48 6.8 COUNTER TIMER CIRCUIT (CTC) ••••••••..• 48 6.9 ADDRESS DECODER •...•..•..••••.•••.•... 50 6.10 OUTPUT D/A CONVERTER ••.•.••.•••••..... 50 6.11 DISPLAY DRIVER ••.••...... ••••.••.••.• 53 6.12 MISCELLANEOUS .•..•..•.•...•.....•....• 53 7.0 SOFTWA?.E REQUIREMENTS ..••..••.....•.••..•.. 56 8.0 SUMMARY AND DISCUSSIONS •.....••••..•••....• 62

REFERENCES ••••.••••••••..••.•••••••• ·-. ~ •••• 6 3

APPENDIX A •.•••.••••••...••••..•....•....•• 67

APPENDIX ·B •• ••••••••••.•••••••••••••••••••.• 73

iii TABLE OF FIGURES

FIGURE 2.1 IMPULSE SAMPLING PROCESS •••.••••• -. • 4 FIGURE 2.2 SIGNAL .•.••••••••••••••••. 7

FIGURE 3.1 THE BILINEAR Z-TRANSFORMATION ••••.• 14 FIGURE 3.2 WARPING RESULT FROM USING THE BILINEAR TRANSFORM •.•••..••.•••• 16 FIGURE 3.3 2nd ORDER DIGITAL BANDPASS FILTER •• 19 FIGURE 3.4 BANDPASS FILTER RESULT ••••••••••••• 20

FIGURE 4.1 4 SAMPLES FFT . ....•....••..••.••.•• 3 0 . ' ,· FIGURE 6.1 SYSTEM BLOCK DIAGRAM ••••• ~ •· ••• ; ••.• 3 8 FIGURE 6.2 PRE-AMP AND CLAMP CIRCUIT.·~ •• ~- -.· ~ .•• 40 FIGURE 6.3 A/D AND ADDRESS DECODER ••. ~~- •.••••• 43 FIGURE 6.4 A/D TIMING DIAGRAM ••••••••••••••••• 44 FIGURE 6.5 CPU CTC AND MEMORY ••••••••••••••••. 46 FIGURE 6.6 POWER ON RESET •••...••••••••••••••• 4 7 FIGURE 6.7 CLOCK DRIVER ••••••••••••••••••••••• 49 FIGURE 6.8 D/A AND OUTPUT PORTS SELECT •••••••• 51 FIGURE 6.9 SAMPLE AND HOLD •••••••••••••••••••• 52 -FIGURE 6.10 LEDS DRIVER • •..••...••••..•••..••.• 54

FIGURE 7.1 SYSTEM FLOW DIAGRAM •••••••••••••••. 57 FIGURE 7.2 FFT COMPUTATION •••••••••••••••••••• 61

iv ABSTRACT

DIGITAL FILTER IMPLEMENTATION FOR AN AUDIO ANALYZER by Vorarat Harikul

Master of Science in EngineeLing

In the past, the audio analyzer has been imple­ mented with a bank of analog filter circuits. In the one-third octave audio analyzer, 32 independent band- pass filter circuits are required. Each filter is designed to allow a specific band of frequencies to pass, and suppresses all others. With the advancements of modern science a~d technology, many analog systems have been replaced by digital systems due t6 better performance reliability and lower production costs. The purpose of this thesis was to design and build an audio analyzer using digital techniques. Two of the most promising techniques were analyzed and their performances compared. Each technique was studied in terms of: (1) Method of filtering. (2) Degree of simplicity in filter implementation.

v ( 3) Advantages and disadvantages of using the

filters. (4) Possible applications. One technique was selected and implemented with hardware to perform as an audio analyzer. Software was also designed to control the filtering operations.

Tests indicated that using digital techniques resulted in better performance than that of it's analog counterpart.

vi 1.0 INTRODUCTION

Digital signal processing .is a rapidly growing field in analyzing signal characteristics. Even though techniques of digital signai analysis have been in existence for centuries, this method of signal analysis was only possible when powerful digital computers became available. Engineers and scientists have performed digital signal processing using computer

simulations. However, relatively ~arge computers operating at high speed are needed t·o implement the

simulations. Only recently has the implementation of digital

signal processing become practical, especially in the

field of telecommunications. With modern technology, digital signal processing hardware can be implemented

by a few VLSI (Very Large Scale Integrated) devices.

This makes digital impl~mentation more economical. It has been predicted that more arid more digital systems will be used to replace the analog systems in this area. This is likely, due to the advantages of the digital system as listed below: (1) The digital system is easily adaptable to

various signal processing operations~

Parameters needed for these operations can easily be modified in a computer.

{2) The digital system has higher noise immunity.

1 (3) The results produced by the digital system are

more accurate and reproducible.

(4) The production and maintenance costs are cheaper than the analog counterparts.

The disadvantages such as quantizing error, aliasing error, and limitations in signal bandwidth are inherent in all digital systems.- However, these disadvantages can generally be reduced significantly in a properly designed digital system. 2.0 SYSTEM IMPLEMENTATION

The Analog input signal is in the continuous form. The A/D (Analog to Digital) converter is used to transform the analog signal into a digital signal by data sampling at constant time intervals. These sampled signals are a series of impulses representing the contour of the continuous signal. This information is binary coded and is stored in the computer's memory.

_The mathematical representation,.· of the sample signal can be derived as follows:

First, the train of unit impulses is defined as +oo o (t) = Eo {t-nT) [2.1] - .n=-(JI) Next, the continuous x(t) is multiplied with the train of unit impulses to form the sample data X(t). +oo X(t) = x(t) Eo(t-nT) r 2. 21 Since x(t) is known only at the sampled point or when t = n, and for the normal physical signal x{t) = 0 for t

Take the of the equation

[2.3]. +co ~[X(t)] = ~[ Ex(n)o(t-nT)] n=o

3 Q •

CONTINUOUS SIGNAL

x(t)

IMPULSE TRAIN 6(t)

X(t)

SAMPLED DATA

FIGURE 2.1 IMPULSE SAMPLING PROCESS 5

Consider the right hand side of the above equation = £[x(O)o(t)+x(l)o(t-T)+x(2)o(t-2T)+ ... ] = x(O)+x(l)e-sT+x(2)e-2sT+ •..

The left hand side of the equation. (Qt! [X (t)]) is the z-transform the sequence input x (n) • The z-transform equation is defined as +co X(z) = Ex(n)z-n [ 2. 4] n=O · where z = esT and z-n = e-nsT. The term z-n represents a time delay of n input sampling, with T as the sampling period. This z-transform in the digital system is the implementation of the S-transform of the continuous system.

The operations in the digital system have introduced two types of errors. First, the inform~tion between the sampling intervals is lost. Second, an error is introduced by the quantization of the analog signal. The first error can be corrected by sampling the signal at a sufficiently high rate so that all frequency components of the analog signals including the highest frequency components are preserved. The sampling frequency, in order to capture .the input signal can be determined by the use of the Sampling Theorem. This Theorem states that to completely recover the input signal, the sampling frequency must be greater than twice that of the highest frequency components of the input signal. The minimum sampling rate is called the . If the input

signal is sampled below this frequency, a phenomenon called "aliasing" will result. An example of an aliasing frequency is illustrated in Figure 2.2. In practice, if the maximum input frequency is not defined, the anti-alias filter is used to suppress unwanted higher frequencies.

The effect of the second error in the digital system is due to the limited number of bits used in the digitization of the input signal. This ~rror cannot be eliminated since the number of bits in the digital system is finite. However, increasing the number of

bits or reducing the full scale rang~ of the analog

signal will reduce the quantizatiori error. The equation to determine the quantization error is:

q = I/2N [2.5] Peak Quantization Noise = q/2 [2.6] where I is the full scale of the input signal and N is the number of bits used in the digital conversion.

2.1 FILTER IMPLEMENTATION The digital filter can be implemented in two ways: (1) the Infinite Impulse Response · {IIR) or

recursive filter, and (2) the Finite Impulse Response (FIR) or non-recursive filter. INPUT SIGNAL SAt1PLED DATA ALIAS SIGNAL

SAl,1PLING FREQUENCY LESS THAN· HALF THE INPUT FREQUENCY

FIGURE 2.2 ALIASING SIGNAL 8

Summation of the successive input and its previous values~ and previous output values. The-coefficients ak and bk are calculated according to the response of the system.

The represent the coefficients of the

feedback components. If all values of b~_are 0, the output Y(nT) is a function of the su!nmation of the

inputs only. The filter is then called the FIR filter. In the IIR filter, an error (beside the sampling error described previously) called the "limit cycle" is

introduced. Consider the following IIR filter equation: Y(n) = .909Y(n-1)+.091X(n-l) .[2.8] This equation is transformed from the conti- nuous RC lowpass filter network with R=lOOOO Ohms and

C=lO micro-Farad. The coefficients a and ~ are comput­ ed based on a 10 milliseconds sampling interval [17].

Using [2.8], the digital output of the unit step input is computed and the results are listed in the

table below. The calculation of the RC network (analog) response is also presented for comparison purposes. DIGITAL ANALOG TIME X{n) Y (n-1) Y(n) Y..i!l .00 .5 .000 .045 .000 .01 1.0 .. 045 .132 .095 ~02 1.0 .132 .211 .181 .03 1.0 .211 .283 .259 .04 1.0 .283 .348 .330 .05 1.0 .348 .407 .393 .06 1.0 .407 .461 .451 .07 1.0 .461 .510 .503 .08 1.0 .510 .555 .551 ~09 1.0 .. 555 .595 .593 .10 1.0 .595 .632 .632 . 1.0 1.0 1.0 1.0 ... 1.0

The digital input X=.5 at t=O is an average value for a .. discontinuous signal. Assume that the input signal is off, X=O, and consider the values of the signal being quantized is rounded to a s.ingle · decimal point.

This results in Y(n) = .91Y(n-l)

TIME{s) Y(n-1) Y(n)

1.00 1.0 • 9 1.01 .9 .8 1.02 .8 • 7 1.03 . 7 .6 1.04 .6 .6 1.05 .6 .6

In this case while the quantized outpu~ indicat-

ed a steady state value of 0.6, the actual result would have decayed exponentially to zero. The error exists because of the finite number of bits in the digital system. This example demonstrates the limit cycle of the digital system. To reduce the limit cycle, higher resolution is required and a small 'dither signal' [ 4 6] can be added to the signal to cause the filter output in jumping across the quantization threshold. The FIR filter introduces · an effect called "leakage". In most FIR filters, a bank of input samples is processed at a time. The truncation of th~se input samples is called a "sampled window" ... It will be shown later that computing the truncatio~ of a periodic

function in time domain at other than a multiple of its period will result in the side-lobes in the frequency domain transform. To reduce the side-lobes or leakaQe, the input sampling window is modified to reduce discontinuity resulting from truncation. Many techniques of implementing both IIR and FIR digital filters are available. Each of the techniques has its own advantages and disadvantages depending on the application and system requirements. The following lists some of the techniques of designing the digital

filter. Technique 1:

Technique 2: Digital filter specification from a

Square Magnitude Function (l •

Technique 3: Bilinear Transformation of a continuous filter function

Technique 4: Frequency Sampling Technique

Technique 5~ Discrete Fourier Transform (DFT) or Fast

Fourier ~ransform (FFT)

Technique 6: Method of Convolution and Correlation In this paper, only two meth_ods will be studied in detail and their performaces compared. These are

the Bilinear Transformation techniqu~ and the Fourier

Transform technique. 3.0 BILINEAR TRANSFORMATION

The study of the Bilinear Transformation

'technique was chosen for two reasons. First, the continuous transfer functions used for Bilinear Transformation are easily obtained from most analog

filter references. Second, the technique maps the

entire complex S-plane of a continuous filter into the Z-plane of the digital filter, eliminating the aliasing

problem associated with the transformation. The disadvantage of this technique is· th~- nonlinear relation between the analog and digital frequencies.

Also, the phase/frequency characteristic of-the filter

and the impulse response of the continuous filter are

not preserved.

The transformation can be performed as follows: (1) The entire complex S-plane · is mapped into the

horizontal strip R~plane with the relationship:

S ·- (2/T)tanh(RT/2) [3.1]

where S is Q + jW

R is q + jw and T is the sampling period

(2) The R-plane is then mapped into the Z-plane with the relationship z = eRT (3) From (1) and {2), the relationship between Sand z is S = (2/T) [ (Z-1}/(Z+l)] [ 3. 2]

12 1 ., -'..J

The . left half of the S-plane is mapped inside of the unit circle and the right half of the S-plane is mapped outside of the unit circle as shown in Figure 3.1.

From equations [3.1] and [3.2], the transform frequency between the S-plane to the R-plane is not a 1

. to 1 ratio. By substituting S =jW and Z = ejwT in equation [3.2], the relationship between the frequencies in the analog and digital systems is established [46]. W = (2/T)tan(wT/2) [3.3] where W is the analog frequency and w is the digital

frequency

According to Rader and Gold [39], the real constant multiplier 2/T is not necessary. Since a constant multiplier does not change the form of the transformation, many texts usually replace 2/T with a· constant k, such that:

S = k [(Z-1)/(Z+l)] ( 3 0 4 J

and W = k tan(wT/2) ( 3 0 5] The nonlinear relationship of the ·analog and digital frequencies introduces a warping effect in the transformation. The problem of frequency warping can be overcome by pre-warping the corner (transition) frequencies of the filter before or after the appli- cation of the Bilinear Transformation. The relation- ship of W versus w and the characteristics of the UNIT CIRCLE ----- 31r/T

-rr/T

------37r/T

-joo S-PLAHE R-PLANE Z-PLANE

S=_g_ta nh(_gr_} Z=eR! · T 2 .

FIGURE 3.1 THE BILINEAR I-TRANSFORMATION

f .• .~.:.. analog H{s) and digital H{z) functions are shown in

Figure 3.2.

3.1 DESIGNING THE DIGITAL FILTER To design the digital filter, finding ·the Bilinear of the digital filtei is required. Assume the specifications-call for a digital low-pass filter with pass-band and stop-band cutoff frequencies at Wdp and Wds respectively, and that the sampling frequency is Fs Hertz •. The filter is designed as follows: (1) Compute the analog pass-band and stop-band frequencies

Wap = tan (Wdp*T/2) and Was = tan (Wds*T/2) where T = 1/Fs (2) Design an analog low-pass filter with pass-band and stop-band frequencies at Wap and Was respectively. The characteristics of the analog filter should be the same as the specifications of the digital filter. (3) Replace S in the analog filter transfer function

by (Z-1)/(Z+l). The result, H(z}, is the required digital filter. In APPENDIX A an APL (A PROGRAM LANGUAGE) program calculates the Bilinear Transform coefficient .- 'L ::>

W=ktan (•,,T /2)

/

I. wT I i I I I

FIGUR£ 3. 2 wARPING RESULT FROM USING THE BILINEAR TRANSFORM 17 ~~ '

of the digital bandpass filter up to the sixth order.

The program was written based on the computation method given by Chi-Tsong-Chen [11]. The program asks the operator to input the specification of the bandpass filter he wishes to design. The program then computes the order of the (first, second or third) in order to acquire the· S-domain transfer function of the continuous lowpass filter. The direct transform from the S-domain to the z-4qmain is applied using: s = (z2-2hZ+l)/(z2-l) The h coefficient is computed from the filter specifications. The. program outputs the z-transform equation and lists the design filter gain and phase characteristics.

The digital circuit can be constructed in three basic forms fro~ the resulting transfer function,

H ( z) • These are (1) The direct form, (2) The c3scad~ form, and (3) The parallel form. The construction of the cascade form will be presented in this paper. More details on the construction of the other 2 forms can be found in reference [25].

Consider a 2nd order bandpass filter transfer function computed in the example of Appendix A. H(z)= (.0787z2-.0787)/(1.0787z2-1.3029z+.9213) Y/X = .0729[(1-z-2)j(l-.955lz-l+.854lz-2)] ,.i..O "

The digital circuit representing the above equation is shown in Figure 3.3. Assume the continuous x(t) consists of the sine waveform of frequencies 100,

55Q, and 1000 Hz. The X (t) is _ sampled every 250 milliseconds (4000 Hz. sampling frequency). Using the filter in Figure 3.3, which is designed to capture the 550 Hz frequency and suppress the 100 and 1000 Hz, the results are plotted in Figure 3.4. MULTIPLIER Y

.0729

z-l UNIT DELAY

FIGuRE 3.3

2nd ORDER DIGITAL BANDPASS FILTER INPUT SIGNAL [x(t)=sin(2nilOO)}+sin(2rr(550))+sin(2rr(l000))]

OUWUT SIGNAL y(t)=sip(~(550))

FIGURE 3.4 BANDPASS FILTER RESULT

!'-) 0 4.0 FOURIER TRANSFORM

The mathematical relationship of the time domain

signal and its frequency spectrum was first established

by the French mathe~atician Baron Jean-Baptiste Fourler

and is called the Fourier Transformation. The Fourier

Transform of the frequency spectrum of any time domain

signal f(t) is expressed as +oo F (jw) = ff(t)e-jwtdt [ 4 .1] -oo

where w = 2 1T f ; f is frequency

If f(t) is a complex function we can separate the above ~ . ' equation into real and imaginary parts, as +oo +oo F(jw) = Jf(t)cos(wt)dt- j ff(t)sin(wt)dt [4.2] +oo -~ -~ +oo = J[f(t)+f(-t)]cos(wt)dt-j![f(t)-f(-t)]sin(wt)dt 0 . ~ ·~ The result F(jw) is real and even only if f(t) is even

f(tt = f(-t) ] and is imaginary and odd only if f(t)

is odd f(t) = -f(-t) ]. Therefore, the real part of F(jw) is even and the imaginary part is odd. The power

.spectrum in the frequency domain of the input time domain signal can be found as +oo . [F (jw)] 2 = -oo[Jf(t)cos(wt)dt]2 . + +oo [J£(t)sin(wt)dt]2 [4.3] -oo and is an even function.

Since all physical signals can be expressed as

the sum of a DC component and a number of sinusoidal components with different phases and magnitudes [23],

the Fourier Transform can convert any time domain

21 signal into its frequency spectrum components.

4.1 DISCRETE- FOURIER TRANSFORM

~he method of determining the Fourier Transform of the sampled data is called Discrete Fourier Trans- form or DFT. The DFT is computed by replacing the time variable (t) in the Fourier Transfbr~ with a discrete variable (nT). 1= From [ 4 .1] , F(jw)* = bf e-jwnT [ 4. 4] n=-co n where T is the time of the sampling interval •.

Separating . the equation into real and imaginary parts gives +oo +oo F ( jw) * = E£ncos(wnT) - j Efnsin(wnT) [4.5] n=-oo n=·-oo The F(jw)* has the same properties as F (jw) and because of the DFT realization, the F(jw)* is periodic over w with the period 2~/T. i.e, F(jw)* =

F(jw+j2~ /T)*. The output of the DFT is also dis- crete, with an interval of 2~ m/NT, m = O,l, .• ,N-1 where N is the total number of sample points. Since the accumulated input sample data has· a finite interval, the equation can be rewritten as N-1 Fm = Ef e-j2~mn/N [ 4. 6] n=O n

N-1 N-1 Fm = Efncos(2~mn/N) j Efnsin(2~mn/N) [ 4. 7] n=O n=O and the power spectrum is N-1 Fm2 = [_Efncos(2nmn/N)]2+ n-o N-1 [ Efnsin(2nmn/N)]2 n=O The best way to illustrate the mechanism of the DFT is shown below. ·

EXAMPLE

Assume the incoming signal is a sine-wave ~ith a 2.0 Hz frequency and a + 1.0 volt amplitude. The sampling frequency is 8 Hz and 8 samples are collected. Using

DFT to analyze ·the sampled data and find tbe power of the frequency spectrum of this signal,we have

fn = sin(2n(2.0)nT) ; n = O,l, •• ~.,N-1 T = 1/8

N = 8

From the properties of the DFT, we expect to find the frequency spectrum to be real, even and symmetric at n =N/2.

Using [4.8], where m = 0,1, ... ,7: the power spectrum can be found using the equation below. 7 . [ zsin(2n(2.0)n/B)*cos(2nmn/8)]2 + n=Q 7 . Esin(2n(2.0)n/8)*sin(2rrmn/8)].2 n=O The computed results are listed below. INPUT OUTPUT· SAMPLE TIME AMPLITUDE FREQUENCY PWR SPEC .000 SEC .000 • o £F 02J • ooo .125 SEC 1.000 l.O[Fl2] .000 .250 SEC .000 2.0[F22J 16.ooo .375 SEC -1.000 3.0[F32J .000 .500 SEC .000 4.0[F42 J .000 9 '

INPUT OUTPUT SAH.PLE TIME AMPLITUDE FREQUENCY PWR SPEC .625 SEC 1.000 5.0[F52J .ooo .750 SEC .. 000 6~0[F6 2 l 16.000 .875 SEC -1.000 7.0[F72J .000

The example above illustrates an ideal transform resulting from the digital processing method. In the real world, however, the results will contain various noise components. These noises are ca~sed by the sampling and truncation of the signal described previously.

Assume the input signal of the example has a frequency of- 1.5 Hz instead of 2.0 Hz. The computed result of the power spectrum now becomes INPUT OUTPUT SAMPLE TIME AMPLITUDE FREQUENCY PWR SPEC .000 SEC .000 .0 2.240 .125 SEC - .924 1.0 8.110 .250 SEC .707 2.0 5.828 .375 SEC -.383 3.0 .719 .500 SEC -1.000 4.0 .446 .625 SEC -.383 5.0 .719 .750 SEC .707 6.0 5.828 .875 SEC .924 1.0 a.110

The results from the DFT above do not have a well-defined spectrum line for 1.5 Hz. Therefore the weighing of the output is distributed between 1.0 and

2.0 Hz. Also the truncation of the input sampled results in a discontinuity in the function fn, which exhibits leakage, or in this case, the side-lobe oscillations of the output. These oscillations are due to the Gibb's phenomenon which states that truncation

'\. in one domain results in oscillation in the other domain. In the above example the input signal was truncated by the rectangular window Wn·

; where Wn = 1, O

rectangular window can be described math~matically by the fourier transform of the window itself. The

Fourier transfbrm of the rectangular window signal produced side-lobe characteristics of· the sin(f)/f

function [26,36]. This side-lobe is superimposed on

the power spectrum output~ To reduce leakage, a different type of window which has smaller side-lobe characteristics than the rectangular window should be employed. The following are some of the popular

truncation windows: Hanning function: Wn = (l/2)[1-cos(2'Trn/(N-l))] [ 4. 9] Hamming function: Wn = 0.54- 0.46cos(2'Trn/(N-l)) [4.10] Blackman function: Wn = 0.42-0.Scos(2'Trn/(N-l))+ 0.08cos(4'Trn/(N-l)) [ 4 .11] where O

Using the Hamming window truncation on the 1. 5

Hz input signal of the above example yields the following results;

INPUT OUTPUT SAMPLE TIME AMPLITUDE FREQUENCY PWR SPEC .000 SEC .000 • 0 .390 .125 SEC .234 1.0 2.666 .250 SEC .454 2.0 2.599 .375 SEC -.365 3.0 .154 .500 SEC -.954 A. 0 .000 .625 SEC. -.246 -5. o .154 .750 SEC .179 6.0 2.599 .875 SEC .074 7.0 2.666

4.2 FAST FOURIER TRANSFORM

Consider the Discrete Fourier Transform of 4 data samples using equation [4.6]. N-1 =.n=o rf n e-j2~mn/N- ·, m = 0 , 1 , 2 , ••. ,- N 1 Let W = e-j2~/N, and rewrite the above equation N-1 = Efnwmn [4.12] Fm n=o with N = 4, the DFT equations can be shown as Fa = foWO+f 1 wO+f 2 ~0+f 3 wO 0 Fl = f 0w +f1wl+f 2w2+f3w3 [4.13]

F2 = f 0wO+f1w2+f 2w4+f 3w6 0 F3 = fow +f1w3+f 2w6+f 3w9 From the example, in order to compute DFT of

N=4, 16[N2] multiplications and 12[(N-l)N] additions are required. Even though the DFT method can be used in ·signal processing, it requires a tremendous amount of computer time and memory. The alternate method developed by Cooley and Tukey, called the Fast Fourier ------=---.---~- ---~ -- ~------~·-- -....-- ~ ..... ------T --- .:...~ -~ ------

27

Transform (FFT) is usually employed.· instead · of the

DFT. Using the FFT method ins~ead of the DFT method does not change the characteristics or reduce the accuracy of the computation, but simply reduces the amount of mathematical operations by taking advantage of the repeated DFT coefficie~ts. The ~nput format, however, must contain 2x sampl~s, where x is a positive integer.

To develop FFT algorithms, fi~~t the DFT equa- .' tion [4.12] is separated into 2 parts; a first half and a second half. N/2-1 N-1 + zfnWmn Fm = n=~-fnWmn n=N 12 N/2-1 mn N/2-1 = EfnW + Ef( +N/2)wm(n+N/2) n=o n=O n N/2-1 -N/2-1 = Efnwmn + wmN/~- Ef(n+N/2)wmn n=O n=O

Using properties of e-j2~/N

wmN/2 = e(-j2~/N) (mN/2) = e<-j~)m = (-l)m we have; N/2-1 N/2-1 = Efnwmn + (-l)m n=EOf (n+N/2)wmn n=O

N/2-1 = n=Jlfn + (-l)mf(n+N/2)lwmn Now consider m-even and m-odd separately N/2-1 Fm(even) = F2r = t[fn+f(n+N/2)lw2rn [4.14] n=O Fm(odd) = F(2r+l) = N/~=~[fn-f(n+N/2)lw2rnwn where r = 0,1,2, ••• , (N/2)-1 [4.15] The equations [4.14] and [4.15] can be recognized as an independent N/2 point transform, since w2rn for N samples is equal to e(-j2~ /N) (2rn) and is equal to e{-j2n /(N/2))rn = wrn for N/2 samples. Let gn = fn+f (n+N/2) ' = the equations of N/2 points transform are: = gnw2rn ,for even components [4.16]

F(2r+l) = hnw2rn ,for odd components [4.17] By the same algorithm the computation of N da.ta samples can be broken down into N/2, N/4, N/S, .• ~,N/N: levels· I . ,•

'. The decomposition of the input sampled data is called the "decimation in frequency~ method. The output (frequency domain) sequences are divided into smaller and smaller subsequences. The alternative foio• method is to divide input {time domain) sequences into smaller and smaller subsequences of even and odd components. This is called the "decimation in time" [36] method.

To use the FFT algorithm developed above in the example of 4 input samples above, first the 4 points DFT are decomposed into 2 points.

The first level (N/2) ar~:

Even: fo(l) = 90 = fa + f2 f2(l) = 91 = fl + f3 [4.18] Odd: fl(l) = woho = wO[fo - f21 f3(l) = wlhl = wl[fl - f)l 29

The second level (N/4) are:.

Even: fo(2) = Fa = fo(l) + f2(1) Odd: fl(2) = F2 = wO[fo(l) - f2(1)] [4.19] Even: f2(2) = Fl = fl(l) + f3(1) Odd: f3(2) = F3 = w0 [fl{l) - f3(1)] The FFT flow chart of the 4 points sampled above

is illustrated . in Figure 4.1. The· amount' of computa;... tions using the FFT method total 4 multiplications and 8 additions. In the above example of 4 points FFT, the

reduction in mathematical computations· may .

be significant. However, as the input sa~ple increases

the reduction in mathematical computations will increase exponentially. In general, the FFT multiplica­ tion and addition requirements for N sampled data are (N/2)log2N and Nlog2N, respectively. Therefore for

64 input sam~led data, the FFT computation requires a maximum of 192 multiplications and 384 additions, whereas using the DFT, 4096 multiplications and 4032 additions are required. Further reductions in FFT computations can be accomplished, since:

(1) Any multiplication with a coefficient of wO can be eliminated since wO = 1. This results in reducing the number of multiplications by

N-1. -· 1- ... "- ...-l "- en ..:::1" w _J LJ.J 0.. 0:: :::E ::J- < t.!:' en u...- or 31

( 2) The FFT process produces a periodic outp~t with

a period of 2/T; where T is the sampling period.

In other words, the result of the FFT is symmetric at half of the sampling frequency. Therefore, in the last level of the decimation in frequency computation, only half of the outputs are computed. This results in reducing the number of additions by N/2. Therefore rinly 129 multiplications and 352 additions are required for the 64 points FFT computation.

Computing one dual nodes pair at a time also reduces the memory required for storing the results.

At each level. of the FFT computation, there are N/2 dual node pairs. From the 4 points FFT example, the first level pairs are ga with ha and gl with h1. Each is computed from the input pair fa with f2 and f1 with f3, respectively. .The next level of computation requires only the data of the prior results ( g a, ha' gl and Therefore the result from the computation of each pair can be stored into their respective input data memory locations. For example, the computation of ga and ha are stored in place of fa and f2, respectively. Notice that the output results of the FFT computation by decimation in frequency are somewhat scrambled. This is inherent in the computation method. 32

To rearrange t~~ output results, a pr~cess called the

bit-reversal technique is required. This is done by

replacing the sub-argument of the out?Ut by ~he binary number of x bits, where x is N = 2x, then reversing the order of the binary·number. The final result for 4 sampled data FFT will be: the data replacing fo -

f(OO) is F(OO) = Fo; the -data replacing f1 = £(01) is F(lO) =F2; the data replacing f2 = f{lO) is

F(Ol) = F1; the data replacing f3 = f(ll) is F(ll)

= F3. 5.0 HARDWARE/SOFTWARE SELECTION

The final step in completing this thesis is to

construct the hardware unit and to select the software method to implement the bandpass filter required in the

spectrum analyzer. The spectrum analyzer is an instru-

ment used in measuring the energy contained in each

specific band of frequencies. In general, three types

-of analyzer are used, (1) constant bandwidth, (2)

constant-percentage narrow bandwidth, and (3) octave,

half-octave, Dr third-octave bandwidth.

The constant bandwidth analyzer contains a pass

band of a fixed-number of cycles_and is mostly used for determining the harmonic components of a sound when the

frequencies are sufficiently stable so the measuring

components will not shift in and out of the narrow pass

band. The constant-percentage narrow -bandwidth has

pass band range frequencies of a fixed percentage of

tj2 mid-band frequency. The pass band at higher

frequencies has a wider frequency range than those at

lower frequencies. This instrument is useful for

measuring the harmonic component of a wave whose

fundamental frequency fluctuates.

The octave bandwidth is commonly used where a

detailed analysis of continuous-spectrum noises is not

required. For the octave bandwidth, the upper cutoff

33 34

frequency of the band-pass is twice that of the lower cutoff frequenriy. For th~ half-octave bandwidth, the upper cutoff is (2)1/2 of the lower cutoff, and for the third-octave bandwidth the ratio .is (2)1/3.

After analyzing the digital filter techniques

(Bilinear Transformation and Fast Fourie~ Transfoima- tion), the FFT technique is selected. The reasons for choosing the FFT technique are li~ted below:

(1) EASE OF COMPUTATION. A Z80A CPU was used for system mathematical computatioris .·and system control. For the CPU to perform the computation of the infinite impulse_response (IIR) filters, the computation would have been tedious and produced poor results, since the IIR filter (in

this case the Bilinear Transformation method)

computes the output from the present input and

previous inputs and outputs. By using the FFT method, the outputs are computed only from the

input signals.

( 2) OUTPUT DISPLAY. The spectrum analyzer display consists of 32 columns of 10 LEDs each. Each column of LEDs indicates the energy of a speci- fie range of frequencies. Using the Bilinear

Transform method, 32 bandpass filters are required, and more than one CPU would be required in order to service a complete range of audio frequencies. In the FFT method, however,

the CPU computes a set of sampled input, and the final output can be directly sent to the LED channels. With 64 sampled computations for a

40,000 Hz sampling frequency, the 0 to 20,000 Hz range is covered. (3) SIMPLICITY OF ARRANGING INPUT SAMPLED. The FFT

requires straightforward sampled signals for

its computation; that is, ~ equally spaced input

'· samples are sent to the FFT devi.ce ·(software or hardware) and the computations performed. The test, using the Bilinear Transform developed in Appendix A, shows no improvement in filter

performance with an increase in sampled data~

Therefore for the minimum computation, the minimum sampled data is required which would be

limited to the sampling Theorem. With the requirement of 32 discrete filters, 32 different

sample rates are needed.

However, by using the FFT method some analyzer requirements are sacrificed. First, the· frequency spectrum display is no longer an octave band; instead it is a function of sampled frequency and·t:he total number of sampled data acquired per window. Each display represents a frequency of n*Fs/N ,where n = 0,1,2, •.. ,N-l, Fs is the sampling frequency and N is the number of samples per window. Thus we h~ve the constant bandwidth analyzer. Second, because the FFT performs on one input window at a time, the input data from the signal between each sampled window is iost.

How much data is lost depends on how fast the FFT computation Is performed. Since the FFT·computations are done by the Z80A CPU with 4 MHZ clock, a substantial amount of data is lost. These data can be significantly recovered by using special hardware designed specifically to perform FFT computa~~ons. ~1 '

6. 0 HARDWARE REQUIREMENTS

The ·audio spectrum analyzer is constructed to convert ·a sound into the spectrums that indicate the spectral energy distributions of · that sound~ The digital processing technique described earlier is used .I in the conversion. In the past, the audio spectrum analyzer was . operated by feeding. the amplified input signal into a bank of specially designed analog bandpass filters. The output from each filter was then rectified and converted to a d-e voltage •. ~.The voltage level was scaled to represent an energy for that frequency band. In the spectrum analyzer outlined in this report, the continuous signal from the microphone is amplified through the pre-amp circuit. The output of the pre-amp is filtered to reduce the aliasing error, and converted to a digital word consisting of 8 bits for each sample. A window of 64 samples with a 25 micro3~conds sampling interval is taken and reshaped using the Blackman window function. The FFT process is then performed on the sample data, and the .outputs are stored in the memory locations. Each output datum is converted to the continuous voltage level and drives the appropriate LED channel every 2 milliseconds. The block diagram of the digital signal analyzer hardware is shown in Figure 6.1:

37 >- ex: _.J ·a.. U1...... 0

j

0:: w >...... 0:: 0

~ . 1./) ..... :;:: 1- z 0:: ex: ::5 0 1- (3 LL. ::::> .-t <:::( 0:: Q...... !.J.J ~ Q.. 0 <.0 0 u LJ..J ~ ::::> i- CY- u Q.. Lb ::::> 0 u LL. 0 _J I-t a::l LL. .,... ,_w ' c.n >- U1

...... 0 ex:

Q.. ex::::E: I w 0:: Q.. 1 0~ 39

6.1 PRE-AMP AND CLAMP CIRCUIT

The LM381A dual pre-amplifier is chosen for the pre-amp application due to its . high signal-to-noise

level and simple circuit design require•ents as shown

in Figure 6.2. Only one pre-amp is used. The circuit was designed as a flat gain, noninverting AC amplifier with input operating in the single ended mode [9,10]. From reference [lO], the transistor current in

the IC for minimum noise is 170 U~r To design an ultra-low noise pre-amp with a gain of 1000· operating from a 24 VDC source with a bandwidth of 20 Hz to 20 kHz, the following design equations are used.

The Cl value is selected to have a 3 Db cutoff at .1~5 Hz. The divider R3/R2 provides DC feedback and establishes the quiescent operating point. R3 is found by.

R3 =

When using the single ended input and ~n order to preserve bias stability, the resistor R2 must equal 1200 Ohms maximum.

Using R2 = 1000 Ohms, R3 becomes

R3 = 14574 Ohms The AC closed loop gain is given by A = (R3+Rl)/Rl R4 R5 \; \/20V 3~.7K +I C4 47 C3 1 47pF -::- . I

R3

14.7K R2 IK

I. ·- 6 ANAL08 +------

FIGURE 6.2

PRE-AMP AND CLAMP CIRCUIT

..,. 0 41

With a gain of 1000, Rl is equal to 147 Ohms.

For a low corn~r frequency of 20 Hz, Cl is computed by

C2 = 1/ (27T20Rl) = 54.1 uF The sum of the resistors R4 and RS is given by:

R4+R5 = (VS - 2.1)/(Ic - l8E-6)

For the range of collector currents over which the LM381A is . operating, R4 is usually set at three times

the value of RS. Therefore R4 = 107 K and RS = 35.7 K. Capacitor C4 is calculated as follows:

C4 = lOPSR/20 27T(l20)R5Al where PSR is power supply rejection in decibels, and

Al = [(2xl05)R4]/(R4+2xl05) l 0 • 2 6/ I c) + .,...-,.· ~~l~-::-=-:::--::--;=-=­ l/10000+1/Rl+l/R2

For high frequency cutoff at 20 kHz, C3 is calculated.

using C3 =l/[27T(20xl03) (.26/Ic)lOA/20]

where A is the mid band gain in decibels. The following are the computed values of the coponents:

Rl = 147 ,. R2 = 1 K ; R3 i:: 14.7 K ,. R4 = 107 K .,

RS = 35.7 K

Cl = 1.0 uF ., C2 = 56 UF ,. C3 = 47 pF ,. C4 = 47 uF 42

The signal input to the A/D conve~ter is limited to 0-5 volts. A clamped circuit is required to limit the amplitude of the pre-amp output to 5 volts peak to peak, with 2.5 volts as a reference ~oltage. Using the negative saturation of each op-amp, this requirement is met.

6.2 A/D CONVERTER - The ADC0820 is used in the circuit due to its speed and low cost. This converter ai.shown in Figure

. '' 6.3 is able to convert an analog signal: into an 8-bit digital data word within 2.5 microseconds. The chip performs this conversion by using the h~lf-flash technique [ 41] a This technique significantly reduces the number of comparators normally required in a regular flash converter. For example, in the 8 bits flash· converter 256 comparators are required. Using the half-flash technique, the number of comparators is reduced to 32. The comparators in this particular IC perform both conversion and sample-and-hold .functions. This allbws the input to change more than 1 least significant bit (LSB) during a conversion period; this is not allowed in the conventional successive-appro- ximation converter. The IC was designed to produce a binary output of 00000000 for a 0 volt input and 11111111 for a 5 volts input. The conversion is also · linearized within 1 LSB. ANALOG). ~~ VIN • DO Dl 02 150K 1/ ~I 03 04 05 ... ~:-lu 1 I I 8 06 ;;;- rzio7 I D0-07 1. 5V I ADC0820 IOK I I

WAIT I WR --·--· I RD ~ , ...... II OUTEN "

IORQ, A6 T I 4 \, f:"J(~) 6 I )CSI MREQ POO , POl ( '.I ! )CS2 I I Ill' I ,-~~3 A4 lA "' A5 IB A12) 11 2A 2YII 11 I I I·-,, Q"'~) )CS3 Al3 28 . cso 2YO . I 8 ·- 2Y3~ 10 \, Q"'~ )CS4 1~: 2Y2~ - .. 74LSI39 FIGURE 6.3 A/D AND ADDRESS DECODER

.r-- l·J CPU

All-15 ~~------'::~~XL---

~RQ \ f .. ------~)}~------~- ' .

RD \ . ·1··· ~------~}~~------~-

.. A/D JY2 '------i)'r--~. _----.;______,j/ cs \.....___~~\--s ____./ ROY \.______15.,.____.______,/

RD \·L___~- ~ ~~P------1- /

D0-7 ----

FIGURE 6.4 A/0 TIMING DIAGRAM 45

The converter is set Up in the RD Mode. Addition- al delay logics are added to the :f.nput RD line (pin 8) to satisfy the logic timing requirement. The RDY sig- nal from the·converter holds the CPU in the wait state during· the converting . time· until the output data is ready. The timing diagram of the converter signals and associated CPU signals is shown in Fi~ure 6.4:

6.3 CENTRAL PROCESSING UNIT (CPU) The Z80A is used because of .• the·. available software programing support system. This unit as shown in Figure 6.5 is driven by a 4 megahertz clock or 250 nanoseconds time period (T state), which is the basic time . unit of the software execution. The function of the CPU is to fetch instruction from the memory, and to cause execution of internal sequences which produce results corresponding to the instruction.

6.4 RESET

. . The reset circuit as shown in Figtire 6.6 was designed to perform power on reset to insure proper initialization of the system. Upon power up· the circuit holds the RESET line of the CPU low for approximately 400 milliseconds, allowing the power throughout the entire system to stabilize before the

CPU starts the execution of the program. H:~~ ~ :~~ I'" u~v WAIT ( 24 WR ( e 221 110 (CS3

-;:"

ZSOA CTC 1 I

Z80A CPU

AO-~~K ~ 11 : I . ! I • ! • I I • I ~ 00-01 < I I • I I I e I I •

CSI) •

FIGURE 6.5. 2732A-2 CPU CTC AND i·1EHORY

.;>. 0) 9 RESET ( 10 I 8 II 12

74LS04 +

I I r· I I,. I FIGURE 6.6 PmiER ON RESET

*"­ -.) 43

6.5 CLOCK The clock circuit as shown in Figure 6.7 outputs a 4 megahertz squarewave signal to the CPU and CTC chips. The clock signal allows the CPU and the CTC

chips to perform their functions.

6.6 READ ONLY MEMORY

ROM (Read . Only Memory) in Figure 6.5 is a nonvolatile memory. The 2732A EPROM with 200 nanoseconds access time was selected:: . ·'l'h is EPROM

provides a mechanism for the storage of program instructions. In addition to operation codes, it is

·also used for storing unmodified information such as

multiplier coefficients and table lookups. Addressea . OOOOH to OFFFH are assigned for the EPROM, where H indicates the address locations are in hexadecimals.

6.7 RANDOM ACCESS MEMORY

RAM (Random Access ·Memory) in Figure 6.5

provides a mechanism for the storage of 'modifiable information. The data in the RAM is generally created

. by the system, and is assigned to locations lOOOH to 13FFH.

6.8 COUNTER TIMER CIRCUIT (CTC)

The Z80A CTC peripheral in Figure 6.5 was used 5V

D•a .MHZ I '.' L I .... I - 3~ - 4 74LS~f-. .01 74LS04 I I

...,.___,VVv---' . "------~VV • 511 . 511 CLK·~ Ia -'~ 6 s ~19 · 74LS04 R

lOOP I I 5V~~.... D

74LS74

~19 I 74LS04 FIGURE 6.7 CLOCK DRIVER

~f-:o. 1.0 50

to generate interrupts and monitor times. In this case, the CTC is used to contro,l output data, and is programmed to interrupt the CPU every 2 milliseconds to service one channel of the output display.

6. 9 ADDRESS DECODER The 74LS139 and 74LS32 in Figtire 6.3 constituted the decoder logics. These logics control the chip select function of the EPROM, RAM and CTC. When the CPU requests data or outputs data to its.peripheral devices, the decoder ensures proper source and destination addresses.

6.10 OUTPUT D/A CONVERTER When the CPU receives an interrupt request from the CTC, the 8 bits data word and address code are sent to the output channel control circuit. The R2R network of the conttol circuit converts the 8 bits data into analog voltage.· This voltage is sent to the appropri­ ate channel, according to the address code. Each channel contains an individual sample and hold ampli­ fier in order to produce stable output data until the next data update (64 milliseconds). These circuits are as shown in Figures 6.8 and 6.9. OUffi~CPDO 01 -- I'R )0/A . 02 :.:19 I~ \ 10 I I~ <> 03 04 05 06 07 D0-07) I v L_

74l5364 I I .·- -· J J.. !c;. I I ' .. R2R - 816-55-AI

'---'"-iCP ao . (swo POO DO Ql 5 ' 'SWI ~ 01 Q2 6 ~ SELD A3 02 Q3 ~ -~SELC 12 ( A2 03 04 , ( SELB AI 04 Q5 15 . ,SELA AO 05 06 Q6 07 Q1 OE

74LS364 FIGURE 6.8 D/A AND OUTPUT PORTS SELECT

U1 1-'

"" ~' • )ORO

0/A) - I

-: • !~m .t!rB 4067 •

SWJ -1-- 150

') 14 • )OR31

4067 -: FIGURE 6.9.

S.I\1,1PLE Ai~D HOLD

Ul ('..) 53

6.11 DISPLAY DRIVER

The outp~t of the sample and hold amplifier is

input to th~ LED driver (LM3914) as shown in Figure 6.10. The LM3914 is selected for its low cost, low · overall parts count and low total power consumption. Each LM3914 controls one column of the display (10 LEDs connected in series). The normal current through the LEDs is designed to be 10 milliamperes. There are 32

columns of LEDs on the display. . . . ' ...... 6.12 MISCELLANEOUS Addresses 2000H to 200FH are assigned to the special function IC. This 2814 IC is a preprogramming FFT computation device, and is designed to perform a

single computation involving 32 points FFT in less than 30 milliseconds when driven at a 20 megahertzs 6lock

rate. The computation of two multiple sampled points (64, 128, 256, ••• ) is accomplished at the expense of increased computation time, but also yields improved .accuracy.

The original circuit was designed to use hardware (2814 device) to do FFT computation. This device is manufactured by American Micro Inc. (AMI) . During hardware debugging, the 2814 IC did not work properly, and two additional res were tried with unsatisfatory results. After talking to the AMI representative, it was learn­ ed that this device is no longer manufactured by AMI due to the problems associated with chip implementation. The updated device (part number 28214) is the manufactured replacement. r------~----~------~ALT

~------+------~------

5Vv----'V

----

20V v . .. I ~ ) • 0 I FIGRUE 6.10 LEOS DRIVER

Ul .I- 55

Shipping requirement time· is at least.6 weeks and the cost of the device is $250.00 per·chip. Therefore it ·was decided not to use this IC in the design and instead the FFT computation using the Z80 assembly code was used. This resulted in a substantial increase · 1n system output response time (300 to 500 milliseconds). 7.0 SOFTWARE REQUIREMENTS

The software in the digi~a1 system was written

to contror hardware- operations. The CPU fetches the

instructions and performs data manipulation as

requested by the instructions. These instructi6n codes

are stated in the EPROM (Erasable Programmable Read

Only Memory). The Z80 device has l58 instructions to pe~form mathematics ·and data manipulation between its

internal registers and between its registers and the external devices.

Immediately after the power is up, the CPU is

set to the initial operating state~ The instruction code is fetched from the EPROM, starting at location

OOOOH. The software in this thesis is written in the module form, where each module is assigned to perform a

specific task. The control module (CONTL) functions as

the executor of the system, since it gathers necessary

information from other modules and transfers informa-

tion 9etween the modules.- The system flow diagram of

the control module is shown in Figure 7;1.

At the beginning, the system is ini~ialized by

setting the interrupt mode and stack pointer. The

interrupt mode 2 was used because of the CTC ?eripheral used in the hardware. The stack pointer is an LIFO

(Last In First Out) register, and is assigned to address location 13FFH which is the last location of

56 Jl

FIGURE 7.1 SYSTEM FLOW DIAGRAM

( START ) '.

n I SYSTEM INITIALIZATION ,, - TEST MEMORIES RESET RAM

1f PROGRAM CTC '· ...... h 1 -1 DISABLE OUTPUT INTERRUPT

1 I SAMPLE INPUT DATA I r I ENABLE OUTPUT INTERRUPT ,, RESHAPE INPUT DATA r USING BLACKMAN WINDOW , I PERFORM FFT COMPUTATION· ,, REARRANGE OUTPUT DATA I USING BIT-REVERSAL · ,, - 58

the RAM. When the stack was used, its poi~ter is decremented by one. - The system then tests the RAM and EPROM. The RAM is tested using the pattern matching method.

First, each RAM location is loaded with data pattern 01010101B. These data are then rotated left one bit. The result is compared to pattern 10101010B. The system- will continue executing only if these two pat- tern are identical. The EPROM is tested by summing all of the contents of the EPROM from location OOOOH to location OFFDH. The four least significant bytes of the summing result are compared to the known results which _ are stored in location OFFER and OFFFH of the

EPROM. Again, the system will continue executing only if th~se two data are the same. The CTC has 4 independent channels of counter- timer circuits. In this project only one channel is used. This channel (0) is progr.:1mmed as a timer inter- rupt and its function is to interrupt the system every 2 milliseconds. In addition to the interrupt request signal, this device also informs the CPU of the address location of the interrupt routine. After the CPU acknowledges the interrupt request signal, it jumps to the interrupt routine and executes sequential instruc- tions in that routine until the return from interrupt code (RETI) is encountered. The interrupt routine in 59

this· case sends the computed output data to the.appro- priate LEDs chanriel. Only one channel is output per interrupt. Since there are 32 channels on the display, each ~hannel's data is updated every 64 milliseconds~

The CPU requests data from the A/D converter every 25 microseconds. Both real and i~aginary data are required in· the FFT computat~on.· Real data is acquired through the A/D converter and imaginary data is assumed to be zero initially. Whil~. the input data is being ~ampled, the interrupt is dis~bled. This is required in order to maintain a constant sampling data period.

The raw input sample data are multiplied by the Blackman's window coefficients. These coefficients are stored in the EPROM. The reshaping of input data is required to eliminate the data discontinuity explained in section 4.1.

The decimal-in-frequency FFT computation is used in transforming the input data time domain to the fre- quency domain. The computation method is divided into six successive computations. The first computation (BTFYA} performs the calculation on the 32 pairs of the reshaped input sample data. The second computation

(BTFYB) performs the calculation based on the result of the first computation. The third computation performs the calculation based on the result of the second compu- 60

tation, and so on. The mathematical equations and flow diagram of the decimal-in-frequency FFT calculation is shown in Figure 7.2. The bit-reversal program is required to unscram- ble the results of the FFT computation. After the FFT calculation, ·the results are stored in the ·memory loca-

tion labeled SPTRESL. The required bit ~eversal ~d- dresses (with reference to the SPTRESL addresses) are stored in the EPROM labeled BITRSLT. The bit reversal ... . module (BITRV) rearranges the results in.. ·SPTRESL per BITRSLT addresses and stores the unscrambled results in the memory location labeled SPTOUT.

The software listings for the control module (CONTL) and the FFT computation modules (FFTCL, BTFYA,

BTFYB, BTFYC, BTFYD, BTFYF) constitute Appendix B. 61

f ( n j•f ( n j•f ( n+K) 1 (n •i(n +1 (n+K) .f ( n+K l" Xcos ( ZTTPB/H) +Ys 1 n ( ZTTPB/N) 1 (n+K •Ycos(211PB/N)-Xs1n(211PB/N) ..

FIGURE 7.2 FFT COMPUTATION

X•f(n)-f(n+Kl Y•i(n)-i(n+K f(nj•f(n)+f(n+K) 1(n •1(n)+i(n+K) 8.0 SUMMARY AND DISCUSSIONS

In this th~sis, the au~io spectrum analyzer was designed and ·built using digital technology. The

Bilinear Transformation and Fast Fou~ier Transformation (iFT) were implemented to satisfy the spectrum analyzer specifications. These two techniques were selected in order to demonstrate the advantages and disadvantages between the IIR filter (Bilinear) and the FIR filter

(FFT) • The FFT method .was selected for the reasons outlined in section 5.0. The zao assembly l~nguage was written for system .operation and for performing the decimal-in-frequency FFT computation (Appendix B). The analyzer received the input signal from the microphone and convert~d it to digital signal information. The Blackman window (equation 4.11) was selected to reshape the input data sample in order to reduce leakage or side-lobe oscillation. The FFT computation was perform­ ed on these data and the output results sent to .the front panel bar graph LEDs display. The completed unit of the audio spectr~m analyzer has an output response time of 300 to 500 milliseconds. Test results indicat­ ed that the system performed as designed. This project has demonstrated that a system which was designed using digital techniques can produce performances which are superior to those of the analog counterpart at lower cost.

.62 REFERENCES [ ll ADC0820 8-Bit High Speed uP Compatible A/D Converter ·with Track/Hold· Function, National Semiconductor, Santa Clara, CA., June 1982. [ 2] Beauchamp, K. G., Signal Processing using Analog and Digital Technique, Geor~e Allen & Unwin LTD., London, 1973, pp. 315-319. 3] Beranek, L. L., Acoustics, MCGraw-Hill, N.Y., 1954, pp. 362-364 4T Beranek, L. L., Acoustics Measurments, John Wiley & sons, Inc., N.Y., 1956, pp. 29, 290. 5] Bergland, G •. D~, "A Fast· Fourier Transform Algorithm Using ~ase ·. 8 Iterations," Mathematic of Computation, v. 22, No. 102, April 1968, pp. 275-279. 6] Brigham, E. o., The Fast Fourier .Transform, Prentice-Hall, N.J., 1974 :.· 7] Bogner, R. E., and A. G •. Cons:tantinide·s, Introduction to ·Digital, .. · · ·Filtering, Wiley-Interscience Publication (John Wiley & sons), N.Y., 1975, pp. 47-59, 61-72. [ 8] Bucklen w., Dr J. Eldon, L. Schirm, and F. Williams, "Designer's Guide to: Digital signal processing," EDN, March 18, 1981, pp.l33-144; April 1, 1981, pp. 153-163; April 15, 1981, pp. 133-146; April 29, 1981, pp. 161-171; May 13, 1981, pp. 133-143. [ 9] Byerly, J. E., and E. L. long, "LM381 Low Noise Dual Preamplifier,". National Semiconductor, Application Note 64, May 1972, pp. 1-12. [10] Byerly, J. E., and D. Bohn, "LM381A Preamplifier for Ultra-Low Noise Applications," National Semiconductor, Application Note 70, August 1972, pp. 1-4. [11] Chen C., One-Dimensional Digital Signal Processing, Marcel Dekker, Inc., N.Y., 1979, pp. 226-277. [12] Chin S. H., and c. W. Brooks, "Microprogramming enhances signal processor's performance," Electronics, November 17, 1982, pp. 150-153. [13] Cobb, R. F., "Use fast Fourier transform programs to simplify, enhance filter analysis," EDN, March 8, 1984, pp. 209-218. [ 14] Cochran, w. T., and J. w. Cooley, "What is a Fast Fourier Transform?," IEEE Transaction on Audio and Electroacoustics, v. AU-15, June 1967, pp. 45-55. [15] Cushman R. H., "Digitization is on the way for FFT designs~" EDN, August 5, 1981, pp. 99-106.

63 5 l

[ 16] Derzawiec, E., "TTL inverting gates simplify digital-circuit power-up," Electronic· ·Design, July 8, 1982, pp. 192. [17] Grappel, R. A., "Optimize digital-filter operation by evaluating software tradeoffs,~ EDN, October 27, 1982, pp.213-220. [ 18] Hageman, S., "Program quickly figures complex filter parameters," Electronic Design, March 31, 1982, pp. 105-110. . . [19] Hamming, R. W., Digital Filter, Prentice-Hall, N.J., 1977, pp. 95-105. [20] Holm, R. E., "First single-chip signal processor simplifies analog design problems," Electronic Design, September 27, 1979, pp~ 50-54. [21] Holm, R. E., "Program a spectrum analyzer on one-chip real-time signal processor," Electronic Design, November 8, 1979, pp. 70-74. [22] Homer, ~., M. Tan~nhaus, and R~'Fritts, "Signal processor 'digitizes' analog desigi_problems~" Electronic Design, March 31, 1981,· pp. 161-168. [23] Huelsman, L. P., Basic Circuit Theory with Digital Computations, Prentice-Hall, N.J., 1972, pp. 759-779, 810-819, 830-834. [24] Hunter, J. L., Acoustics, Prentice~Hall, Inc.~ N.J., 1957, pp. 328. . . [ 25] Jackson, L. B., ·J. F. Kaiser, and H. s. Mcdonald, "An Approach to the Implementation of Digital Filters," IEEE Transaction on Audio and Electroacoustics, v. AU-16, September 1968, pp. ·173-181. [ 2 6] Jenkins, G. M., and D. G. Watts, Spectral Analysis and Its Application, Holden Day Inc., San Francicco, 1968, FP· 132-196. [27] Jones, N. B., edited, Digital Signal Processing, Peter Peregrinus Ltd, UK., 19&2, pp. 39-42. [28] Kaiser, J. K., "Some practical consideration~ in realization of linear digital filters," 1965 Proceeding 3rd Allerton Conference on Circuit and System Theory, pp. 621-633. [29] Karwoski, R. J., ""Implement digital filters efficiently with a specially configur~d computer," Electronic Design, September 1, 1979, pp. 110-116~ December 20, 1979, pp. 50-55. [30] Koen, M., "To sidestep track/hold pitfalls, recognize subtle design errors," EDN, September 5, 1980, pp. 179-184. [ 31] Lam, H. Y., Analog and Digital Filters: Design and Realization, Prentice-Hall, N.J., 1979, pp. 542-553. 65

" '

[32] Mager, s.~ R. Hester, and R. Simpson, "Signal-processing uC builds FFT~based spectrum analyzer," Electronic Design,_ August 19, 1982, pp. 149-154. [33] Malvar, H. S., -"Transform analog filters into digital equivalents," Electronic Design, April 30, 1981, pp. 145-148. [ 34] Michaels, s: · R., "Getting the best from a-d . I converters," Electronic Design, February· 18, 1982, pp~ 191-199 I [ 3 5] Muraoka, T., . Y. Yamada, and M. Yamazaki, "Sampling-Frequency Considerations in Digital Audio," J. of the Audio Engineering 'society, pp. 248-250 - [36] Oppenheim, A. V.,and R. W. Schafer, Digital. Signal Processing, Prentice -Hall, N~J., 1975, pp. 239-242 [37] Pease, R. A., "Bar-graph chip'.· lights LEDs in series; minimizes current drain foi_displays," Electronic Design, January 18, 1980, pp. 116. [38] Rabiner, L. R., and B. Gold, Theory and Application of Digital Signal Processing, Prentice-Hall, N.J., 1975, pp. 218-225. [39] Rader, C. M., and B. Gold, "Digital Methods for Sampled - Data Filters," Proceeding 1st Allerton Conference on Circuit and System Theory, 1963, pp. 221-236. [401 Robinson, E. A., and M. T. Silvia, Digital Signal Processing and Time Series Analysis, Holden-Day, Inc., San Francisco, 1978, pp. 240 [41] Sherman, L., "Fast CMOS a-d chip samples inputs," Electronic Design, July 8, 1982, pp. 149-159. . [42] Sherwin, j., "Specifying A/D and D/A Converters," National Semiconductor, Application Note 156, February 1976. [43] Spectrum Analysis Theory Implementation & Applications, Wavetex Rockland, Inc., Rockleigh, N.J., 1981. [44] Stanley, W•. D., Digital Signal Processing, Reston Publishing Company, Inc., (Prentice-Hall Co.), Reston, Virginia, 1975, pp. 138-201. [45] Stauffer, M. K., "Single-chip FSK modem expands your design choices," EDN, May 12, 1982, pp. 143-151. [46] Terrell, T. J., Introduction to Digit~l Filter, Macmillan Press LTD, London, 1980, pp. 1-38, 60-65, 139-142. [47] The Audio/Radio Handbook, National Semiconductor, Santa Clara, CA., 1980, pp~ 2-16 to 2-65. Go

[48] The Z80 Microcomputer Components Data .. Book, Zilog, Inc., Cupertino, CA., March 1981. · [49] TMS32010 (16/32-bit Digital Signal Processor) User's Guide, Texas Instrtiments, 1983; pp. 8-12 to 8-13 [SO] Toomey P., and J. Wynne, "Mea.sure frequency data with a uC-based analyzer," EDN, October 27, 1982, pp. 223-230. APPENDIX A

APL PROGRAM FOR

THE BILINEAR TRANSFORMATION

67 6d

v-BIXFMACOJ'V' COJ B! XFMA [ 1J ' ' ¢ A THIS PROGRA~1 CALCULATE AND ANALYZE THE BAND PASS fILTER US lNG C2J A BILINEAR TRANSFORMATION C3J A THE INPUT DATA ARE THE SPECIFICATIONS OF THE DESIGN DIGITAL FILTER [4J 'INPUT THE SPECIFICATION Of BAND-PASS CUTOFF FREQUENCIES' (5J 'Enter: low· stop-band, low pass-band, high pass-band, high stop-band; C6J X•t~ 0 FSL•XC1J 0 FPL•XC2J 0 FPH•XC3J 0 FSH•X~4J C7J 'INPUT SAMPLING FREQUENCY •must be > 2X(high stop-band frequency)*' EBJ FS•~~ 0 TS•iffS (9] h•C20(fPL+fPHlxoTSlf2o(TPH-FPL)xoTS CiOJ A COMPUTE RELATION BETWEEN ANALOG AND DIGITAL FREQUENCIES [11] wp1•Ch-20(fPHxozxTSl)~iO(fPHxo2XTS) (12] wp2f-(h-20(fPLxo2xTSl)fiO(FPLxo2XTSl (13] A TEST wpi AND wp2 COMPUTATION : wp1 = lwp21 [14] D£1.4-wp1-lwp2 0 -+BP.1XdE-4>1DE!.-1 [15] 'ERROR IN CALCULATE wpi AND wp2' 0 -+(1] [16] BR1:wq1•

[22] !J•'THE COEFICIENT hIS: I 0 [JH 0 I I C23J ~•'REQUIRE ANALOG LOW PASS FILTER HAS cur orr AT ' o ~•wp1 6 ' RAD/SEC'­ C24J !:!•'THE HINIMUt-1 oRDER or THE DIGITAL BAND PAss Is: • o ~H~xz o · · o · · C25J BR8:'DO YOU WISH TO ADJUST THE MAX ATTENUATION Of THE fiLTER'

( 261 .I Enter: YES or NO (to continue the MAX order all ow is 6) I [ 27] -+BR2X'.( "f' =it~) [281 A THE FOLLOWING PROGRAM COMPUTES THE Z TRANSFORM EQUATION ('Cl1 a•~ch:l•e+-f•s•A•B•C•D+-Ef-f•G•O ¢ W.wpi [301 -+(1 2 3 =N)/BR3,BR4,BR5 C31J '~HE fiLTER ORDER EXCEEDS THE MAXIMUM LIMIT (3) OR INCORRECT' 0 -+BRS (321 BP.3:Gf-1-W 0 F•-2xh 0 lf-1+W 0 g•-W 0 e•W C331 -+BR6 ( 34] BR4: G•1 +( W*2) -i. 4142XW ·~- ft--( 4Xh) -2. 8284XhXW <) 1•2+( 4Xh*2) -2Xlr1*2 E35J D+--(4X.hJ+2.82B4xh~:w o Ct-1+d.4142XW)+W*2 o g•W+2 o e+--2XW+2 •/ c•W+2 [36J -+BR6 [ 37] BR5: G+-1 +( 2XI.r1*2) -( 2XW) +W+3 0 ff-( 8XWn,) -( 4Xh~:W+2l +6Xh [ 38] Ef-3+ ( 12):}-:*2) +( 3X ll.'+-3) -( 2XW) +( sxwx h*2) +2X W+2 <) DH 8X hXW*2) -( 12Xh) +8:•:h*3 [ 39] C•3+( 1 2~::h•2> +( 2:(W) +(ax WXh6n -( 2):W•2) +3X W•3 0 B•-( 6X h)+ (ax wx h) +4XhX W+2 [401 A•1+C 2XuJ)+( 2XW+2!+W*3 •> g•-W*3 o e+-3XW*3 0 c•-3xll.'+-3 •> aHJ•3 E41J A THE FOLLOWING PROGRAM ANALYZE THE Z TRANSFORM ABOVE AND E42J A AND LIST THE GAIN AND PHASE CHARACTERISTICS (431 BR6:'INPUT THE ANALYZE FREQUENCY CEnter: start end step) IN HERTZ' [44] Fl+-::i:~ •>' '•) Fa•FH1J+FI[3Jx(l.fi+(f!(2J-F![1JHfJ[3J)-1 0 wf-02XFaxTS 69

[45] FREQUENCY GAIN GAIN (in .DB> PHASE (in DEGREE) 1 [46] RnH ax 20( 6X w)) + ( bx 21J( 5X w)) +(ex 20( 4Xw)) +( d>:2o( 3Xw)) +( ex2o( 2x w)) +(fx 20w) +g [47] In•

[49] I dH Ax!o( E.xu.1)) +( Bx1o( 5xw)) +( CX10C4xw)) +( DX!C:1 ( 3Xw)) +( EX10( 2Xw)) +( F>:ioJw) [50] MAGnH(Rn*2)+(In*2lH0.5 \> ANGnH-30(ln-:-Rn))X180.;.Q1 [5iJ MAGd•«Rd*2)+(ld:o1:2)>*0.5 \> ANGdH-3oJC!d-:-Rd)}X180-:-o1 , [52] GAlN•MAGn.;.MAGd 0 GAlNDE•20X(10~GAIN) 0 PHASE•ANGn-ANGd 0 X•pfa [531 12 1 15 8 12 1 21 1 ~~(4,XlpFa,GAlN,GAINDB,PHASE [ 541 ' 1 \> 1 DO YOU WANT TO ANALYZE THE PROGRAM AGAl N ? (Enter: YES or NO) 1 [ 551 -+BR6x1.( "i 1 =HCJ) 7 )

BI XFMA .

INPUT THE SPECIFICATION OF BAND-PASS CUTOFF FREQUENCIES Enter: low stop-band, row pass-band, high pass-~and, high stop-band 100 500 600 1000 INPUT SAMPLING FREQUENCY •must be.> 2X(high stop-band frequency)* 4000 INPUT THE MAX ATTENUATION IN D! OF THE FILTER 10

THE COEFICIENT h IS: 0.6514562706 REQUIRE ANALOG LOW PASS FILTER HAS CUT Off AT 0:07870170682 RAD/SEC THE MINIMUM ORDER OF THE DIGITAL BAND PASS IS: 2

DO YOU WISH TO ADJUST THE MAX ATTENUATION Of THE FILTER Enter: YES or NO

.·FREQUENCY GAIN GAIN (in DB> PHASE (in DEGREE> 100.0 .03659203 -28.7 -92.1 200.0 .08090925 -21.8 -94.6 300.0 .14752186 -16.6 -98.5 400.0 . 28170845 -u.o -106.4 500.0 . 70710678 -3.0 45.0 600.0 . 70710678 -3.0 -45.0 ··. 700.0 .33464395 -9.5 -70.4 · SO•J.O .21353673 -13.4 -n. 7 900.0 .15512802 -16.2 -81.1 1000.0 .11993683 -18.4 -83.1

DO YOU WANT TO ANALYZE THE PROGRAM AGAIN ?

BI XFMA

INPUT THE SPECIFICATION Of BAND-PASS CUTOFF FREQUENCIES Enter: I ow stop-band, low pass-band, high pass-band,· high stop-band 100 500 600 1000 INPUT SAMPLING FREQUENCY *must be > 2X(high stop-band fre1uency)* 8000 INPUT THE HAX ATTENUATION IN DB OF THE FILTER 10

THE COEFICIENT h IS: 0.9088438595 REQUIRE ANALOG LOW PASS FILTER HAS CUT OFF AT 0~03929010701 RAD/SEC THE MINIMUM ORDER OF THE DIGITAL BAND PASS IS: 2

DO YOU WISH TO ADJUST THE MAX ATTENUATION Of THE fiLTER Enter: YES or NO (to continue the MAX order allow is 6> NO INPUT THE ANALYZE fREQUENCY

FREQUENCY GAIN GAIN (in DB> PHASE (in DEGREE) 100.0 . 03497966 -29.1 -92.0 200.0 • 07771928 -22.2 -94.5 300.0 .14290135 -16.9 -98.2 400.0 .27641618 -11.2 -106.0 500.0 . 70710678 -3.0 -135.0 600.0 • 70710678 -3.0 -45.0 700.0 . 34309061 -9.3 -69.9 800.0 .22538928 -12.9 -77.0 900.0 .16941779 -15.4 -so. 2 1000.0 .13642776 -17.3 -82.2

DO YOU WANT TO ANALYZE THE PROGRAM AGAIN ? (Enter: YES or NO> NO ..," I·'-

~fFT[OJ-v [OJ fFT (1J A THIS PROGRAM COMPUTES FFT Of SAMPLED DATA INPUT USING DECIMATION IN CZJ · A fREQUENCY METHOD Ref. DIGITAL SIGNAL PROCESSING by ALAN V. OPPENHEIM [ 3] A and RONALD W. SCHAFER page 302-307 [4] ' INPUT REAL DATA CEnter-: XO Xi X2 • • • XC n-1) J ' [ SJ H-Re~~o [ 6] 'INPUT IMAGINARY DATA (same number as REAL datal' . [ 7] i~~o [ 8] N~pf 0 B•! 0 n~1 0 C~O 0 P•O [ 9] BR!: KHH-2x B [10] BR2:XH[nJ-f[n+KJ 0 Y•i(nj-i[n+KJ 0 HnJH(nJ+f(n+KJ 0 i[nJ~i(nJ+i(n+KJ [ 11] [12] i(n+KJ•CYX20(02xPxB~N))-Xx1a(o2xPxB~Nl E13J PH+i 0 C+-C:+i 0 n•n+i [ 14J -+ BR2x ~ P#K [15] P•O 0 n~n+K [16] -+BR2X~C#N+2 [17J n•i 0 C~O 0 B~Bx2 CiS] ~BR1x~B#N+2 C19J K~K+2 C20J BR3:XHEnJ-f[n+KJ 0 Y~i[nJ-Hn+KJ 0 HnJH[nJ+Hn+Kl (21J iCnJ~i(nJ+i(n+KJ 0 f(n+KJ~X 0 i[n+KJ•Y 0 n~n+2 (22] ~BR3x~n

Z80 SOFTWARE

73 74

T£)(Tl\'ON I X· ZSO AS~ 113.4 PACe

00)01 S£C'Tletl CONIL~.• ABSOLUTE 0000~ GLO~ Bm:st.T 000(!2 GLOBA'- a.RSIZE 00((:4 GLOBA~ cos ()(1(11)'5 GI.OBAL CTCVCTR O()(J(Jt, GI.OBAL DATA!~ 1)(\o)(>J GLOBAL DATAI\1. ()(l(I(IE: CtoBAL EXPTHBL (l()(l(r< GI.OSAL N":-M.E ()(•)10 GLO~ OIJTPl'TC 00(111 GI.OBAL RM 000i2 GLOM'_ Ret'~:-~ 00013 GLOBAL SINE 00(114 GI.OBAL ~TOLf' 00015 GLOBAL SPTRESi.. (\()(11b . GI.OBAL WINOC'COE 00017 GLOBAL X 0001& GLOMi. y

"

t+Ht Ct"W5TANTS · t+Ht

ooo:: 1400 006TID EOO 0140tiH 00023 (1(14(1 ~·LE EOO b4 00(1;?4 03EO Q.RSIZE Ellll 003Et.iH

•. 75

THTRCt

000~6 H+H • • t 00(>27 t t • * + • t (){)(l""'=· - ...... • t t (X).)Z~ t t HH++i t t CiO'J:~J • t • t

f.)(lOJ2 SCCTIOO RA1'IS, AFSDLIJTE ooo~~,...... j(XK) CflG JOOOh

0003'5 1000 RAM EQU s CiO'J36 I000 OOBO IJAT~ Jlt.CJD( !2S : 1>4 RE't. NITA 1 BYTES EACH 00037 I 080 0030 DATA! I! BLOCK 128 ; .1>4 JPWJ DATA .2 BYTES EACH 00038 ll

TEHP.OI:!X Z8l1 AS~ V3. 4 Pll{,£ 3

00042 HH> Hoff f f OON~ f f f f f f OO(lcl· f f ·~- f+Hf f f 00(151.- f f f 0(1052 f HH f

· S£CTION TAB'_ES,AF:'.JLLITE OFOO · ffiG OFOOH

00()57 HHt BIT REVE:!r.;AL TABU: ffttt

000!~ OFOO 00 BITRSLT BYTE OOH 00060 OF01 20 BYTE 20H 00061 OFOi 10 BYTE 10H 00062 OF03 30 BYTE 30H OIX!6'3 OF04 oe BYTE 001 00064 OFC5 28 BYTE Z8H OOQt.S OFO; 1E: BYTE 1SH 000f.6 OF07 38 BYTE 3eH 00067 OFCJfl 04 BYTE 04H OOO!.S OFO? 24 BYTE 24H OOI)e~· OFOA 14 BYTE 14H 00070 OFOB 34 BYTE 34H 0007! OFOC OC BYTE OCH 00072 OFOD 2C BYTE 2Cli 00073 OFOE 1C BYTE !Cli 00074 OfOf 3C BYTE 3C1i · 1)0('75 OF!O 02 BYTE 02H ooon DF11 r BYTE 2:::!1 00077 Clf"l2 12 BYTE 12H 00tJ78 OF13 32 BYTE 32H 0'!07? OF14 OA BYTE (JAW 0008'j (,.1 5 ~ BYTE 2Aii 00081 OF16 !A BYTE lAH 00·~82 OF17 3A BYTE • 3tVl OOOS? OFJf (I~ BYTE 06H 00084 Ott? 2e. BYTE 26H ®e5 OF 1t; Jf. BYTE l6H OOOB:. OF 1& 36 BYTE 36H 00087 OFJC 0£ BYTE OEH 0(11).?.:' OF 1D 2E BYTE 2E~ 000?~ Cf !E !E BYTE 1£~ OOC·~C OF1F 3<: BYTE 3EH TEHR(li!X Z80 AS?! 'v'3. 4 Pll6f

f+fH J2 ~~lNG W!NOCIW CC£F!C lENTS +H++

(1()1)~4 OF~~ 3D(IA W!NOO~DE Wffi[ OOA3DH ~ (1!'2: BSOA ll)R[; ()().;8SH 00096 OF24 b-'30f 1.0\:• OOF&?.tt 000'?7 OF2b Df.lCl[ IG'I1 OC([•BH (Y)(l"S 01':-8 D[~•E IG:[I OOE~~IH 0((1'""~ (f:J; tS ll loiJF:fo 0116?H IXlf(l(t OF2<: 72H Wf.f'(•. 0147~ OOIC! ('f~ l)t\3 .~P.D 01804/i oow2 OF3t) o:rc ··IKfi'D OICC•~H 00 l 03 OF~2 6820 li)Rft 020t-SH 00104 OF~ 2C25 WORD O~XH 00105 OF3~ 47.:A lot'fl.D . 02A4~ 001 06 OF3S 982F I«F.D 02F9Ei'" 00107 OFJA 2C3S IUD 0~~)< 001 OS OF3C ES:41 IKIRD 03AB.-t 001 0? OF3£ 8:340 U:D 040BSH 00110 OF40 Ot-46 IKh[t 046'-e<-< 00111 OF42 704C ~F:~' 04C7(1H 00 liZ OF 44 3852 l(fj) 05232.ii 00113 OF46 rf57 IUD 057[fH ~~w 00114 OF43 55;[1 WOF:D -.) .. 00115 OF4A SF62 IUD 062f>FH 00! lb OF4( 7067 ~"··"' 0077DH 00117 OF4E 146C IUD ObC14~ 00118 Of'SO 4770 ~ 07047H 001 !9 OF52 0074 lliRC 0740!).1 00!20 OF54 5(77 IM}R[I OiiSCt< 00121 OF56 2474 ~Ur·•. 07A:AH · 001= OFS9 T2.7C IIJil[l (l7C7;:H oo m OF'SI\ 2D'E ~RD . O?E:..I'lH 00 I Z4 Of'St ST7F ll(f'.D 07F57H 00 12'5 OFSE EC 7F I«F.D 07FECli

H+H DPOIE~TIAL CSII£/COS!fEl CGEF!Cl~T t+t+t

00!29 OF60 7F0C' EXPTAEL .~P.r< (l(l(l;'"H 0013(1 OF12 7£1): lllRD OOC7EH 00!31 OF&4 7Dl? WOP.D 01 C?ftt 0013:' OFM K""5 1¥.1RD 0-:::7~ oc.o:· CFi:.< 7:..?1 loOP'•·• 0317514 00134 OF&t. 702C IIJF::• 03C7(JH (1()135 OF6C 6A47 WOPI' 047t4H 00136 OF6E 631 ~(1 05Jt.:tt 78

Q '

TEKTR~l!X zao ASI'I v3. 4 PAG£ ~·

00137 ('f7(1 5A5I: t.IJRD O~oA:oAH Oo:'i:::; CIF7:· 51~2 ~P.~: ()t.:2~·!!-' 00130 Of74 4'U. WORr 06A47H (~W~ O!'io Xi! Wif.~· 070:H 00153 OF90 M:A lo(IRD ~AAbli 00154 OF92 9E51 lo(l;;I: OS!?EH OO!S OF94 9&47 lol)l\[1 0479~ .. 00!56 0F"'6 90): ~[· 03t 00H oom OF9S su II)R!) 03188~ 00!58 OF9A Sb:-5 ~R[I 0258!."! 00!59 OFQ( 8319 WORD 0!98}i 00 I 60 OF9E S20C wef'll (l(l[S2H

00162 SECTION CTCVCTRS. ~BSOLLITE 001~3 OFFO CP.J OFFOH 00164 OFFO ((l(l(• :> CTC~·~TR ~D JTCI.}T 0('1e5 OFF2 0000 ) \o'OR:) OOHLT OCit·t· OFF4 ((1(1(1 > 1.0\[1 . OOtt. T 00 W OFF 6 OO

OOit? RONS' J~.S, ABSOLUTE OOPO OI=FE OFFEH 00171 OFFE 9ES"5 OS57£H I 79

l'EKTJOjiX 280 AS!! V3. 4 PAC£ b

00173 ~ mm.s 00174 0000 (JlG OOOOH 00175 IIW'E COO'LOO 0017b !l.OBAL ITOOT oom !l.~ IKH.T 00178 !l.OIIAi.. ten: 00179 G..ClW.. CLRM 00180 !l.OBtL CLCTC 00181 G..ClW.. BITRV 00182 !l.OBAL PGCTC 00183 !l.OBtL FFTCL 00184 !l.OBAL IIPUT 00185 !l.IIW. IIItm OOISb oooc CTCO EQU 0101 00187 OOBD CTC1 EQU OBGI 00188 001£ CTC2 EIIU O!EH 00189 001F CTC3 EQU OlfH 00190 fllllllllllllllllllllllllllllllllllllllllllllllllflllllllllllllll 00191 f 00192 • mm.: CIJlTRil.. 00193 f 00194 f \9!5Itli 0 REVISICII DATE: 7-20-84 00195 f 00196 f FIKTICII: !lAIN (XlTJl(L ~ au:u.ATE b4 POINTS FFT 00197 f 00198 f EHTERED FRill: 10£ 00199 f ·oo200 f SI.B!OOTIIf:S ClUED: ten:. ClJIM,CLCTC,PGCTC,FFTCL; IIINOO 00201 I 00202 I REGISTERS AFFECTED: A,B,C,D,E,H,L,IX.IY 00203 I 00204 f IEOIES AFFECTED: ILL 00205 I 0020b I POOl AFFECTED: tti 00207 f 00208 11111111111111111111111111111111111111111111111111111111111111111 00209 00210 11111111111111111111111111111111111111111111111111111111111111111 0021! ; f 00212 f IEGIN mm. ll1IU..E ; 00213. t DISABlE UITERRtPT AHD SET IHTERRt.PT TO ltJfE 2 00214 I f'R(GlAII IHTERRlPT VECTER AHD STACK POlllTER 00215 t TEST IEimiES IRIJI AHD RMl oo21o I RESET RAI! lelfliES 00217 t RESET ere ·CWHELs 00218 -; t PROORAo'! CTC atWnS 00219 ·I t ENABLE JHTERRt.PT 00220 I InmiL POI£R IS IF 00221 I · DlSAIU WTPIJT INTERRlf>T ICIWf£L Ol 00222 I FETOl b4 llf'UT 5m'I..ED DATA 00223 t EJWU OOTPt1T INTERllf'l IEVERY 2 ItS l 00224 t RESHAPE Ilf'UT SIQIW. BY ~ WINOOW 00225 t PERFCflll FFT CAI..Cll.AT!tli 80

zeo ASII V3. 4 7

00226 1 IIEiflRIW:£ OOTPliT ~TA USIM1 BIT~ oom I EJIIOO '00228 I END. com. IOU.£ 00229 .I 00230 Ill i 1111111111111111111111111111111111111111111111111111111111111 0.!.

~IX Z80 ASt1 V3.4 PAl£ 8

00232 0000 F3 awn. DI 00233 0001 ED5E J" 2 • 00234 0003 3EOF LD A.Hl ICTCVCTRI ; SET INTERRI.f'T REGISTER TO HIGi BITE .0()235 0005 £1)47 LD loA I Cl' CTC JNTB!RI.J'T VEtTER 0023b 0007 310014 LD SP.ENDSTACK : SET STACK POINTER 00237 OOOA COOOOO ) CtLL fEID( ; O£CK teo!IES 00238 0000 cooooo ) CtLL . a.RM ; INITIALIZE fWf 00239 0010 0604 LD Jj,4 00240 0012 cooooo ) COOl. I CtLL Q.CTC ; ClEM CTC INTERRlf'T 00241 0015 IOFB D.JI2 COOl. I 00242 0017 cooooo ) CtLL POCTC ; PRtOWI CTC 00243 OOIA FB EI ; ENABLE JNTERRtPT 00244 OOIB 3EB7 COOL2 LD Ao10110111B ; RESET CTCO 00245 OOID.D39: WT (CTCOI,A 00246 OOIF COOOOO ) CtLL IN'UT ; IIFUT SAif'I..IIll OOTA 00247 0022 3EIF LD AolFH ; L.OOD CTCO IIITH 2!tS Til£ ~TAHT 00248 0024 D31(: w; ICTCOl.A 00249 002o cooooo > CIU 11110) ; 00 IIIHIOI !itW'll«l Cl' llf'UT OOTA 00250 0029 cooooo > CtLL .· FFTCl ; m CALClLATIOO oozst ooze CDOOOO > CtLL BITRV ; WTPUT BIT REVERSE 00252 002f C31BOO .1' CIWil.2

00254 0038 II!G 0003Itl 00255 0038. cooooo > CtLL IOILT ; WL T PROOIWI .. 00257 0060 II!G 00066H 00258 0060 ·COOOOO ) CtLL IOILT ; WLT f'RIXJW1

00200

.. 82

Z~ ASII V3.4 SVIIIa. TAll.£

ClRSIZE 0:£0 G CTCO- OOOC CTC1- OOBD CTC2- OOIE. CTC3- OOif EJIDSTACK 1400 NSAifi.E 0040 G mm.s SECT!~ ABS(LlfTE 100691 ·

. awn.- 0000 awi'Ll- 0012 aJffi.2 - 001B

CTCVCTRS SECTICJi AB&l.UTE l(f'F81

CTC\tTR m:o G

RAllS SECTICJi ABSW1TE (1240 I

COS- 1100 G DATAl" - 1080 G bUM..- 1000 G WTPIJTC H02 G · RM- 1000 G Sit£- 1101 G SPTWT - 1200 G. SPTRESL 1180 G x-- uro o· Y --1105 G

Rti1SltiS SECTICJi ABSCI..UTE 110001

IOtSltt - lfFE G

TAlll.ES SECTICJi ABS(LlfTE IOFAOI

BITRSI. T OFOO G EXPTABl OF60 G IIIN!OO£ oF20 G

BITRV t.JOO..ND ILOBAL

" . . Ilf'IIT I.NICU4l: GLOM: ..

ITWT lNlOOND GLoofL •. leD( lHICitiD GLOBAL

. !'OCTC t.JOO..ND GLOBAL

IIINOO lHIClMl GLOBfi.

260 SW!CE LII£S 260 ASSEIIa.ED LII£S 28354 BYTES AVAILABLE

))) l«l ASSallll Y ERROOS !ElECTED «< 83

TEKlRQ'IIX 280 ASl'l \13. 4 Pia

00001 IW!E FFTCLOO .00002 SECTICW FFTCLS 00003 GLOBAL FFTCL 00004 GLOBAL DATARL 00005 GLOIW. DATAl II 00006 GLOBAL SPTRESt 00007 GLOM.. BTFYA 00008 GLOBIV.. sm11 00009 GLOBAL BTFYC 00010 GLOBAL BTFYD 00011 GLOBAL BTFYE 00012 GLOBAL BTFYF 00013 GLOBAL SOCWI 00014 I 1111 I llllllllllllllllllllliiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiH+H 00015 t 00016 • ma.: m CIILClUITICW 00017 t 00018 t \IERSICW 0 REVISJCW DATE: 7-5-84 00019 t 00020 t RKTJCW: PERFO!i11 m CALClLATIOO USING 00021 t IECJIW. IN FREQltN::Y IIEH«JD 00022. f 00023 t ENTERED. FRO!':: CWTL 00024 t 00025 t Sl.9\'0I.Jrii£S CALLED: BTFYA,BTFYB, BTFYC, BTFYD, BTFYE,BTFYF 00026 f SQUM 00027 f . 00028 t REGISTERS AFFECTED: A.B.C,D.E,H,L,Il,JY 00029 00030 . t 1£1100IES AFFECiED: DATA UOOOH - lOfFH) 00031 •· I 00032 t PORT AFFECTED: ~ 00033 I 00034 111111 fiiiiiUIIIIIIIIIIIIIIIIIIIHH+tt+tfiiiiiiiiiiiiiiiiHfttt 00035 . 00036 '. . I 11111111111111111111111111111 lllftHttt IIIIIIIIIIIIIIIIIIIIHtff 00037 t OO

TEKTJI(W!X 280 ~ V3.4 PAGE 2

00054 f ta'IPIJTE FFT - CALL BTFYC ' 00055 f ADJJST POI NT£RS 00056 t ENDDO 00057 f SET REft./II'Wl!NARY MTA POJilTERS 0005e f SET EXI'B'£NTI~ POINTER 00059 f CO'f'UT£ FFT - CALL BTFYD 00060 f SET ~/II'W>INARY DATA POINTERS 00061 f SET EXMENTI~ POINTER 00062 f CW'UTE m - CAU. BTFVD 00063 f SET REAL/I~I~RY DATA POINTERS OOOb4 f SET EXPCMNTI~ POINTER ()()Ob5 f CM'trTE FFT - CAU. BTFYD OOObb f SET REA.IlllAGINAAY DATA POIMTERS 00067 t SET EXPCWJTI~ PO!tiTER ()()008 .,. f CM'UTE m - CALL BTFYD 00069 f SET REAL/IMGINARY DATA POINTERS 00070 f SET EXPCmlT I AI. POINTER 00071 f COI'IPUTE m - rJU BTFYE 00072 f SET ROC/ll\t\GJNARY MTA POINTERS 00073 f SET £Xf'(J£1,'T I~ POINTER 00074 f CW'UTE m - CAU. BTFYE 00075 t SET REAL MTA POINTERS 00076 t Cilf'UTE FFT - rJU BiFYF ooon- t IWiT IL eotf'LETE AlL DATA - 00078 f SET MTA ADDRESS POINTER 00079 f ~ Tl£ DATA- CALL SQUAll 00080 f REPLACE MTA WITH ITS SClME RESltT 00081 f ENDOO 00082 t IWlTIL roiPL.EiE 00083 f ADD (R£AI..H2l AND (li'W!JIW?YH2l 00084 f STOOE RESU. T IN ASSlCHD ADDRE?S - SPTRESL 00085 t ENDDO 00086 • END ma.. toDU..E 00087 :- f 00088 llllfllllfllllllllllllllliiiiiiiiHtttHHHfffHHHHHHIHHf ..

; 85

TEKTRONIX 180 ASI1 V3. 4 PAGE: 3

00090 0000 00 FFTCL tO' • 00091 0001 010000 FFTA LD BC,OOOOH l INITIAliZE !XEFICIOO POINTER Ooo92 0004 cs FFTA1 PUSH BC ; SAVE COCFICIENT POINTER 00093 ~ DD210000) LD II,DATARL ; SET REAL DATA POINTER 00094 0009 FD210000) LD IY,DATAIIf ; SET IIIAGINARY DATA POINTER 00095 OOOD DD09 ADD IX.BC ; AD..UST li'm. DATI. POINTER Ooo96 ooor FD09 ADD IY,BC I AD..mT II1AG DATA POINTER 00097 0011 r:ooooo ) CALL BTFYA ; mf'UTE FFT LN"d A 00098 0014 C1 POP BC ; RETRIEVE COCFICIENT POINTER 00099 0015 03 JNC BC ; AD..UST COEFICIENT POINTER 00100 0016 03 INC BC 00101 0017 79 LD A.C ; TEST LOCf' Wf'UTED 00102 0018 FE40 CP ·4Ui 00103 001A 2

'TEK'TR(WJ X 280 ASI'I V3.4 PPIX. 4

OOH3 00144 0001 DD2J0000) FF1D LD JX,DATAAL ; SET REAL DATA POINTER '00145 0005 FD210000) LD IY.DATAII'I ; SET IIIAG DATA POitfTER 00146 0009 010000 LD BC.OOCIOH ; SET CW: TABLE POIIITER 00147 006C CDOOOO > CALL BTFYD : CW'lJTE m lE'.U D 00148 OOOF DD210200> LD IX.DATARL +2 ; SET REAL DATA POINTER · 00149 0073 FD210200) LD JY,DATA!I'I+2 ; SET IIIAG DATA POINTER - 001so oon ouooo LD BC.0010H : SET COO: TABLE POINTER 00151 007A CDOOOO > CALL BTFYD : CM'UTE m mn n 00152 007D DD21 0400) LD JX,DATARL+4 ; SET REAL DATA POINTER 091:;3 0001 FD2HI400) LD JY,DATAJI'I+4 ; SET JKAG DATA POINTER 00154 0085 012000 LD BC.0020H : SET CCH TABLE POINTER 00 I 55 OOSS CDOOOO ) CALL BTFYD ; CCtf'LITE m LEVEL D 00156 OOSB DD210600) LD JX,DATARL+6 ; SET REHl DATA POl NTER 00157 000' FD210600) LD JY,DATAII'I+6 ; SET JI'IAG DATA POINTER 00158 0093 OJ300C: . LD BC.0030H ; SET COCF TABLE POINTER 00159 009l. cooooc. > CALL BTFYD ; W!PUTE m LEVEL D 00160 00161 0099 DD210000> mE LD JX,DATARL ; SET REAL DATA POINTER 00162 009D FD210000) LD IY.DATAII'I ; SET II'AG DATA POINTER 0011.3 OOAI 010000 LD BC;OOOOH : SET COEF TABLE POI tfTER 00164 OOA4 CDOOOO > CALL BTFYE ; CCtf'l!TE m LEVEL E 0011.5 00A7 DD210200> LD JX,DATAAL+2 •; SET REAL DATA POINTER 00166 OOAB FD210200> LD IY.DATAII't+2 ; SET II'IAG DATA POINTER 00167 (J()I!f 012000 LD BC,0020H : SET COEF TABLE POI tiTER 00168 OOB2 CDOOOO > CALL BTFYE ; COIIPUTE FFJ LEVEL E 00169 00170 0085 DD210000) FFTF LD IX,DATARL ; SET REAL DATA POINTER 00171 0089 FD21 ()()()()) LD JY,DATAII'I 00172 OOBD COOOOO ) CALL BTFYF ; Wf'UTE m LEVEL F 00173 00174 ooco O&.. LD JX,DATARL ; SET REAL DATA POINTER 00188 OOEI FD210000) LD JY,SPTRESl ; SET SPECTRlltl RESULT POINTER 001 S9 OOE5 0640 LD B.b4 : SET COlfiTER 00190 .ooE7 DDbEOO mru LD L.C IX+OJ ; GET REtl. SOOARED DATA 00191 OO£A DD6601 LD H. (IJ+1 J 00192 OOED DD2:3 !lot IX ; JtOlDENT DATA .POINTER 00193 OOEF DD23 JIC IX 001 04 OOF 1 DDSE7E LD E. CIX+I26J ; GET IWlllG I NARY SQUARED DA 1A 00195 OOF4 DDS67F LD n.m+I27J 87

TEKTR(Il!X 280 ASI1 Y3. ~ PAGE 5

00196 fXF7 19 ADD K..DE ; !REALH2l+CIMGH2l 00197 OOFB FD7500 LD IIY+Ol,L ; SAVE RESULT ·oo19e OOFB FD7401 . LD !IY+1l.H 00199 OOFE FD23 INC IY ; INCRE!1ENT SPECTRUII REStL T ADffiESS 00200 0100 FD23 Jt(; IY 00201 0102 10E3 D..tlZ mCL2 00202 0104 C9 RET . 00203

:: .

... • ·- 88

TfKTRCWIX 280 ASI'I V3. 4 SYI1BCL TABLE PAGE b

FFTC.S SECTIOO 101051

FFTA- 0001 FFTAI- 0004. FFTB- OOIC FFTBI- OOIF me- 003D FFTCI- 0042 ma..- oooo G FFTU.I- OOU. FFTCI.2 - OOE7 FFTD- 0061 FFlE- 0099 FFTF- OOB5

BTFVA f.Ml(UID GLOBAL

BTFYB IJNBCU'ID Cl.OBAL

BTFYC IMIOOND GLOBAL

BTFYE IJIBruiD GLOBAL

DATA!t'l tJro..WD GLOBAL

!JATAR'~ ltl!ltlJND GLOBAL

SPlRESL lllBOliND GLOBAL

203 .SW\'CE LINES 203 ASSEJmLED Lll£5 28t.32 BYTES AVAILA!U

))) Ill ASSEI!il Y ERRffiS DETECTED <«

.... . 89

m:TI\'Illll zso ~ V3.4 PAGE

00001 NAIIE BTFYAOO 00002 SECTI!W. BTFYAS -()0003 ll.OM... BTFYA. 00004 ll.OM.. X 00005 ll.OBAI.. EXPTABL OOOOb ll.OBAL. cos 00007 ll.OM.. SII£ 00008 ll.OBAI.: PU.T 00009 11111111111111111111111111111111111111111111111111111111111111111 00010 f 00011 t BTFYA: MTERFLY CM'UTATIC»i ~l A 00012 00013 t \E!SIIJi 0 REVISIIJi DATE: 7-5-84 00014 f 00015 t FOCTICW: 00 FAST FllRIER TRAI6Ill!IATIC»i CM'VTATIIJi 00016 t (W Ilf'UT DATA I!Estf.. TED IN 1ST l£VEL 00017 t t REAL DATA ADffiESS IN H 00018 .. t t IIIAG DATA ADMESS IN IY · 00019 ·I t t ct€FICI lENT TABLE CfFSET IN BC 00020 f . 00021 t ENTERED Fila'!: FFTO.: 00022 f 00023 t SUBROOTINES ClUED: llllT 00024 t 00025 t REGISTERS AFFECTED: A,B,c,D.E.H.l 00026 00027 t 1£1miES AFFECTED: DATA llOOOH - 10FFHJ 00028 f 00029 t Pall AFFECTED: NM 00030 f 00031 1111111111111 I I 111111111111111 I 111111111111111111111111111111 II It 00032 00033 I II IIIIJIIIIIIIIII lllllllllllllllfff+Htffffffff+HtH+H+HHHif 00034 t 00035 t BEGIN BTFYA IIOOOLE 00036 t GET PRIIWlY DATA :. FINJ 00037. ., 1 GET SEWIIIARY DATA - FIN-+Kl 000~ .· t cotf'UTE FINHIN+K) RESULT STmES IN PEIIftRY - X 00039 I 00'11'1JTE FINl+fiN+Kl RESll.T STffiES HI F!Nl 00040 t GET APPRm!IATE DATA FRCtl EXPIJiENTIAl TABLE Fal COS AND SINE ()()(14! t rot'UTE - JtSII£ STmE RESlA. T IN I IN+Kl Ooo42 t C()!P\.ITE XtCOS STOOE RESQ T IN FIN-+Kl 00043 t Tt£ RESlt T N IINJ IS ZERO . 00044 .t . END BTFYA l()rut.£ 00045 00046· 11111111111 ff+HH+IIIIII f II II fH+Hft+IHIIIII f II II II llllllf#Hf 90

TOORONIX zso AS!'! V3. 4 PAll: 2

00048 0000 DDOEOO BTFYA LD L,!IX+OI ; LDAD FIN! IN ll 00049 0003 DDOb01 LD H.IIX+11 "00050 0006 DD5E40 LD £, (IX+b41 ; LOAD FIN+IO IN l:E 00051 0009 DIJ564l lD D,IIX+651 00052 oooc E5 PUSH ll ; SAVE FINJ 00053 0000 B7 m A ; ClEAR CARRY 00054 OOOE EDS2 SBC ll.I:E ; CM'UTE FINJ-fiN+KJ 00055 0010 220000 ) lD IXJ.Il ; STOOE IN 1£110RY OOC5b 0013 E1 PCP Hl ; RETRIEVE FINJ 00057 0014 19 ADD ~~.·.oc ; W1PUTE FINJ+FIN+KJ 0005S 0015 CB2C SRI; H ; SCALE-DIVIDE BY 2 . 00059 0017 CBJD RR l 00060 0019 DD7500 lD IIX+OJ,L. ; STOOE IN FINI 00001· OO!C 007401 lD IJX+li.H 00062 OOOb3 00 1F 210000 ) lD ll.EXPTAil ; POINTER TO EXm£11Tlft. TABLE OOOb4 0022 . 09 ADD lt.,BC ; ADJJST POINTER ~ 0023 7E lD A. till ; GET COSH£ DATA OOObb 0024 320000 ) lD ICOSJ,A ; SAVE COSH£ DATA 000£.7 0027 23 INC ll ; ltOlEIIDlT POINTER 00068 0028 7E lD A.llll · ; GET SINE DATA . 00069 0029 320000 ) lD ISINEI,A ; SAVE SINE DATA 00070 002C EDSBOOOO) lD · [)E, IXJ ; RETRIEVE X DATA 00071 0030 cooooo > CfLL llll.T ; roiPUTE XfSINE 00072 0033 7D lD A,L. ; COO'v'ERT RESl.lT TO NEGATIIVE 00073 0034 ED44 NEG 00074 0036 FDn40 LD IIY+b41,A ; STOOE IN IIN+KI 00075 0039 3EOO LD A,OO 00076 003B 9C sse A.H ooon 003C FDn41 LD IIY+OSJ,A 0007B 00079 OO:F 3AOOOO ) LD A,ICOSI ; LDAD l'l.lTl Pl.. I ER 00080 0042 ED5B0000) LD DE, IXl ; LOAD llllTIF'liCAND 00081 0046 CDOOOO > CfLL IU.T ; tnf'\.ITE XfCOS 00082 0049 DD7540 LD IIX+b41,L ; STOOE IN FIN+KI OOOB3 004C DD7 441 LD IIX+65J,H 0~ 004F C9, RET 00085 '- 91

TEKTROOIX ZSO ll~ V3.4 SYIIEO.. TABLE PAGE 3

' . BTFYAS SECTJOO 100501

BTFYA - 0000 G

COS liOOJND IX.OBAL

£XPT AR tNntiD GLOBAL

IllT UNBOOND GLOBAL

SIP£ UNBCWD IX.OBAL

X UNBOUND GLOBAL

85 SOURCE Lli£S 85 ASSEI'!BLED Lli£S 28S40 BYTES AVAILABLE

))) NO ASSe!B'~Y ERRffiS DETECTED ((( 92

TaiRONIX zso ASI'I V3. 4 PAGE

00001 twE BTFYBOO . 00002 SECTICtl BTFYBS 00003 GlOBAL BTFYB 000(14 GlOBAL X 00005 GLOBAL y OOOOb GlOBAL EXPTAR. . 00007 GlOBAL cos 00008 GlOBAL Sit£ 00009 GlOBAL Pl.lT 00010 IIIIIIIIIIIIIIIIIIIIIIIIKH+++HIIIIIIIIIIIIIHf+tHH+HH++Hf "00011 t 00012 t BTFYB: BUTTERFLY rof'IJT ATI Ctl lE\n B 00013 f 00014 t VERSICtl 0 REVISI!ll DATE: 7-5-84 00015 .. OOO!b t FI.WCTION: 00 FAST FCU1IEF. TRANSFCP.!'IAT!OP.' OO'IPUTATI!ll 00017 t ON 1ST lE\n DATA RESt!.. TED IN 2ND LEVEL 00318 t t REAL DATA ADMESS IN IX 00019 t t IIIAG DATA ADDRESS IN IV 00020 t t C!EFICIIENT TAIU £fFSET IN BC 00021 f 00022 1 ENTERED FROM: mCL 00023 t 00024 t SUBROUTINES CALLED: l'tllT 00025 ..' • 0002b ' t REGISTEF:S N'J'ECTED: A.B.c.o.E;H,L 00027

00028 . ' t I'EIKRIES AFFECTED: DATA (!OOOH - IOFFHl 00029 ·' f 00030. t PffiT tfFECTEIJ: tO£ 00031 f 00032 ftfttHftHU+HftHftftHHtftf++HftftftftHftftf+tfftftHttfff 00033 OOO:M Htf++Hftftf+tfftHUtfftHUffllllllllll HHftHUftfHffHHft 00035 .' ; f 0003b t BEGIN BTFYB I'IODU..E 00637 I GET PRir.ARY DATA - FIN) .

00038 ; t !£T SECCtiDARY DATA - FIH+Kl . 00039 • COMPUTE FINl-FIN+I-:l RESULT STORES IN P£11ffiY - X 00040 t COPf'liTE FIN l +F IN+K l REStl T STCllES IN FIN l 00041 t !£T ~lATE DATA FROI1 EXP0t£NTIAL TABLE Fffi COS AND SINE 00042 t Ol'IPUTE - XtSit£ STCllE RESLlT IN )(N+Kl . 00043 t Ctl11'\JTE XtCOS STOOE RESLlT IN FIH+Kl 00044 1 !£T PRI~RY DATA.- FCN+I1l 00045 I !£T SECOODARY DATA - FIN+t1+Kl 00(146 t COPf'liTE FIN+t1l-FIN+I't+Kl RESLlT SHF.ES IN 11El'UlY - X 00047 t rof'UTE FIN+11l+FIN+I1+t:l R£Sll.T STORES IN FIN+I1l 0004S I GET PRI~Y DATA -)(N+I1l 00049. t ~T SECCtiDARY DATA - HN+11+Kl OOlf...O t COit'IJTE )(N+t1H IN+11+Kl STCf'i RESULt IN X 00051 t COPf'liTE )(N+t1lt)(N+I1+Kl STORE RESLlT IN HN+I1l . 00052 I COPf'UTE XtCOS+YtSit£ STORE RESllT IN FIN+I1+Kl OOO".J + COPf'UTE Y+COS-XtSINE STCllE RESULT IN I IN+I1+Kl 9.3

'TEKTRONIX ZSO ASI'IV3. 4 .PAGE 2

00054 • END BTFYB lt.1Dll.E 00055 f 00056 f 11111111111111 Ill H..ntf+f+I.HHfHf+f+lftHt+tt+tHt+tfHt+tf

'. 94

TEKTRONIX ZSO ASM V3.4 PAGE 3

00058 0000 DDOiOO BTFYB LD L.CIX+Ol ; LOAD FIN! IN li. 00059 0003 DD660 1 LD H,CJX+1l • OOObO 0006 DDSE20 LD £,(!X+32l ; LOAD FIN+K) IN C£ 00061 0009 DD562 1 LD D.!IX+33l 00062 oooc E5 PUSH HL ; SAVE F!Nl 00063 OOOD B7 00 fl ; CLEAR CMRY OOOb4 OOOE ED52 SBC Ji.,C£ ; CO'Pt.ITE F!Nl-FIN+Kl 00065 0010 220000 ) LD !XI .HI. ; STOOE IN l'la!ORY OOOU 0013 El Pa' lt. ; RETRIEVE FINl . 00067 0014 19 ADD lf..,DE ; COif'UTE F!Nl+fCN+Kl 09068 0015 CB2C SRA H ; SCALE - DIVIOC BY 2 00069 0017 CB1D RR L 00070 0019 DD7500 LD !IX+Ol,L ; STORE IN F!Nl 00071 001C DD7401 LD !1X+1 >,H 00072 00073 001F 210000 ) LD lf..,£Xf'TABL ; POJt.ITER TO Eri'OI£NTift. TABLE 0007 4 0022 09 ADD lf..,JlC ; ADJJST POit.'TER OOD-75 0023 7E u A, fit.) ; GEi COSINE mTA 0007 6 0024 320000 ) LD !COSl.A l SAVE COSINE DATA . r:xxm 0027 23 II£ lt. ; ltD\EJ'£1JT POWTER 00078 0028 7E LD fl, (fl.) ; GEi SINE DATA 00079 0029 320000 ) LD !Sit.fl,A ; SAVE SitE DATA 00030 002C ED5BOOOO) LD IE. !XI ; RETRIEVE X MTA 00081 0030 cooooo ) au lllT ; CM'IJTE XIS! NE 00082 0033 7D LD A.L . ; rowan RESULT TO 1£GAT11VE 00083 0034 ED44 .. I£G 00084 oo3b rnmo LD !IY+32l .A ; STORE IN HN+Kl 00085 0039 3EOO LD fl,oo OOOS6 003B 9C SBC A.H . 00037 00~ FD7721 LD 11Y+33l,A 00088 .. 00089 003F 3AOOOO ) LD A.!COSI ; LOAD f'U. TIPLIER 00090 0042 EDSBOOOO) LD. DE.CXI ; LOA!d!l.l TIPLICNID 00091 0046 cooooo ) au l'!llT ; C01'UTE XtCOS 00092 004S· DD7520 LD IIX+32l ,L ; STOOE IN FIN+Kl 00093 oo4c ml7421 LD IIX+33l,H 00094. ' ., 00095 004F DDbE 40 BTFYB1 LD L. fiX+64l ; LOAD FIN+Ml IN fl. 00096 0052 Dllot.-41 LD H. I IX+65l 00097 0055 DDSC:bO LD E. I IX+96) ; LOAD FIN+II+Kl IN DE J)0098 0058 DD5b61 LD n.m+97> 00099 OOSB E5 PUSH HL ; SAVE FIN+M) 00100 Olf...C B7 00 A ; CLEAR CN

IDJRONIX ISO ASI1 V3.4 PAGE 4

00111 0074 FI&t.O LD E.IIY+9bl ; LOAD I !N+M:l IN DE 00112 0077 FD56b1 LD D, !IY+97l 00113 007A E5 PUSH IL : SAVE I !N+11l 00114 007B 87 00 A ; CLEAA CMRY 00115 007C ED52 SBC IL.DE ; O:W'l.llE lUf+tiH !N~+Kl 00 II b 007E 220000 ) LD (Y),IL ; STffi£ IN I'El'lffiY 00117 0031 El POP IL ; RETRIEVE I !N+tll 00118 0082 19 ADD H....DE ; Wf'UTE I! Nttl l t I!N+I'I+K l 00!19 0083 CB2C SRA H ; SCI>il - DIVIDE BY 2 00120 ooe5 CB1D RR L 00121 0087 FD7540 LD !IY+b4J,L ~ STORE IN I(~) 00122 ~ FD7441 LD !IY+bSJ,H 00123 00124 OOSD 3AOOOO ) LD A, !Sit£) ; L.OOJ I'ILl TIPLIER WITH SINE DATA 00125 0090 EDSBOOOO> LD [£, (V) ; LOA!• ltl~ TIPl.ICAND WITH Y DATA 0012t. 009~ CDOOOO ) CALL fU.T ; Cl11PUTE YtSINE 00127 0097 E5 PUSH IL ; SAVE REStlT 00128 0098 3tf.i000 ) LD A, !COSJ ; LOAD 11\.lTIPLJER IIITH ~: DATA 00129 0098 EDSBOOOO> LD [£,(X) ; LOAD IllTIPLICAND WITH X DATA 00130 009F CDOOOO ) CALL 11lLT ; Wf"JTE XtctJS 00131 OOA2 Dl p(f [£ ; RETRIEVE YtSINE 00132 OOA3 19 ADD If...,[£ ; COf'lJTE XfCOS+ YtSINE 00133 OOA4 DD7Sb0 LD !lX+96l.L ; STOOE RESLtT IN F!N+tt+IO 00134 OOA7 DD7 461 LD LD . [£,(X) ; LOAD f'l!.l TIPLICAND WITH. X DATA . 00137 0081 cooooo ) CALL IU.T ; C01PUTE XIS INE 00138 OOB4 E5 PUSH IL ; SAVE RESlLT 00139 0085 3AOOOO ) LD A,!COSL ; LOAD tlJI.. TIPLIER WITH COS DATA 00140 oose EDSBOOOO> LD D£, (V) ; LOAD tlJI.. TIPLICAND WITH Y DATA 00141 OOBC CDOOOO ) CALL IU.T ; eotPl.'TE YtCOS 00142 OOBF D1 PCf' oc ; RETRIEVE XtSINE 00143 ooco 87 00 A ; CLEAR CARRY 00144 OOCI ED5i soc IL.DE ; W.PUTE VtCOS-HSJNE 00145 OOC3 fD75bO LD (!Yt9bl .L. ; STCf'.E REStlT IN J(N+tl+~ l 0014b OOCb FD74bl LD (!Y+97J.H · OOi4i OOC9 ~ RET 00148 ; 96

ZOO ASI'f V3. 4 SYIIBOL TABLE PAGE. 5

BTFYBS SECTI[W IOOCAl

· BTFYB - 0000 G BTFYBl - 004F

COS lllBOltiD ~OBAL

EXPTABL tJOO.JID GlOBAL

Ill.T IJIBOOID ~OBAL

148 SWlCE W£S 148 ASSOOL£D llt£S 28817 BYTES AVAJIJilU

>>> NO ASSEKBLY ERRORS OCTECTED (((

; '···

. - .. - ... . 97

TEKTROOIX 280 ASP! V3.4 PAGE

00001 NAP1E BTFYCOO 00002 SECTJrn BTFYCS 00003 . G.OBAL BTFYC 00004 G.OIW. X ODOOS G.OBAL · y 00006 G.OBAL EXPTAill 00007 G.OIW. tos oooos G.OBAL SINE 00009 G.OBAL IUT 00010 1111111111 II II II II II IIIIIIIIIIIIIIIIIIIHHHH+KH+tHH+HHH 00011 t . 00012 t BTFYC: ll!JTTEilFly IXK'l!TATICW LEVEl. C 00013 t 00014 t VERSIW 0 REVISIOO DATE: 7-5-84 00015 t 00016. t FI.NCTICil: DO FAST FOl~IER TAANSFORI":!Tl(ll CM'UTATION 00017 t 00 2ND L.E\IEl. DATA RESULTED IN 3RD LEva 00018 1 t REAL MTA ADIJ.'.ESS IN IX 00019 t t Ii'IAG DATA ADffiESS IN IY 00020 t t too= I CliENT TAELE OFFSET IN BC 00021 . t 00022 t E1ITERED fRa'l: mCL 00023 t 00024 • sumo:.rrrr£s CAllED: IU.T. 000:5 t 0002b . t REGISTERS AFFECT£D: A.B.C.O.E.H.L.!X.IY . 00027 t 00028 . I 1£1'01IES AFfECltD: DATA I IOOOH - !OfFill 00029 t 00030 t Pall TffECltD: lUi: 00031 t 00032 t+HHtKH+H+HIH+HHIIIIIIIII!IIJIIIIIIIIIIIIIIHH+IKH+H 00033 00034 +H+IH+Ht+H+H+H+ItH+HHHtHH+IH+ItfH.HHH+It+HHtH 00035 t OOOJt. t BEGJ N FTFYC l'tJOOLE OOo37 t GET PRIKARY DATA - FINJ 000~ t GET SEWNDARY Ot!ITI1 - FIN+KJ 00039 . 1 Cll1ME F!Nl-FIN+KJ RESULT STORES IN IEI'tJRY- X 00040 t CO!f''\JTE FINJ+FIN+n RESULT STCRES IN FINl t)(I04l 1 GET APPP.Cf'RIATE DATA FRO!I EXPONENTIAL TABLE FOO COS AND SINE 00042 1 COI'f1JTE - XtSINE STOh£. RESULT IN HN+IO 00043 t OO'IPliTE XtCOS STORE RESllT IN FUi+KJ 00044 t OOJNTIL COn>LETE ALL BUTTERfLY LOOPS 00045, t GET PRIIW!Y DATA - FIN+MJ 0004£. f GET SECCiiDMY DATA - FIN+M+KJ 00047 1 Wf'UTE FI N+!'ll-F IN+l'1+t:l RESll T STORES IN 11£11JRY - X 00048. 1 ru!PliTE FIN+fO+FIN+H+KJ RESULT STffiES IN f(N+f'lr 00049 1 GET PRIIIARY DATA -IIN+MJ 00050 t GET SECCWMRY DATA - I (N+M+KJ OOoS! t ~PIJTE liN+!'IJ-IIH+tf.tKJ STffiE RESU.T IN X 00052 t ln!F'UTE JIN+!'Il+IIN+H+Kl STffiE RESULT IN IIN+Ml 00053 1 tnf'liT£ XfCOS+YtSH£ STORE RES\JI. T IN FIN+H+Kl · 98

ID:Tml!X zso ASI1 V3.4 2

00054 4 ta'IPUTE YICOS-X•Slt£ STCflE RESLlT IN !CH+f1+Kl 00055 '. 4 ENDOO 00056 t END BTFYC 11JIU.E 00057 ~ 00058 ff+4ff+f44f~l41111111111111111111111111111~~ 99

,, ,j

ID'TRCtliX 180 AS!'! V3. 4 PAGE 3-

00000 0000 DD6EOO BTFYC LD (, IIX+OJ I LOOD FINl IN fl. 00061 0003 DD66QI LD H,tJX+ll 00062 0006 DOSE I 0 LD r.m+Jol I LOAD FIH+Kl IN DE 00063 0009 DD5611 LD. D,(IX+l7l 00064 oooc E5 PUSli fl. I SAVE FINJ 00065 OOOD 97 00 A ; ll.EAA CMRY 00066 OOOE EDS2 soc fl.,![ ; CM>lJTE FlNl-fiN+Kl 0006 7 00 l 0 220000 ) LD (X),fl i STffiE IN I'!Ef'llRY 0006S 0013 El f'(f' H.. ; RETRIEVE FIN) 00069 0014 19 MD fl.,[[ ; CU1PUTE FtiH+F I N+Kl 00070 0015 CB2C SRA H ; SCALE - DIVIDE BY 2 00071 0017 CBJD RR L 00072 0019 DD7500 LD UX+Ol,L . ; ST~ IN FlNl 00073 001C DD7401 LD IIX+1l,H 00074 00075 OOl• 210000 ) LD H...EXPTABl : POINTER TO EXPOt£NTJAL TABLE 00076 0022 09 ADD H...llC ; AOJJST POINTER 00077 0023 7E LD f,,(l{.) ; GEl COSINE DATA 00078 0024 320000 ) LD ICOSl,A ; SAVE COSH£ DATA 00079 0027 23 IN:: H.. ; ltVeENT POINTER 0000000287£ LD A.IH..l ; !U SINE DATA 00001 0029 320000 ) LD ISINEl .A ; SA\£ Sit£ DATA . 00002 002C EDSOOOOO> LD [[, lXI ; RETRJE\£ X DATA 00003 0030 cooooo ) CALL IU.T ; ~JTE XfSINE 00004 0033 7D LD A.l ; cttNERT RESll T TO t£GATII\IE 00005 0034 £])4.4 t£(i 00086 0036 FD7710 LD f1Y+11>J,A ; STOOE IN JIH+f( l 00007 00:-19 3EOO lD A.OO 00088 003B 9C SllC A,H ooOS9 003C FDnu LD I!Y+17J,A 00090 . 00091 003F 3AOOOO ) LD A.ICOSJ ·_ ; LOAD I1UL TIPLJER 00092 0042 EDSBOOOO> LD D£,(X) ; LOAD 1U. TJ Pl.! CAND 00093 0041> cooooo ) CAll. IUT ; CXt!PlfTE XtCOS 00094 0049 DD751 0 LD IIX+16l.L -; STffiE IN FIH+Kl 00095 004C 007411 LD IIX+17l .H 00096' 00097 004F 0603 LD B,3 ; S£l LOCf' CCWTER 00093 OOSi t5' · BTFYC! PUSH llC : SAVE LW ctUlTER o6o99 0052 112000 LD 1£,002QH ; S£l LOCf' CfFSET 00100 0055 DDJ9 ADD IX,OC ; AD..UST BUTTERFLY POINTERS 00101 00'57 FD19 ADD IY,OC 00102 0059 DDbEOO LD L.HX+Ol ; LOAD FIH+IIl IN HL 00103 OOSC DDbbOl. - LD H, IJX+ll 00104. 005F DD5E I 0 LD · E,IJX+lbl : LOAD FIH+ti+Kl IN [[ 00105 0062 DD56l1 LD D,m+l7l 00106 0065 E5 PUSH H.. ; SAVE FIN+l'll 00107 oou B7 OR A ; C!.EAA CMRY 00100 0067 EDS2 SBC ll.,DE ; COI'f'lJTE FIH+I1l-f1N+!1+Kl 00109 006 9 220000 ) LD IX! ,HL ; STffi£ IN I!EI'riRY -· · 00110 006C El POP fl. ; RETRIEVE FI N+!1 l 00111 0060 19 ADD H,.,[[ ; ro1PIJTE F< H+l'l) +F I N-!-l'I+K l 00112 006E CS2C SRA H ; SCAI.£ - D!VIOC BY 2

I 100

lEKTRtliiX 180 AS!'! V3. 4 PAGE 4

00113 0070 CB1D RR L 00114 0072 DD7500 LD IIX+OJ,L l STOOE IN FIN+IU 00115 0075 DD7401 LD CIX+!l ,H 001 It· 0078 FDbEOO LD L· IIY+Ol ; LOAD ICN+/11 IN HL 00117 007B FDt-601 LD H. !IY+1 I 00118 007E FDSE10 LD E. CIY+lbl : LOAD IC N+f'I+K I IN DE 00119 0031 FD56JJ LD D. IIY+171 00120 OOS4 E5 PUSH fl. ; SAVE I IN+I'Il 00121 0085 87 !JI A : CLEAR CARRY 00122 0086 EDS2 SBC ll..DE : W'IPLfTE· ICN+IIH IN+I'!+Kl 00123 0083 220000 ) LD CYl ,If. : STORE IN HEnJP.Y 00124 OOSB E1 Pa' HI. : RETRIEVE ICN+Ml 0012s ooec 19 ADD fi.,DE ; C(HPtJTE IC N+M H IN+II+Kl 00126 OOSD CB2C SRA H ; SCALE .~ DIVIOC BY 2 00127 008F CB1D RR L 00128 0091 FD7500 LD IIY+Ol,L : STORE IN I IN+I'Il · 00129 0094 FD7401 LD IIY+1J,H 00130 00131 0097 3AOOOO ) LD A· ISINE I ; LOAD n.JL TIPLIEI\ WITH SINE DATA 00132 009A ED5BOOOO> LD 1£, IYI ; LOAD I'IIA.. TIPLICAND WITH Y DATA 00133 009E CDOOOO > CIU IIULT : WIPUTE YfSINE 00134 OOA1 E5 PUSH fl. ; SAVE RESLl T 00135 OOA2 3AOOOO > LD A.ICOSJ ; LOAD l'lll TIPLIER WITH COS DATA 00136 OOA5 EDSBOOOO> LD 1£, lXI : LOAD l~.tTIPLICAND WITH X DATA 00137 OOA9 CDOOOO ) CALL lt.ILT ; C(t!PUTE XtCOS 00138 OOAC Dl POP IE : RETRIEVE YtSINE · 00139 OOAD 19 ADD ll..IE ; Wf'I.ITE XtCOS+YtSINE 00140 OOAE 007510 LD IIX+16J,L : STORE RESULT IN FIN+IT+Kl 0014bOOB1 DD7411 LD IIX+l7l,H 00142 OOS43AOOOO > LD A, ISJI£1 ; LOAD IUTIPLIER WITH SINE DATA 00143 OOB7 EDSF?OQO) LD 1£, lXI ; LOAD I'RJLTIPLICIWD WiiH X DATA 00144 OOBB CDOOOO ) CIU IIUl T - ; CM'LITE XtSINE 00145 OOBE E5 PUSH li. ; SAVE REruL T · 00146 OOBF 3AOOOO > LD A.ICOSJ ; LOAD llll.TIPLIER WITH COS DATA 00147 OOC2 EDSBOOOO> LD DE. IYI ; LOAD I'RJLTIPLIC~ WITH Y DATA 00148 OOCb CDOOOO ) CIU IIU.T : rot' LITE . YtCOS 00149 OOC9 DJ. . Pff' DE ; RETRIEVE XtSINE 00150 OOCA B? . !JI A ; CLEAA CARRY 00151 OOCB ED52 soc ft.,[( ; C0'1PlliE YtCOS-XtSit£ 00152 OOCD FD7510 LD IIV+16l.L : ST!JIE RESULT IN ICN+I'I+Kl 00153 OODO FD7411 LD IIV+I7J,H 00154 0003 Cl PCf' BC ; RETRIVE LOCP CWITER 00155 00[14 05 DEC B 00156 OOD5 C25100 >- .P NZ,BTFYC1 00157 OODS C9 RET 00158 101

ll(l ASI1 V3. 4 SYI'IBCL TArU PAGE 5

BTFYCS SECTJ~ !OOD9l

BTFYC - 0000 G BTFYC! - 0051

COS UNBCU~D ~OBAL

EXPTA!l. OOlilltiD ~OBAL llll.T t.MO.IND ~OBAL

SJr£ lHBO.JND GLOBAL

Y l.tOOl.tiD GlOBAL

I 58 SOORCE Ll t£S !58 ASSEI'IBlED Llt£S 28817 BYTES AVAILABLE

))) tll ASSEl1Bl Y ERil\JlS IUECTED «<

. - .•' I ' 102

TEKTROOIX 180 ASI'f V3. 4 PAGE

00001 ~I'E BTFYOOO 00002 SECTICW BTFYDS -00003 ROBAL BTFYD 00004 ROBAL X 00005 ROBAL y 00006 ROBAL. EXPTABL 00007 ROBAL cos 00008 ROBAL SINE 00009 ROBAL IUT 00010 HH+H 11111111 II IIIII Ill II II 11111111111111111111111 H++tHtHH·f 00011 t 00012 t BTFYD: 9.JTTEifl. Y CW'UT ATI CW ill£1.. D 00013 t 00014 t \£RSICW 0 REVISICW DATE: 7-5-84 00015 t 00016 t FI.KTICW: 00 fAST f!J£IER TRA'GCfmAiiON COI'f'liTATICW . 00017 t CW 3RD ill£1.. DATA RESULTED IN 4TH LE\£. 00018 t t REAL ~TA ADOOESS IN IX 00019 - t t !flAG DATA ADlf'£SS IN IY 00020 t f !lEFICIIENT TABLE CffSET IN OC 00021 t 00022 t ENTERED FRC~t: mCL. 0002'3 .. 00024 t SUBROJTINES CAU£D: Plii..T 00025 t 00026 t REGISTERS ~FICTED: A,fi,C,D.E.H,L,JX,JY 00027 t 00028 t fE!tJRIES AFFECTED: DATA !lOOOH - 10FFHl 00029 t 00030 t PORT -AFFECTED: Ntl'£ 00031 t 00032 11111111111 ttHHHHHfHHHHttttffHHfttfHHtH++tHHHHf 00033 00034 HH+IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIHHHf+ttH+tttttttttHHt 00035 f 00036 t BEGIN BTFYD P()llJI.E 00037: t OCT PRI11ARY DATA - FIN) 00038 t C£T SECONDARY MTA - f!N+Kl 00039 t aN'UTE F!NH!~l RESltT STC11ES IN P191ffiY - X 00040 t tnf'UTE F!Nl+FIN+Kl RESULT STffiES IN F!Nl 00041 t GET APPROPRIATE MTA FRCW1 EXPCWENTI/t. TABLE Fffi COS AND SINE ·. 00042 t CO'fPUTE - XtSINE STffiE RESll T IN I!N+Kl 00043 t W1PUTE XtCOS STffiE· RESllT IN F! N+K l 00044 t OO.tlTIL rof'LETE ALL BUTTERFLY LOOPS 00045. t GET PRIIIARY MTA - F!N+f'll 0004b' t GtT SECONDARY DATA - F!N+f'I+Kl 00047 t cnf'UTE F! N+f1 H (N+H+K) RESULT STffiES IN I'EI1ffiY - X 0004S t CM'UTE FIN+f'll+F!N+PI+Kl Fl[SltT STCflES IN F!N+tO 00049 t OCT PRIKARY MTA -I!N+f'll 00050 t OCT SECONIJAilY MTA - I! N+f1+K) 00051 t tnf'UTE I!N+tll-I!N+PI+Kl STORE RESULT IN X 000~2 t CM'UTE IIN+f'll+IIN+PI+Kl STffiE RESllT IN I !N+f'll 00053 t COtiPtJTE XtCOS+ YtS I NE STffiE RESll T IN FI N+ti+K) 103

lEKTROOJX 180 ASI1 V3. 4 PAGE 2

00054 t CM'UTE YtCOS-XtSJNE STffiE RESll.T IN HN-+!1-+Kl .00055 t EHDDO 00056 t END BTFYD l'llrtlE 00057 f 00058 llllllllllllllllllllllllllffH+ffffiiiiiiiiiiHIIIIIIIIIIIII tH+f

' .

... - 104

'TE!

00060 0000 DDbEOO BTFYD LD -L,I!X+OJ : LMD FINJ IN K. 00061 0003 DD6b01 LD H.I!X+1J 00062 OOOb DDSEOS LD [,flX+BJ ; Lnt\D FIN+KJ IN II 00063 0009 DD5609 LD n. IIX+9J 000b4 oooc E5 PUSH tt. ; SAVE FINJ 00065 OOOD B7 OR A : CLEAR CARRY . 00066 000£ EDS2 soc fl,J:I I Wft/T£ FINJ-FIN+KJ 000b7 001 0 220000 ) LD IXJ,HL ; STCJlf IN IUI:JRY OOObB 0013 £1 PCP tt. ; R£TRIEVE FINJ 000b9 0014 19 ADD HL.II ; CtWUTE FINJ+fiN+KJ 00070 0015 CB2C SRA H : SCALE - DIVIOC BY 2 00071 0017 CB1D RR L 00072 0019 DD7500 LD !IX+OJ.L : STORE IN FINJ 00073 001C DD7401 . LD IIX+1 J,H 00074 00075 001F 210000 ) LD tt., EXPTABL : POINTER TO EXPOOTh'TifL TABLE 0007 b 0022 09 ADD fl,BC ; AD..UST POINTER 00077 0023 7f LD A.IIU : OCT COSit£ DATA 000 78 002 4 320000 ) LD ICOSl,A ; SAVE COSINE DATA 00079 0027 23 Ire K. ; It«J!El'ENT POINTER - 00080 0028 7f LD A.Cif.l : OCT SI~ DATA 00081 0029 320000 ) LD ISH£J,A ; SAVE SI~ DATA 00082 002C EDSBOOOO> LD J:I,!X) ; R£TRIEVE X DATA 00083 0030 CDOOOO ) CfLL IU.T ; Wf'\JTE XIS!~ OOOB4 0033 7D LD A.L ; COOVERT REStlT TO t£GATI!VE 00085 0034 ED44 NEG 00086 oo3t. rnnoe LD IIY+BJ.A ; ST(Jlf IN I IN+Kl 00087 0039 3EOC LD A.OO 00088 003B 9C SBC A.H 00009 003C FD7709 LD !IY+9l.A 00090 00091 003F 3AOOOO > LD A.CCOSJ : Lntln l'fU.. TIPLIER 00092 0042 EDSBOOOO) LD J:I,!X) ; LOAD 11Ll TIPLICAND 00093 004b CDOOOO > CAU.. IU.T ; C0!11'\JTE XtCOS 00094 0049 DD7508 LD IIX+Bl .L ; STORE IN FIN+Kl 00095 004C Im7 409 LD (JX+9J,H 00095. 00097 004F 0607. LD B.7 : SET LOOP CQtmfl 00093 0051 c5 ; BTFYD1 PUSH BC ; SAVE LW COlmER 000~ 0052 ll!OOO LD J:I,0010H : SET LOOP CfF£D 00100 0055 DD19 ADD rx.D£ ; AD.lJST BUTTERFLY POINTERS 00101 0057 FD19 . ADD rv.oc 00102 0059 DDbEOO LD L. IIX+Ol : LOAD f(N+t1) IN HL 00 I 03 OOSC DDU.oJ LD ·. H. IIX+1l 00104 00::1' DD5£08 LD £.1 IX+Sl ; Lntln FIH+M+Kl IN II · 001 OS .0062 DD5609 LD Dd IX+9J 00106 006~ E5 PUSit K. : SAVE FCN+IIl 00107 006b B7 OR A : CLfAA C.AARY 00108 0067 EDS2 soc tt.,D£ ; CCN'\JT£ Fr N+t1J-F I N+ll+f( l 001 ey OOb 9 220000 ) LD (X),HI.. ; STORE IN IEI'mY 00110 OObC £1 POP If.. ; RETRIEVE FIN+I1l 001ll OObD 19 ADD . K.,J:I : ffi'f't.IT£ FIN+t1J+fiN+t1+Kl 00112 OObE CB2C SRA H ; SCALf - DIVIII BY 2 105 ' '

TEKTRONIX 280 ASI'I V3. 4 PAGE 4

00113 0070 CB!D RR L ' 00ll4 0072 007500 LD IIX+Ol,L ; ST~ IN F!N+I'Il 00115 0075 DD7401 LD !IX+1l.H 00116 0078 FD6EOO LD L, !IY+Ol ; LOAD I !N+I'Il IN lt. 00117 0078 FD6601 LD H. !IY+1l 00118 007E ~08 LD E, (JY+8l ; LOAD J( N+I'I+K l IN [f 00119 0081 FD5609 LD D. !IY+9l 00120 OQS.4 E5 PUSH lt. ; SAVE I!N+Pil 00121 0085 B7 rn A ; CLEAA CAARY 00122 OOS6 ED52 . SK' tL,.IJE ; ruf'UTE J( N+l'l H (N+I'I+K l 00123 0088 220000 ) Lli (Y),HL ; STffi£ IN 1£MORY 00124 OOSB E1 p(P HL ; RETRIEVE I!N+Pil 00125 008C 19 ADD tt..r.t ; CW'liTE I ( N+M l +If N+I'I+K l 00126 OOSD CB2C SAA H ; SCALE - DIVIr.t BY 2 00127 OO!:f. CB1D RR L 0012S 0091 FD7500 LD IIV+Ol,L ; STffi£ IN I (N+Pil 00129 0094 FD7401 LD !IY+ll,H 00130 00131 0097 3AOOOO ) LD A, !SINEl ; LOAD 1U. TIPLIER WITH SINE DATA 00132 009A EDSBOOOO> LD [f, !Yl ; LOAD IILl TIPLICAND WITH Y DATA 00133 009E cooooo ) CIU lltl.:T ; WIPIJTE YtSINE 00134 OOA1 E5 PUSH lt. ; SAVE RESll T 00135 OOAZ 3AOOOO > LD A.!COSl ; LOAD tlJLTIPlJER WITH COS DATA 00136 OOAS EDSBOOOO) LD DE, !Xl ; LOAD lliLTIPLICA'ID WITH X DATA 00137 OOA9 CDOOOO ) CIU flU ; OO'PIJTE XtCOS 00138 OOAC D! p(P ·DE ; RETRIEVE YtSINE 00139 OOAD 19 ADD HL,DE ; CO'!PUTE XtCOS+YtSINE 00140 OOAE DDZ508 LD (JX+Bl.L ; STORE RESll. T IN F( N+I'I+K l 00141 0091 DD7409 LD IIX+9l,H 00142 0084 3AOOOO ) LD A, !SINEl ; LOAD IU. TIPLIER WITH Sit£ DATA 00143 OOB7 EDSBOOOO> LD D£, !Xl ; lOAD liLt TIPLICAND WI Ttl X DATA 00144 OOBB CDOOOO ) CIU llllT ; COOPUlE XtSINE 00145 OOBE E5 PUSH H. ; SAVE RESLL T 00146 OOBF JAOoOO ) LD A.!COSl ; LOAD !IllTIPLIER WITH COS DATA 00147 OOC2 EDSBOOOO> LD DE.m ; LOOII PILLTIPLICAND WITH Y DATA 00148 OOC6 CDOOOO ) CIU 11LlT ; cn!PUlE HCOS 00149'00C9 Df, POP DE ; RETRIEVE XtSINE 00150 OOCA. B~ rn A ; CLEM CAARY 00151 OOCB EDS:i: soc tt..DE ; cn!PUTE YtCOS-XtSINE 00152 OOCD FD~...OB LD UY+Bl,L ; STffiE RESULT IN I!N+M+Kl 00153 OODO FD7409 LD !IV+9l,H oot54 ooro c1 p(P BC ; RETRIVE LOOP CCWTER 00155 00[)4 OS DEC B 00156 OODS C25100 >- JP NZ,BTFYD1 00157 OODB C9 RET 00158 . 106

l'EKTR(tiiX 280 ASt1 V3. 4 ~ SYIIOO.. TAB!.f PAG£ 5

BTFYDS SECTICW IOOD9 l

BTFYD - 0000 G BTFYDI - 0051

EXPT ABl l..ffilOO'ID GLOBAL

Sit£ OOOltiD GLOBAL.

X l.tiDCUID GLOBAL

158 SOORCE Llt£S 158 ASSOOLED LINES 28817 BYTES AVAILABLE

>>> l«l ASSa1B1. Y ERRffiS IETECTED ((( .

'. ' ' 107

TEKTROOIX· 280 ASI1 VJ. 4 PAGE

00001 tWE BTFYEOO 00002 SECTIOO BTFYES 000(13 G.OEtAl. BTFYE OOQ0.4 G.OBAL I 00005 G. OM. y 00006 G.OBAL EIPTABL 00007 G. OM. cos 0000$ G.OBAL Sill: 00009 G.OBAL IU.T 00010 +i+HIIIIIIIIIIIIIIIIJIIIIIIIIIIIIIIIIIIIIIIJflllllllllllllllllll OOOJI f 00012 t BTFYE: MTERFL Y CCiiPIJT ATI Cf.l LEVEL E 00013 f 00014 t VERSI!ll 0 REVISICW OOTE: 5--17-84 00015 00016 . t FltCTION: 00 FAST FOOUER TRANSFORI~\1100 Wf>liTATI!ll 00017. . t Cf.l 4TH LEVEL DAJA RESULTED IN 5TH LEVEL 00018 . -· t t REA. DATA ADDR£SS IN IX 00019 t f IIIAG DATA ADOOESS IN IY 00020 t t COEFICIIENT TAR.E CfFSET IN BC 00021 00022 t ENTERED F'Rttl: FFTCL 00023 00024 t SUBROUT Ilf:S CAU.ED: IU.T 00025 .. f -00026 ;-- t REGISTERS l'flECTED: A.B,C,D.E,H.L,JX,IV 00027 • 00028 t PEI'IOOIES AFFECTED: MTA (J()()OH - !OFFHJ 00029 f 00030 t Pall AffECTED: 10£ 00031 • 00032 IIIIIIIJIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIHHft 00033 00034 . +ffft+HHtH 11111111111111111111111 II Ill llllllllfiiiiiHIHtt+H 00035 -• 00036 f BEGIN FTFYE f13DU!.I WJ3i. t GET _PRIM'?Y DATA - FINl t GET SECOODAAY MTA - Fl~l 00038 ; 00039 t Wf>LITE FIN l -f I~ l RESI.l T STORES IN IEI'IOOY - X 00040 t CtJ!PuTE FCNl+fiN-+f.:l RESU.T STORES IN FINl 00041 t GET fi'PRCFRIATE DATA FRll'1 EIF'tlENTIAL TABLE FOR COS AND SINE 00042 t COI!Pt.ITE - X+SINE STffi£ f\EStlT IN I IN-+KJ 00043 . t COif'\JTE XtCOS STffi£ RESULT IN FIN-+KJ 00044 ..; . ·• D!.WT IL COifUTE ALL BUTTERFLY LOOPS 00045' t GET PRII!ARY MTA - FIN+nl 00046- t GET SECONDARY DATA - FIN-+I't+t:l 00047 t CO'f'UTE Ff~H'CN+fi+Kl RESt.ILT STOOES IN I'EmfDARY OOTA - I (Nti'I+KJ 00051 t CtJ1PUTE J(~J-I fN+I'I+Kl STOOE RESlt T IN X

0005''4 t Ctlf'liTE J(N+I'Il+HN+I1+Kl STOfif RESILT IN HN+I'Il 00053 t COIPUTE XtCOS+YtSII£ STORE REStl T IN FIN+II+K l 108

lEKliDIIX 180 ASt1 V3. 4 PAGE 2

00054 t r:n1ME YtCOS-XtSH£ STORE RESULT IN I

1'EKTllOO I X 280 ASI1 V3.4 PAC£ 3

OOObO 0000 DD6EOO BTFYE LD L. IIX+Ol ; LMD F!Nl IN K. 00061 0003 Dll6601 LD H, IJX+Il 00002 OOOb DDS£04 LD E, I IX+4l ; LMD F!N+I\l IN DE 00063 0009 DD5b05 LD D.C !X+5l 00004 OOOC ES PUSH II. · ; SllVE F!Nl 00065 OOOD B7 CJl A ; ClEAR CARRY OOObb 000£ ED52 soc HL,IJE ; Cllf'UTE Fl Nl-f I N+K l 0000 7 001 0 220000 ) LD !Xl.HL ; STillE IN IEPJJRY 00068 0013 El f'(P li_ ; RETRIEVE F!Nl 000b9 0014 19 ADD II..OC ; COif1JTE F!Nl+ffN+Kl 00070 0015 Cll2C SRA H ; 5UU - DIVIII BY 2 00071 OOJ 7 CB1D RR L 00072 0019 DD7500 LD m+Ol.L ; STillE IN F!Nl 00073 OO!C DD7401 LD IIX+1 l ,H 00074 00075 001F 210000 ) LD tt..EXPTABL ; PO INTER TO EXPCtelT IAL TABLE 0007b 0022 09 ADD HL.BC ; ADJ<.IST POINTER ooon 0023 7r LD (;,(fl.) . ; OCT COSINE DATA 00078 0024 320000 ) LD !COSJ,A ; SAVE COSINE DATA 00079 0027 23 nc lt. ; INCREI'ENT POINTER 00080 0028 7E LD A, !Hll . ; GET SINE DATA 00001 0029 320000 ) LD ISII£l,A ; SllVE SH£ DATA . 00002 002C EIJ5B0000) LD DE. !Xl i. RETRIEVE X DATA 00003 0030 cooooo ) CALL PU..T ; OO'!Pt.IT!: XtSII£ 00084 0033 7D LD A,L ; COIMRT RESllT TO t£GATIIVE 00085 0034 ED44 NEG 0008b 003b FD7704 LD !IY+4l,A ; STCR£ IN IIN+Kl 00007 0039 3EOO LD /hOO 0008:3 003B 9C SBC A,H 00089 003C FD7705 LD IIY+5l,A 00090 00091 003F 3AOOOO - ) LD A;CCOSl ; LMD IU. TII'UER 00092 0042 ED580000> LD oc.m ; LMD PU..TIPLICAND 00093 004b CDOOOO ) CAli llllT ; mf'UTE XtCOS 00094 0049 DD7504 LD IIX+4J,L ; STillE IN F!N+Kl 00095 004C 'DD7405 LD !IX+5l,H 00096' 00097 004F owe:: LD B.!5 ; SET UKF C!UITER 00098 0051 c5 ; BTFYE1 PUSH BC ; SllVE LOOP CQtflER 00099 0052 11 0800 LD oc.oooSH ; SET UKF !FFS£T 00100 0055 DD!9 ADD u.oc ; ADJUST BUTTERFLY PO INTERS 00101 0057 FD19 ADD JY,OC 00102 0059 DD6EOO LD L. (JX+Ol ; LMD F!N+f'IJ IN HL 001 03 005C DDbbO 1 LD H.C IX+1 l 00104 005F DD5E04 LD E. IJX+4) ; LMD F!Ntt!+tJ IN OC 001 OS' 00b2 DD5b05 LD- n. !IX+5J 00106 OOb5 ES PUSH li_ ; SAVE FIN+f'll 00107 OOb6 B7 00 A ; ClEAR CARRY 00108 00b7 ED52 SBC HL.DE ; ro>IPUTE FI N+f'l J-F I NtK+K J 00109 00b9 220000 ) LD (X) .K. ; STillE IN I'IEllffiY 00110 OObC E1 POP. II. ; RETRIEVE- FIN+f'IJ 00111 OObD 19 ADD HL,OC r rot'l.ITE FI N+ft J+f I Ntt!+t l 00112 OObE CB2C SRA H ; SCALE - DIVIDE BY 2 110

lEKTFDIIX zoo AS!'! V3.4 PAGE 4

, 00113 0070 CB1D RR . L 00114 0072 DD7500 LD IIX+OJ.L ; STORE IN FCN+I1l 00115 0075 DD740l LD IIX+J J,H OOIJ6 0078 FD6EOO LD L, tiY+Ol ; LOAII IIH+tll IN HL 00117 0078 FD6601 LD H,fiY+ll 00118 007E FD5f04 LD E. I IY+4l ; LOAD I IN+I1+Kl IN OC. 00119 0081 FD5605 LD D, llY+5l ()() 120 0084 E5 PUSH HL ; SAVE I IN+Ml 00121 ores 87 00 A ; Ct£AA CAARY 00122 0086 ED52 SBC HL.OC ; Ol'lr"'UTE IIH+."' J-I (N+11+~ J 00123 0088 220000 ) LD IYJ,HL ; SH:wlE IN tiEI(IRY 00124 0088 E1 f'a>. HL . ; Rt.IRJE\f I (t.t/1! 001.25 008C 19 ADD li.,DE ; COtf'liTE II N+li l +II N+11+K l 00126 008D CB2C SRA H ; SCALE - Dl VIDE BY 2 00127 008F CB l D RR l 00128 0091 FD7500 LD IIV+Ol.L ; STOOE IN I IN+I'll 00129 0094 FD740l LD IIY+Jl,H 00130 00131 0097 3AOOOO ) LD A, ISJI£l ; LOAD till TIPLIER WITH SINE DATA 00132 009A ED5B0000) LD DE. IYl ; lOAD t!ULTIPLICAND WITH Y DATA ()() 133 009E cooooo ) CALl ltJLT ; mtPUTE YtSH£ 00134 OOA1 E5 PUSH HL ; SAVE RESll T 00135 OOA2 3AOOOO ) LD A,(COSl ; LOAD I'llTJPLJER WITH COS DATA 00136 OOA5 ED5BOOOO) LD DE.m ; LOAD ltlTJPLJCAIID WITH X DATA 00137 OOA9 COOOOO ) CALl ltlT ; ruf'LITE XtCOS 00138 OOAC D1 f'a> DE ; RETRJ£\f YtSH£ 0013S' OOAil 19 ADD HL,DE ; rut>liTE XtCOS+YtSJIIE 00140 OOAE DD7504 LD IJX+4l ,L ; STOOE RESlll IN FIN+It+Kl 00141 0081 .007405 LD IIX+SJ,H 00!42 OOB4 3AOOOO ) LD A. ISH£! ; LOAD tillTIPLJER 1/ITH SII£ DATA 00143 0087 ED5BOOOO) LD DE .IX! ; Lc.<:III 1tJL TIPLICAND WITH X DATA 00144 OOBB COOOOO ) CALL I'U.T ; CtliPLITE XtSII£ 00145 OOBE E5 PUSH HL ; SAvE RESll T 00146 OOBF 3AOOOO ) LD A. I COS! ; LOAD t«.l TIPLIER WITH COS DATA 00147 OOC2 ~580000> LD DE, CALl tll.llT ; COI'IPUTE Ytros 001{9 Ooc9 Dl' f'a> DE ; RETRIE\f XtSINE 00150 OOCA 87 -• 00 A ; CLEAR CARRY 00151 OOCB En52 soc HL;DE ; ruf'LITE Y~COS-XtSII£ 00 !52 OOCD FD7504 LD fiY+4J,L ; STOOE RESULT IN IIN+I1+Kl 00153 OODO FD7405 LD fiY+SJ.H 00154 ooro c1 p(f> BC ; RETRI\f LOOP ro..tiTER 00155 0004 05 DEC B 00156 OOD5 C25100 )- .P NZ.BTFYE1 00157 ,ooro C9 RET 00158 111

180 ASII V3. 4 SYI!Bil. TABLE PAll: 5

_BTFYES SECTI~ fOOD9l

BTFYE- 0000 G BTFYEl - 0051

COS I.MlOlMl GUJB/t.

EXPTABl t.tmiX.Ml G.~ ll.lT lt-IBruiD G..OBAL

511-£ IJOO..tiD G..OBAL

I ltOOltiD G..OBAL

Y OOICUID G..OBAL

158 SOORCE L1 ~S 158 ASSEl1EtED L1 ~S 28817 BYTES AVAI LA!l£

))) NO ASSEl1BL Y mlORS IETECTED <«

•• • f _. ' ' 112

TEKTRG'IIX 18(1 ASI1 V3. 4 PAGE

00001 BTFYFOO 00002 Bm'Fs 00003 BTFYF. 00004 IU.T 00005 I+H llllllllllllll++tiiiiiiiiiiiiiiiiiiHtiiiiiiiiiiiiH++ttH++t 00006 f 00007 t BTFYF: IUTTERFLY CM>UTATlll'l LEVEL F 00008 f 00009 t VERSION 0 REVlSlll'l DATE: 6-16-84 Ooo10 • 00011 t FWCT!Il'l: 00 FAST FWllER TRANSFffiWlTICfl CO!'!PtiTATICil 00012 t Ill 5TH LEVEL DATA RESULTED IN 6TH LE\o£1. 00013 t t REAL DATA ADDRESS lN IX 00014 f 00015 t ENTERED FROI1: ma. OOOlb f 00017 t SW\WTJI£5 CALLED: l'tU..T 00018 f 00019 t REGISTERS IV'FECTED: f;,J.;,f,H,L,IX 00020 t 00021 t 1£1m!ES AFFECTED: DATA I!()(I(IH - !llmil 00022 f 00023 t POOT AFFECTED: fOE 00024 f 00025 111111111111 filii II 11111111 H++tHH I I I 1111 I Ill If 1111111111111111 00026 00027 llllllllllllllllllllllllllllllllll++t++tHH++tf++ti+H++tf++t++t 0002B § 00029 ; . t BEGIN BTFYF PIODLILE 00030 t Iru\'TlL COII?LETE BUTTERFLY LOOPS 00031 t GET PRIIIAAY DATA - FIN) 00032 t ~T SECil'IDAAY DATA - FIN+Kl 0003:~ t roft'LITE FINl+FIN+Kl RESLlT STORE lN FINl 00!)34 1 COMPUTE CO$t[FINHiN+KlJ RESULT STORE IN FIN+K) 00035 t I ALSO JINl = HNl+J(N+Kl AND HN+KJ = OJS+[JCNHIN+KJJ J 0003b t JHCRE~NT POINTER 0003.7·. t ENDW 0003B t END BTFYF PIODLli 00039 f 00040 1111111111 I I lllllllllliiiiiiiii+Ht+tHf++tHH++tHf++tHH++tH 113

TOOROOIX 180 ASI1 V3.4 PAGE 2

00042 0000 Ob40 BTFYF LD B.b4 ' 00043 0002 DDI£00 BTFYF1 .LD l.! IX +OJ ; OCT FCNJ IN HL Ooo44 0005 DDM01 LD H,fiX+1l 00045 OOOB DDS£02 LD £, CIX+2l ; ~T FCN+KJ IN DE 00046 OOOB 005603 LD D.rU+Jl 00047 000£ [5 PUSH I{_ ; SAVE H.. CONTENT 00048 OOOF 19 ADD fl.. I( ; CO'fP\Jli FCNJ+FCN+KJ 00049 0010 DI17SOO LD fiX+OJ,L ; STOOE RESllT IN FCNJ 00050 0013 007401 LD ( IX+l l ,H 00051 0016 [1 PCf' I{_ ; RETRIEVE HL COOTENT 00052 0017 B7 Ofi' A ; CLEAR CARRY 00053 0018 ED52 SBC 1{_,1( ; mf'IJTf FCNJ-FCN+KJ 00054 00 I A EB EX OC,Il. ; EXCHAIH DE IWD Hi.. 00055 001 B 3E7F LD · A,07FH ; LCWI ro50 00056 0010 C5 PUSH BC ; SAVE CCl.ffiEF; 00057 001£ CDOOOO > CALL 11UL T ; COif'UTE COSt[FCNi-FtN+KJJ oooss 0021 CB25 SlA l ; SCI(£ - PlllTIPLY BY 2 00059 0023 CB 14 RL H 00060 0025 Cl P(f' BC ; RETRIEVE C(WTER 00061 0026 007502 LD IIX+2> ,L ; SHRE RESULT IN FCN+K> 00062 0029 DD7 403 LD IIX+JJ,H ooob3 oozr DD23 INC IX ; INCREI'.ENT POINTER 00Clb4 002E DD23 INC IX 00065 0030 .0023 nc !X OOObb 0032 Dll23 · INC IX 00067 0034 !OCC IUIZ BTFYF1 . ; OOlMI l COI1PLETE OOObS 0036 C9 RET 00069 114

ZOO ASH V3.4 SYI!B!X.. TABLE PAll: 3

BTFYFS SECTI~ 100371

BTFYF - 0000 G BTFYFl - 0002

JiU..T ~D CX.OBAL

69 SCUU LiliES 69 .ASSEIIIUD LitES 28878 BYTES AVAILABLE

))) NO ASSEl'IBLY ERRffiS OCTECTED «<

-. ;