You are on page 1of 4

IEEE TRANSACTIONS ON EDUCATION, VOL. 32, NO. 3.

AUGUST 1989

367

Short Papers
Automatic Measurement of Frequency Characteristics of Operational Amplifier Circuits
KOKI ABE, YOJI WAKATSUKI,
AND

MASATO NARAOKA

11. PRINCIPLE L e t f ( x ) be an input wave with period 2ir which is applied to a linear circuit, and let g ( x ) be the response of the circuit t o f ( x ) . The Fourier series of f ( x ) and g ( x ) are assumed to be expressed as

f(x)
Absfracf-Laboratory experiments for measuring the frequency characteristics of operational amplifier circuits by means of a personal computer with a data acquisition unit were developed. A periodic rectangular wave, which is easy to be generated by a DA converter, is applied to the circuit; then the steady-state response is digitized by an AD converter. Filon's method was employed for the numerical Fourier integration of the sampled response. The errors associated with the measurement of the frequency characteristics of an integrator were found to be less than 0.2 dB and 1" in gain and phase, respectively, within the range of frequency satisfying gain ? 0 dB. I. INTRODUCTION Personal computers of satisfactory computational and graphics capability have been available inexpensively. Many reports have been published concerning the utilization of personal computers in engineering laboratories [ 11. Digital Computer Laboratory I [2] is a course for juniors majoring in computer science at the University of Electro-Communications. A subject of the course deals with operational amplifiers and their feedback circuits. Frequency characteristics of such circuits had been measured with a sine-wave oscillator and an oscilloscope and analyzed by hand calculation. We introduced a personal computer and a data acquisition unit [3] for measuring the frequency characteristics of an integrator which is one of the negative feedback circuits of operational amplifiers. Using the data acquisition unit, characteristics up to 113 Hz have been obtained with adequate accuracy. The measurement is performed by applying a periodic rectangular wave to the circuit and computing the Fourier coefficients of the output wave. The application of the input voltage, the measurement, and analysis of the output wave are all accomplished by a personal computer together with the data acquisition unit. The reason why the integrator was selected is that the characteristics of the integrator normally d o not depend on those of the operational amplifier used, and therefore it is easy to compare the experiment to the theory, as well as that the computation o f the high-frequency components is not required. In numerically calculating the Fourier integral, Filon's method [4] was employed which has less error than the trapezoidal rule o r Simpson's rule. The experimental error based on this method was small compared to the conventional manual measurement, although the accuracy expected from Filon's formula has not been obtained. The application of the method to this subject was found to be helpful for students to understand not only the characteristics of the negative feedback circuits, but also the Fourier analysis and the numerical integration. The principle of the method, the experimental error estimation, and some examples of the results will be presented.
Manuscript received January 7 , 1988: revised April 21, 1989. The authors are with the Department of Computer Science and Information Mathematics, University of Electro-Communications, 1-5-1 Chofugaoka. Chofushi, Tokyo 182, Japan. IEEE Log Number 8929062.

kzo
m m

(uk cos kx

+ bL sin kx) + dk sin kx).

(1)

g(x)

( c k cos

kx

(2)

From (1) and (2), the amplitude and phase of the transfer function of the circuit at the frequency k , g a i n ( k ) and phase(k), respectively, are calculated by gain(k) phase(k)
= (ci =

+ d i ) / ( u i + b:)
-

arctan(ck/dk)

arctan(uk/bk).

(3)

F o r f ( x ) , we select a periodic rectangular wave defined as 1 -1 2nir 5 x < (2n (2n

1).

I ) " 5 x 5 (2n

+ 2).

n = 0, +1, *2, . . . . (4) Note that generating the wave is an easy task for a computer. The Fourier coefficients of (1) are expressed as
uL = 0 , bk = 0

(k:even) (k:odd).
(5)

~k = 0, b = 4/(irk) k Equation (3) is then simplified to

gain(k) phase(k)

irk = 4
=

arctan(ck/dL)

(k:odd).

(6)

The output wave g ( x ) is digitized by an AD converter at a specific sampling rate. The coefficients c k , dLin ( 2 ) are obtained from the definition of Fourier integrals:
CO =

