Development of Digital-Controlled Measuring Instrument for Hearing

A digital-controlled measuring instrument for hearing, which is mainly composed of STC11F16EX, AD9833, ISD4004-16MS and LM1972, is introduced in this paper. It may output highly accurate and purified sine signal whose frequency and amplitude are controlled by digital data. Specially, the displaying number of decibel is equal to actual number of decibel because that frequency response of earphone is corrected through software of microcontroller. Additionally, touching buttons, which is simple and convenience to use, is selected. Hence this instrument is convenient to measure and teach about hearing specially, research and study on frequency characteristic of human ear and impedance characteristic of human body in medical science.


Introduction
As is known to all, sounds waves that human can hear have range not only in frequency from 20 Hz to 20 KHz, but also on intensity.Usually, hearing threshold of intensity includes two limited value: one is the maximum value named pain threshold, and the other is the minimum value called threshold of audibility [1].The intensity between audibility and pain threshold is audibility range, and to same frequency sound waves, the larger sound intensity must sound louder, but for different frequencies of those, it is not necessarily sound stronger.Therefore, in order to obtain loudness level curve, we have to measure the sound intensity level of different frequency under the same loudness.And different personal loudness curve is not completely same, that is to say, different people have different hearing.In practice, to measure personal hearing, different frequencies of pure sine and other signal are used to drive sound equipments, such as speakers, and earphone.The size of sound intensity level is usually utilized to measure hearing with decibels.Certainly, the instruments, which can output single frequent sound and other sound, are demanded.In additionally, the auditory tests in the comprehensive check-up for students, who prepare for higher school, college and university, are needed, and in the physical and medical teaching and research, the human hearing and impedance characteristics [2] are often demanded.As a result, the needed generator should have the function of adjusting frequency and amplitude, and also can produce high precision and purity sine and other sound signals.Based on above, a novel instrument, which is mainly composed of STC11F16EX, AD9833, ISD4004-16MS and LM1972, is put forwarded.

Instrument Struction
Design of the instrument includes two sides, hardware and software.Hardware is divided into nine parts: Microcontroller, voice signal generator, single frequency generator, signal selector, audio fader amplifier, stereo audio power amplifier, keyboard, LCD monitor and power source circuit.The instrument block diagram is shown in Figure 1.
This instrument mainly based on microcontroller and high-performance integrated chips, such as STC11-F16EX, ISD4004-16MS, AD9833 and so on, which not only can increase its intelligence, precision, stability, but also reduce its power consumption and volume.The microcontroller, STC11F16EX, output all kinds of command and data signal to control relative chips for generating needed sound.In this instrument, ISD4004-16MS, which is act as voice signal generator and can record various sound under management of microprocessor, is applied to produce recorded audio sound, while AD9833, single frequency signal, is u ed to generate single fre-s quency sound with high accuracy and purified sine.Under management of microcontroller, above two kind of sound signal is offered to signal selector, which is mainly composed of ADG1421 that contains two independent analogy switches, to choice one needed type signal for audio fader amplifier which primarily includes LM1972 and OP2177.By controlling of single-chip microcomputer, STC11F16EX, the double audio digital potentiometers, LM1972, in audio fader amplifier, output the voice or audio sound signal with special amplitude and frequency ,which is given to stereo audio power amplifier (APA) after double amplifiers.Finally the needed signals are input to APA, which includes LM4950, a dual audio power amplifier with capable of delivering 3.1 watts per channel to a 4 Ω single-end load, to drive headphones, speaker and so on.The keyboard for user's imputing command, LCD monitor for display all kinds of information with FM19264, and power source for providing other parts with power to work are designed in this instrument.Hardware of nine parts effectively ensures to realize the function of digital-controlled measurement for hearing.The software of this instrument was designed by Kiel uVision 3 for STC11F16EX.
The following below, we mainly describe the hardware in four parts, which are microcontroller, voice signal generator, single frequency generator, and audio fader amplifier, and software of this instrument in detail.

The Primary Hardware
The important and vital parts for this instrument are microcontroller, voice signal generator, single frequency generator, and audio fader amplifier.Therefore, we only describe those four parts in detail.