1 2n
7

j2"
0
2a

g ( x ) dx

cL =
dL =

g ( x ) cos

kx dx,

k = 1, 2,

...

1 ;2* g ( x ) sin kx dx.

5,

111. NUMERICAL METHODSFOR FOURIERINTEGRATION In order to calculate the integrals in (7), the following three numerical methods were examined: 1) the trapezoidal rule, 2) Simpson's rule, and 3) Filon's method. Take the second integral of (7) as an example. In Filon's method, the interval [ 0, 2 n ] is divided into N ( N : even) subintervals of equal length. Over each double subinterval, g ( x ) is interpolated by a parabola. For the parabolic g ( x ) . the Fourier integral is calculated by integration by parts. In the case that cos kx varies rapidly compared to g ( x ) , which occurs for large k , Filon's method is expected to yield a more accurate approximation than Simpson's rule be-

0018-935918910800-0367$01 @ 1989 IEEE .OO

368

IEEE TRANSACTIONS ON EDUCATION. VOL. 32. NO. 3. AUGUST 1989

cause in Simpsons rule, g ( x ) cos kx as a whole is approximated over each double subinterval by a parabola. Assume an integrator (low-pass filter) shown in Fig. 1 as the circuit to be examined, which has time constant tc = R C and dc f. f gain Go = - R f / R , . Let t,, N , and Tstand for sampling time, number of sampling points per period, and period of input wave, respectively. The dimensionless variable x and constant x, are used hereafter, which are related to time t and t, as follows:
x = 21rt/T, x, = 27rt,/T, T = t,N. (8) The response g ( x ) of the circuit to the input f ( x ) defined by (4) is determined by the differential equation

m
Fig. 1 . An integrator (low-pass filter), the frequency characteristics of which are to be examined.
g a i n ( d b)
20+

x , d g ( x ) / d x + R(X) = Gof(x). (9) The steady-state solution of (9), which must satisfy the condition
g(x

.a

+ 2n7r) = g(x),

n = 5-1, k2,

...
O S X < *

(10)
1 5 ~

is given by
2 exp (-x/x,) 1 + exp ( - T / x , )

theory

1 0 ~ . riFllon Simpson

The Fourier coefficients of g ( x ) are given by


Ck

d =0 k

(k : even) (k:odd).
(12)

*k ( 1 /xC)?

+ k

In the numerical calculation, the parameters are fixed as follows:


t, = 5 ms,

Go

= =

10,
256, T = r,N = 0.556 s.

rr

2.17 ms, N

(13)

-3 0

The function g ( x ) in (1 1) is digitized as follows:


g, = g(ih),

I
i
1
4

U
I

41

I , 2,

. . . .N

h = 27r/N. (14) The digitized values are then used to numerically integrate (7) to obtain gain ( k ) and phase ( k ) in (6). The results of the calculation are shown in Fig. 2 (a) and (b) where the abscissa is in a log scale of frequency f = k/T. (15) The frequency components higher than k = N / 2 = 128 are not computed because they d o not have significance according to the sampling theorem 151. The results show that as the frequency increases, the values by the trapezoidal rule first begin to deviate from the theory. Although the values by Simpsons rule follow the theory at higher frequencies than those by the trapezoidal rule, the deviation starts at lower frequencies than those by Filons method. The errors of Filons method in gain and phase are found to be 0.1 d B and 0 . 2 , respectively, at k = 63 ( f = 113 H z ) as shown in Fig. 3(a) and (b).

rule

-90

10

20

50

100

200

f (Hz)

(b) Fig. 2 . Frequency dependences of the gain (a) and the phase (b) of the integrator calculated by various numerical methods using the digitized response g, of (14) under the condition of (13).

Iv. RESULTS The steady state of the integrator was realized by applying 0 . 5 f ( x ) V with n = 0, I , 2, 3, 4 in (4). The response g ( x ) of the integrator at the steady state was sampled by a 12 bit A D converter of the data acquisition unit under the condition of (13). then analyzed based on Filons method. A personal computer PC9801 (NEC) with a numerical data processor 8087 (Intel) was used for

the calculation. The programs were written in the Pascal language. It takes 11 s to obtain the Fourier coefficients when N = 256. For the time constant t , , four cases 5 0 , 20, I O , 5 ms were selected. The sampled values of the response g ( x ) are shown in Fig. 4 . The frequency dependences of gain and phase in ( 6 ) up to f = 113 Hz are shown in Fig. 5(a) and (b). The deviations of experimental values from the theoretical values in gain are small, as expected from the discussion in Section 111. The errors in g a i n ( k ) are at most 0.2 d B within the range of the frequency satisfying g a i n ( k ) 2 0 dB. For phase. however, the

IEEE TRANSACTIONS ON EDUCATION, VOL. 32. NO. 3. AUGUST 1989


gain error(db)

369

10

------+ 20 50 100

200

Fig. 4. Sampled values of the response g(x).

f(Hz)

(a)
phase e r r o r ( d e g r e e ) gain(db)

20

l
- l j

15
0

-6

- 8.---+ -1

II

--..

f.

0 U

10 20 f(Hz)

50

100

200

(b) Fig. 3 . Numerical errors of Filons method: ( a ) error in gain, (b) error in phase.

5
f

io
(Hz)

20

50

100

deviations are noticeable at high frequencies, but d o not exceed 1 within the same frequency range, which is less than the error associated with the manual measurement by oscilloscope.
V . DISCUSSIONS The students have performed the experiments as follows. After being introduced to the principle of Fourier analysis, they were asked to derive the Fourier components of the periodic rectangular wave, then to synthesize the wave from the components. The synthesized waves were displayed on the personal computer. The exercise has been effective for the students to confirm the fact that the synthesized wave really converges to the original wave in the time domain. A procedure called GetWave was given to the students. The procedure, given the amplitude of the input wave and the number of sampling points per period, generates the periodic rectangular wave, samples the response, and returns an array with the sampled values. The students were asked to configure a negative feedback circuit as shown in Fig. I , and to write a program to measure the response of the circuit to a periodic rectangular wave. Several combinations of the values of R,, R,, and C, were selected to see their effects on the response. The required circuit components including the operational amplifier 741C were all mounted on a panel where the students could construct the circuit by connecting the terminals using wires with a plug at each end. The students were given Filons formula with which they analyzed the response. Within the allotted 16 h , all the students succeeded in displaying the frequency characteristics of the integrator as shown

p h a s e ( degree)

f(Hz)

(b) Fig. 5 . Frequency dependences of the gain (a) and the phase (b) of the integrators in Fig. 1 calculated from the response sampled by the data acquisition unit. Filons method was used for the numerical Fourier integration.

370

IEEE TRANSACTIONS ON EDUCATION, VOL. 32. NO. 3. AUGUST 1989