1) Microcontroller
The microcontroller is composed of microprocessor STC11F16EX [3] and its peripheral components.STC11F16EX is a single-chip microcontroller based on a high performance 1T architecture 80C51 CPU, has a fully compatible instruction set with industrial-standard 80C51 series one, and has 16 K bytes Flash program memory, 1280 byte SRAM memory and 32 K byte EEPROM.In addition, it has a 6-source, 2-priority-level interrupt structure, on-chip crystal oscillator and a one-time enabled Watchdog Timer.STC11F16EX play a major role and controls other parts to realize data exchange and corresponding function in this instrument.
2) Voice signal generator The basic goal of voice signal generator is to produce all kinds of voice that can be recorded in certain conditions and is of the auditory tests in the comprehensive check-up for students.This part mainly includes ISD4004-16MS [4], which provide high quality, single-chip record, or playback solutions for 16-minute message applications and whose block diagram is shown in Figure 2. The speech samples are stored directly into on-chip nonvolatile memory without the digitization and compression associated with other solutions.Direct analog provides a natural sounding reproduction of voice, music, tones, and sound effects not available with most solid-state solutions.It provides zero-power message storage and the single or multiple message is retained for up to 100 years (typically) without power.In addition, the device can be re-recorded (typically) over 100,000 times.Address and control are accomplished through a Serial Peripheral Interface (SPI) or Microware Serial Interface to minimize pin count.By microcontroller STC11F16EX, the needed voice and audio sound can be recorded and playback at right time and can meet our aim.
3) Single frequency generator The primary aim of single frequency generator, in which AD9833, a programmable waveform generator, is selected, is to generate single frequency sine signal for measuring loudness level curve, the human hearing and impedance characteristics.The AD9833 [5][6][7],whose function block diagram is shown in Figure 3, is a low power, programmable waveform generator capable of producing sine, triangular, and square wave outputs.The frequency, phase and waveform of outputting signal are software programmable.The frequency registers are 28 bits wide.As the result, the output sine frequency is: where is the value loaded into the selected frequency register, means input clock rate.Each channel has attenuation steps of 0.5 dB from 0 dB -47.5 dB, 1.0 dB steps from 48 dB -78 dB, with a mute function attenuating 104 dB, which is shown in Figure 5.Its logarithmic attenuation curve can be Customized through software to fit the desired application and the performance of a μPot is demonstrated through its excellent Signal-To-Noise Ratio, extremely low (THD + N), and high channel separation.Each μPot contains a mute function that disconnects the input signal from the output, providing a minimum attenuation of 96 dB.Transitions between any attenuation settings are pop free.The LM1972's 3-wire serial digital interface is TTL and CMOS compatible.Therefore, with STC11-F16EX sending data that selects a channel and the desired attenuation level to LM1972, the needed attenuation level of signal can be obtain.The operational amplifier-OP2177 consists of very high precision, dual amplifiers featuring extremely low offset voltage (60 μV maximum )and drift, low input bias current (2 nA maximum), low noise, and low power consumption.OP2177, together with LM1972, can output needed amplitude signal and have enough ability of driving stereo audio power amplifier.

Software
To realize the function, the software of this instrument must be designed, and we completed it by Kiel uVision3 for STC11F16EX with C language.The software, whose control flow is shown in

Operation Mode
This instrument mainly are two audio signal sources which one comes from ISD4004-16MS and the other is generated by AD9833.The former can get various natural sound such as voice, music, tones, while the latter can only produce single frequency signal.For the latter, two working mode, continuous and discontinuous frequency mode, is designed.Two working mode can be directly switched through the key "work mode choice".In successive frequency work mode, its output frequencies of signal have 0. Hz, 2500 Hz, 3000 Hz, 3500 Hz, 4000 Hz, 4096 Hz, 4500 Hz, 5000 Hz, 5500 Hz, 6000 Hz, 6500 Hz, 7000 Hz, 7500 Hz, 8000 Hz, 8192 Hz, 8500 Hz, 9000 Hz, 9500 Hz, 10,000 Hz, 11,000 Hz, 12,000 Hz, 13,000 Hz, 14,000 Hz, 15,000 Hz, 16,000 Hz, 16,384 Hz, 17,000 Hz, 18,000 Hz, 19,000 Hz, 20,000 Hz.No matter which kind of work mode, it is no influence for volume adjustment, but for different frequencies, the ranges of output sound volume have different decibels values, this is to say, the scope is different for different frequencies because headset of audio has not same response to different ones, and microcontroller program made a corresponding modification.

Disussions and Conclusions
This instrument adopts single-chip control and highperformance sine waveform, so, it can output high precision frequency (frequency error < 0.004 Hz) and high purity pure single audio sound, and applied LCD to display all kinds of information.This instrument equipped with two kinds of sound sources, therefore, it is convenient for the audio test and experiment.In addition, all kinds of control and choices are application of electronic switch without mechanical contact, by using in practical, it is not only convenient operation, simple, and working stability and reliability is extremely high.
Certainly, this instrument can be used as high-precision frequency and high-drive sinusoidal signal source for research and teaching in testing human impedance characteristics.
In a word, this instrument has very good novelty and practicability.Additionally, touching buttons, which is simple and convenience to use, is selected.Hence this instrument is convenient to measure and teach about hearing specially, research and study on frequency characteristic of human ear and impedance characteristic of human body in medical science.

Figure 1 .
Figure 1.Block diagram of the instrument.

a 1
MHz clock rate, the AD9833 can be tuned to 0.004 Hz resolution, and we can obtain single f frequency signal with enough high precision of fre-Certainly, after STC11F16EX sends corresponding data to selected frequency register, we can get the needed frequency sine signal.4)Audio fader amplifier For major target of getting needed signal whose amplitude meets our demand, a digitally controlled 2-channel audio attenuator-LM1972[8] and a precision low noise, low input bias current operational amplifier-OP2177 are applied.The LM1972, whose function block diagram is shown in Figure4, is a digitally controlled 2-channel 78 dB audio attenuator fabricated on a CMOS process.

Figure 6 ,
is primarily composed of one main program and six subprograms which are ISD4004-16MS control, AD9833 control, audio selection, volume control, display and read key subprograms.Main program mainly calls read key subprogram to obtain the user input information and calls the corresponding subroutine to display frequency, amplitude and to choose right audio source and channels output.Read key subprogram mainly gets the input keys' value and inform the main program.Display subprogram controls LCD-FM19264 to display information, such as frequency, volume, and sound source.ISD4004-16MS control subprogram realizes sending data and command to ISD4004-16MS for producing right audio sound or disabling it.AD9833 control subroutine makes AD9833 generate corresponding frequency sine signal or disable it.Audio selection subprogram controls ADG1421 for selecting right audio signal source.The volume control subroutine mainly makes audio logarithmic digital potentiometer LM1972 choose corresponding position, that is to say, output right amplitude audio signal.