in Fig. 5. Several of them had time to directly measure the sinewave response using an oscillator and an oscilloscope and compare the results with the curves obtained from the Fourier analysis of the response to the periodic rectangular wave. The reproducibility of the measurement has been excellent and the usefulness of Fourier analysis for such measurements has impressed the students. Note that the students major in computer science and have enough background for Pascal programming and numerical analysis. It would require more laboratory hours for students majoring in other areas. The sampling time t , was fixed to 2.17 ms, which is the fastest sampling rate available with the data acquisition unit. The limitation is due to the fact that the acquisition unit receives a command from a host to sample only one datum through a serial line. If a command makes the acquisition unit to sample a sequence of multiple data, the sampling time can be much shorter. In this case, t, is determined by the conversion time of the A D converter. It was noted in Section IV that the deviation in phase is relatively large. This may be caused by inequality of the sampling periods. Because there exist fluctuations in the data transmission time of serial communication lines, the precise adjustment of the sampling rate by control programs was impossible. Significant error analysis including the effect of quantization will be made after the equality of the sampling periods is guaranteed. REFERENCES
[ I ] K. Yada, Laboratory automation (in Japanese), J . IEICE, vol. 67, pp. 407-412, Apr. 1984. 121 N. Hayashi, K. Nakagawa, and K. Abe. Computer Hardware Lahoruroty (in Japanese). Tokyo: Kindai Kagakusha, 1980. 131 Y. Wakatsuki, T. Nakshima, M. Naraoka, J. lijima, and K. Abe. Data acquisition system for laboratory experiments (in Japanese), Bursuri Kjwiku, vol. 36. pp. 21-24, Mar. 1988. [4] L . N. G . Filon, On a quadrature formula for trigonometric integrals, Proc. Roy. Soc. Edinburgh, vol. 49, pp. 38-47, 1929. [SI L. Brillouin, Science and Informarion Theory. New York: Academic, 1962.

helps students understand the algorithms and debug the implementation.

I. INTRODUCT~ON Programmable logic arrays (PLAs) have widely been used for implementing logic functions because of their regularity in structure in addition to programmability [ 11, 121. Digital Computer Laboratory I [3] is a course for juniors majoring in computer science at the University of Electro-Communications. A subject of the course deals with design and implementation of arithmetic algorithms, i.e., addition, subtraction, multiplication, and division of fixed-point integers. The finite state machine (FSM) which controls the data path requires a considerable amount of logic circuits. The FSM had been implemented with gates and flip-flops, compelling the students to construct only a part of the arithmetic algorithms. Debugging the circuits had been difficult and modifications of the design specifications had been costly. We designed a PLA which facilitates the organization of FSMs in a systematic way. The PLA consists of two diode matrices which are programmed using s h o n plugs. Because the coding is visible, the debugging and modifications become tractable. The PLA has successfully been used to implement the full set of arithmetic. Commercially available PLAs, e . g . , PAL o r PLE [4], are not suitable for our purpose because the OR plane of PAL and the A N D plane of PLE are preprogrammed. In addition, the capacity of those devices is insufficient. We also designed a data path which is incorporated into a panel on which the block diagram is depicted and LEDs are placed at all inputs and outputs of the circuit blocks. This helps the students trace the data transfer among registers during the execution of arithmetic algorithms. The specifications for the arithmetic unit, the structures of the data path and PLA, an example of the realization of the arithmetic unit, and some results of the application of the equipment to the laboratory will be presented. 11. SPECIFICATIONS FOR T H E ARITHMETIC UkIT . In the following descriptions, a = a,- ,an-z . . . a denotes an n tuple ( a , , - , , a,,-2, . . . , ao), which is an element of a set A = A H - , x A , , - > x . . . X A o w h e r e a , ~ A , = { O , l } ( i = n -l , n - 2 , . . . , 0 ) . It also stands for 2s complements representation of an integer:
a = -an-, 2+

n-2

C
t=o

a,2.

Implementation of Arithmetic Algorithms Using a PLA


KOKI ABE, JUNICHI IIJIMA, TOYOHIKO NAKASHIMA,
AND

YOJI WAKATSUKI

A notation a I b where a and b are n and rn tuples denotes an n rn tuple ( a , , - , , a,,-2. . . . , ao, b,,,- 1 , , bo). The specifications for the arithmetic unit to be realized were given as follows [ 5 ] (Fig. 1).
Inputs:

x = xJ.x2x,xo {data}
Abstmct-A programmable logic array (PLA) which is capable of implementing 24 logic functions each with 48 product terms of 16 variables was designed. The PLA is composed of two diode matrices, and programmed by inserting short plugs. Implementation of arithmetic algorithms, a subject of a laboratory dealing with computer hardware, has successfully been performed using the PLA to organize a finite state machine (FSM) controlling a data path. Both the data path and the PLA were incorporated into a panel, on which the data flow and the states and outputs of the FSM are visible by LEDs. This
Manuscript received March 15, 1988. The authors are with the Department of Computer Science and Information Mathematics, University of Electro-Communications. 1-5- 1 Chofugaoka, Chofushi. Tokyo 182. Japan. IEEE Log Number 8929373.

P = P Z P ~ P ~{command},

start

{ control }
z ~ z ? z I z o{data},

Outputs:

busy Registers:

{ status } .

a = a,a>a,a,
b = bJb?b, bo.
Behavior: When the control signal start is set to one and the status signal busy indicates zero, busy is made to indicate one and

0018-9359/89/0800-0370$01.OO 0 1989 IEEE

You might also like