You are on page 1of 6

PERSONAL CALCULATOR PROGRAMS

Airborne Noise: A Personal Calculator Program for A-Weighted Sound-Pressure Level, Noise-Rating Evaluation, and Preferred Noise Criterion
BEN BERNFELD IRCAM, Paris, France '

Guest Editor's

Introduction

The publication in the pages of the Journal of a sar es of papers dedicated to the useof programmable personal calculators in the fields of audio and acoustics responds to a real need of our readers. In our every-day professional life, we are more and more assisted by this small, clever and reliable instrument, Nevertheless, some users are not aware of the programming potential of their calculators and thus, do not go further than using simple ad_metic operations, But the programming pedor_nce of certain personal calculators approaches that of conventional computers. Even if a calculator is slower than, and has a smaller memory capaci_ than, an average rom. puter, because of the prewired functions there are actually certain operations that are more easily performed with it: even in powerful large computers you cannot (without writing corresponding software) directly convert radians into degrees and rectangular into polar coordinates, nor directly program common logarithms, antilogarithms, factorials, and statistic summations--operations which are trivial with personal calculators, At the present time, apartfrom one ortwo papers on personal calculator programs from Past convention of the Audio Engineering Sec ety, a few invited papers in preparation, and some materia[written by this author, we rely mainly on input from Journal readers, we are sure that a lot of outstanding programs, created by* audio engineers, are already in existence and could-if publ shed--benef t all. lease send them to us. The philosophy of this series is not only to report on_

commen_ for each program (with examples), to make them accessible and useful. Contributions based on any commemially available calculators are welcome, although programs written for Hewlett Packard or Texas Instruments calculators will find the most users. If alternative programs exist and not enough space is available for listing them in the Journal, we expect authors to be willing to send such "translations" to interested readers. It will be a pleasure for the guest editor of this sar es to be at the disposal of potential contributors for quedtions or advice. DOnot hesitate to write, even if you have in mind a project not yet well defined. Ben Bernfeld c/e IRCAM 31 Rue St.-MerE F-75004 Paris, France

0 INTRODUCTION Noise specifications for studios, auditoriums, and living environments are usually given, in accordance with international standards [1 ], in A-weighted sound-pressure levels (SPL). Nevertheless acousticians frequently use the noiserating (NR) index [2] and the preferred noise criterion (PNC) [3]. Unfortunately no fixed relationship exists between these three evaluations, the results depending on the spectrum of the noise. The A-weighting curve is based on the approximation of the average spectrum of human hearing sensitivity for the lower range of SPLs; the Iow and high frequencies are attenuated to imitate the effect of human hearing. The measurement of the A-weighted SPL is simple. Preceding the measuring instrument ihe signal is routed
899

algorithms are derived and, 0} course, tO provide -. * _

JOURNAL OF THE AUDIO ENGINEERING SOCIETY, 1979 NOVEMBER, VOLUME 27, NUMBER 11

BERNFELD

PERSONAL CALCULATOR PROGRAMS

through a network with a frequency response identical to the weighting curve. If information about the noise spectrum is required, measurements of the SPL have to be carried for each frequency band (for example, octaves), and the A-weighted SPL is computed by summing the individual weighted levels [see Eq. (3)]. To obtain the NR index (Fig. 1), the measured SPLs for different octaves have to be drawn on the NR graph (points A- N in Fig. 1). The highest NR curve on which lies one of these p_6ints(in our example point A, NR = 50 dB) reprosents the NR index. The PNC value is obtained in a similar way. For point A, PNC= .65dB. 1 ALGORITHM FOR THE A-WEIGHTING CURVE

that is, a function of the variable Loc t with frequency as the parameter. For example, we have to find NR = 50 dB for the measuredLoct A = 76 dB at the frequency of 63 Hz. (see Fig. 1). For better matching with the A- weighting computation, the transformx = log(f) was again used. By computer polynomial curve fitting the following equation was found: NR = 7.8x 3 + (0.098L - 81.8)x 2 - (0.685L - 292.4)x + 2.171L - 351.3 (4) where L is the octave SPL in decibels, x = log f, and f theoctave midfrequency inhertz. The maximum error in the range of 15 _ NR --_65 is less than 2 dB.

As no analytic expression for the A-weighting curve seems to be available, a suitable equation has to be obtained by curve fitting. Thus from a recent paper by Bevan et al. [4, p, 952], the following equation was obtained by computer simulation of a complex RC network: W= 4[1+(1-_-)2][1+( 31-_)2][1+( 2.81 10-' f

3 ALGORITHM

FOR THE PNC

By a similar procedure the following equation was found

(2vrf) 4 f (1)

Although the results obtained by the use of this equation are precise, the complexity makes it incompatible with personalcalculator programs, Another approach consists of the use of a logarithmic scale for the frequency and apolynomiai fit. For a polynomial of second degree the equation will be W = -1 lx 2 + .74.5x - 124.5 (2)

forthe PNC: PNC = (0.184L14.7)x2+ 3.17L - 200. (1.271L110.7)x (5)

For this equation the error is also !ess than 2 dB.

where x = log f, fbeing in hertz. In Table 1 the EIC A-weighting figures and the figures obtained by Eqs. (1)_ and (2) are listed for octave bands. As can be seen, the precision of the quite simple equation (2) is not worse (error --<0.5 dB) and satisfactory for all practical applications. The octave-weighted level is obtained by adding the respective weighting figure to the measured SPL. To sum the individual A-weighted levels in order to obtain the t0t_il.A-weighted_.SPL, the individual levels are converted in magnitudes, algebraically summed, and the result is convertedback into decibels: SPL = 10 log _ 10'l Loot 2 ALGORITHM FOR THE NR INDEX (3)

4 DESCRIPTION

OF THE PROGRAM

The program, given in Tables 2 and 3, is suited for HP-29 and HP-67 calculators and can be easily adapted for the respective printing versions HP- 19 and HP-97. Dueto the limitedmemorycapacityit is notpossibleto first enter all octave levels and then let the calculator do the remaining work without further commands (as for the TI-59 "translation" given in the Appendix). For each frequency the computation has to be completed. However, the entire cycle takes only about 3 minutes (about 25 seconds for each octave). Both HP programs are identical, with the exception of the data register allocation and specific differences in the names of certain functions For this reason two data-register allocations are given in Table 4. Users of HP-29 calculators should be aware that the content of the indirect registers (Ri6-R29) gets lost when the calculator is turned off. Steps 1- 8 represent the initialization of the program, that is, the introductionof the firstfrequency(63 Hz) and the clearing of some data registers. At step ! 1 the program stops, displays the frequency, and waits for the user to input thecorresponding octave SPL. In steps 12-28 this level is siored in register 06/E, and the common logarithm of the frequency, its square,andits

The family of NR curves could also be simulated by a complex RC network. What we need for our purposes, however, is not a mathematical expression of such a curve family,but a function: NR = G(Loct, f ) , The curve was shifted by +1.2 dB in order to match the ISO curve,
900

JOURNAL OF THE AUDIO ENGINEERING SOCIETY, 1979 NOVEMBER, VOLUME 27, NUMBER 11

PERSONAL CALCULATOR PROGRAMS

AIRBORNE NOISE

cube, are calculated and stored in registers 02, 03, and 04, respectively. In subroutine7 (steps 54-85) Eqs. (3)-(5) are calculated for the given frequency and octave SPL, the NR and PNC values being stored in registers. 1/C and .2/D, while the magnitude of each A-weighted octave sound pressure is summed in .3/06. For programming enthusiasts it is of interest to mention that due to limitedmemorycapacity, the coefficientsof the equations are stored in pairs. If one coefficient is abc.d and the second is -e.fgh, they are packed in the form abcd.efgh. Steps 57-62 unpack them into their original forms. The four steps 23- 26 are important. A decision has to be made about the final NR index. As we explained in the Introduction, the maximum individual value will be the NR index. For this purpose the program compares the contents of the data registers .1/C (last NR value) and 9 (new NR value). If the last value is larger than the new one, the

Table 2. Program for the HP-29 calculator. STEP 131 13 2 133 1360S 06 07 08 09 113 11 12 13 It+ 1S 1G 17 18 19 213 21 22 23 24 25 27 2g 28 38 31 33 34 35 313 37 38 413 0PER. , LRL 0 RCL. STO S S 13 STO. 1 ST0.2 ST0.3 FIX LBL 13 4 RCL 5 R / S ST0 B X<--*Y LOG STO 2 x2 ST0 3 LST g x STO 4 4 GSB B RCL. 1 RCL 0 X>Y GSBS STO. 2 1 RCL. X > Y STO.2 RCL 9 RCL G + RCL.4 i13x 2 ST S 2 5 STO 7 GTO 4 STEP 51 5 2 53 54 SS SG 57 58 59 60 61 62 63 6665, 66 67 68 69 70 71 72 73 74 75 77 76 78 80 81 83 84 85 86 87 88 0PER. ST0 9 GSR RTN 7 , LBL 7

[ICL7
ST0 0 [ICL i INT LSTX FRC CHS ENT 'l' RCL.6 x ENT 4' RCL 6 X X<--_Y RCL. 4 :+ STO 8 1 ST -7. RCL.O RCL i STO 8 13 RCL ST +9 1 DSZ GTO 7 RTN *LBL1 RCL. LOG 3

g0toct nR

8o [_x._ '?"_ -'_'

7O

mc ..... 65 _

6O

,.."--?_

5o -IN ,_.X'N_,._ _

ss'_.-._..____ "-"':"____ '.__-'2__ '_,_ ....

40 ,_..__.. l-.._k' ,_x-,,__,,_._._ "_

,._,_,, _.,

,913 x 91 92 93 94 35 R / S LBL 2 RCL. 1 R / S * LBL 3

30

_x_,_

'" _"

""_

30--,_

41 42 43 6-4 45 4G

_"x'x ..'_, _ '----_ ,,_,.'_ zo x, _ zo


10

\"x_

",_

-.,.
1000

15'_-,"--:'--'""_'_' 10-_, _-

* LBL S 4.7 3 4.8 * LBL6

97
96

[I/ s
RCL. 2

0 63 125

__________ __ 0._._ .....5'_ ""_


250 Fig. 500 2000 I. NR and PNC curves.

'-%'"_'"'
4000 8000 Hz.

5049

13ST0' 13

Table 1. A-weighting

curves.

I t4 / f
I a. EIC

I 63
I -26.2

I i2s
I -16.1

2513 I 5130 I i131313 I 2131313 I 4.13138 I 81331313 I


I -3.2 I 8.13 I +1.2 I +1.0 I -1.1 I

I -8.6

I b.
I c.

Eq.1

I -26.5 I -i6.2

I -8.7
I

-3.2

I 13.13I+i.2 I 0.0 I +i.6

I +0.8 I +i.i

I -i.s I -i.3

I I
901

Eq.2 I -26.2 I -16.6

-9.1

I -3.6

JOURNAL OF THE AUDIO ENGINEERING SOCIETY, 1979 NOVEMBER, VOLUME 27, NUMBER 11

BERNFELD

PERSONAL CALCULATOR PROGRAMS

content of register. 1/C will remain unalte_d;

if the new

5 EXAMPLE To check the program and give you a feeling about how it works, we took agmn the example of Fig. 1 (levels marked by points A- H) and computed the NR index, the PNC, and the A-weighted SPL. The results are given in Table 5. NOTE: The same keying as Ar the HP-67 is used Ar running the TI-59 program. (0.00000000 is displayed when the computation is completed.) Table4. Datastorage.

value is larger, it will replace the last value in register. 1/C. The is used for searching the final PNC in stepssame 28- procedure 31. In steps 40-45 the frequency is multiplied by 2, the index Ar the indirect registers is stored back in 07, the loop .is closed, and the frequency of the next octave is displayed (again step 11). After the introduction of all octave SPLs (display 16 000 Hz), He resultscanbe calledas Allows: A-weighted SPL by keying GSB 1 /A NRindex by keying GSB 2 / B PNC by keying GSB 3 / C (steps 86-91) (steps 92-9_ (steps 95- 97).

REGISTER HP-19 00 81
82

DATA STORED HP-29 used 1.8


used

HP-67 88 81
82

HP-G7 6.0 1.8


used

Table 3. Program _r the HP-67 calculator.

STEP 81 82 83 84 85 86 87 88 89 18 11 12 13 14 15
16

OPER.

STEP S1 52 53 54 55 56 57 58 59 68 G1 62 63 64 65 66 67 68 69 78 71 72 73 74 75 76 77 78 79 88 81 82 83 84 85 86 87 88 89 98 91 92 93 94 95 9g 97

OPER. STO 9 GSB 7 RTN LBL7 RCL 7 STOI RCLi INT LSTX FRC CHS ENT ? RCLB X ENT? RCL E X+_Y RCL B + + STO 8 1 ST -7 RCL 8 STO I RCLi RCL8 ST +9 1 ST -8 DSZ OTO 7 RTN LBL A RCL g LOG RCL B R / S LBL B RCL C R / S LBL C RCL O R / S

* LBLE RCL A STO S 8 STO C STO O STO 6 DSP8 * LBL 4 RCLS R / S STO E X+Y LOG STO 2
x 2

17 18 19 28 21 22 23 24 25 2G 27 28 29 38 31 32 33 34 35 38 37 38 39 48 41 42 43 44 45 46 47 48 49 58
902

STO 3 LSTX x STO 4 4 GSB 6 RCL C RCL 9 X>Y STO C GSB 5 RCLD RCL 9 X > Y STO O GSB S ECL 9 RCL E + RCL B + 18 x ST +8 2 ST S 1 9 STO 7 GTO 4 LBL 5 3 , LBL 6 STO 8 8

03 84 85 8G 87 88 89 .0 .1 .2 ,3 .4 .5 16 17 18 19 28 21 22 23 24 25

83 84 G5 OG 87 88 09 10 11 12 13 14 15 16 17 18 19 A B C O E I

used used used used 25.0 used used 4.8 used used used 18.8 62.5 1245.8 745.8 118.8 2888.3178 11871271 147 8184 35132171 29248685 818 8098 78 8

used used used used 19.8 used used 1245.8 745.8 118.8 2_9.3!70 1!07.1271 147.8184 3513.2!71 2924.8G85 818.8838 78.8 62.5 used used used used used

Table5. Computingexample. INSTRUCTIONS 1. 2. 3. 4. 5. 6. 7. 8. 9. 18. 11. 12. 13. 14. 1S. 16. 17. GSB 8 input R/S input R/S input R/S input R/S input R/S input R/S input R/S input R/S / E 7G 63 58 58 48 45 48 32 [ dB(A) [ NR [ PNC DISPLAY 63. 76. 125. 63. 258. 58. 588. 58. 1888. 48. 2888. 45. 4888. 48. 8888. 32. 16888. = ] = ] = ] 56. 51. 64.

18. GSB i / A 19. GSB 2 / B 28. GSB 3 / C

JOURNAL OF THE AUDIO ENGINEERING SOCIETY, 1979 NOVEMBER, VOLUME 27, NUMBER 11

PERSONAL CALCULATOR PROGRAMS

AIRBORNE NOISE

APPENDIX Table 6 lists the programming culators. The symbols _e stand_d. _llowing symbols: ST*--store indirect RC* --recall indirect X--T--change X with T ISBR--invemesubroutine. steps _r TI-59 caiNotice, however, the

6 REFERENCES [1] IECPubl. 179(1965) and ANSI S1.4-1971. [2] I S O Recommendation 1996, Appendix Y. [3] L. Beranek,W. E. Blazierand G. Figwer, "Re&_ed Noise Criterion Curves and the Application to Rooms," J. Acoust. Soc. Am., vol. 50, p. 1223 (1971). [4] W. R. Bevan, R. B. Schulein,and C. E. Seeler, "Design of Studio-Quality Condenser Microphone Using Electmt Technology," J. Audio Eng. Soc., vol. 26, pp. 947- 951(1978Dec.).

Table 6. Program _r the TI-59 calculator. 800 881 882 803 804 805 886 807 808 009 8!0 811 812 813 814 815 816 817 818 819 820 821 822 823 024 825 826 027 028 029 830 031 032 033 834 035 036 037 838 039 040 041 042 LBL E 0 STO 11 STO 12 STO 13 1 8 STO 85 2 6 STO 86 3 3 STO 87 RCL !S STO 18 FIX 8 LBL STO RCL 10 R/S ST, 0G RCL 10 LOG ST, 85 RCL 85 X~T 2 043 844 845 046 847 848 849 850 851 852 853 054 055 056 057 058 859 060 861 862 063 064 865 886 867 868 069 870 071 072 073 074 075 076 877 878 879 880 88! 882 883 884 885 S X=T EE OP 25 OP 26 2 PRO 10 GTO STO LBL EE 1 8 STO 05 2 G STO 0G RC, 85 STO 02
X 2

STO 83 x RCL 82 = STO 64 4 SBR CLR RCL 12 X,_T RCL 14

086 887 888 889 090 091 092 093 894 095 096 097 898 899 188 181 102 183 104 185 185 187 188 189 110 !11 112 113 114 1i5 116 117 118 119 128 121 122 123 124 125 126 127 128

INV XzT 0 92 STO 12 3 SBR CLR RCL 13 X~T RCL 14 INV X_T 1 86 STO 13 3 SBR CLR ( RC, 06 + RCL 14 ) + 1 0 = INV LOG SUM 11 RCL 05 X~T 2 5

129 138 131 132 133 134 135 136 137 138 139 140 141 142 143 !44 145 146 147 148 149 150 151 152 153 154 1SS 156 157 158 159 160 1S1 162 !63 164 !65 1GG 167 163 165 170 171

X=T RCL OP 25 OP 26 3 3 STO 87 GTO 8 65 LBL CLR STO 00 8 STO 14 SBR B' ISBR LBL B' OP 27 ( ( RC, 07 x RC, 86 + OP 27 RC, 07 ) RC, 80

172 173 174 175 176 177 178 179 188 181 182 183 184 185 186 187 188 189 198 191 192 193 184 !95 !SS 197 188 159 288 201 282 283 2_4 205 286 207 2_8 289 218

) SUM 14 DSZ 88 B' ISBR LBL RCL 0 FI)< 8 R/S LBL A FIX 0 RCL 11 LOG x 1 0 = R/S LBL B FI)( 8 RCL 12 R/S LBL C F_X 0 RCL 13 R/S

DATA REGISTERS RO1 1.0 R1S 62.5 R35 7.8 R36 8,898 R37 - 81.8 R38 - 0.685

(clear

register

memorg

before

storing)

R39 292.4 R40 2.171 R41 - 351.3 R42 8.184 R43 - 14.7 R44 - 1.271

R45 118.7 R46 3.17 R47 - 280.0 R49 - 11.0 RS1 74.5 R53 - 124.5

JOURNAL OF THE AUDIO ENGINEERING SOCIETY, 1979 NOVEMBER, VOLUME 27, NUMBER 11

,903

BERNFELD

PERSONAL CALCULATOR PROGRAMS

THE AUTHOR

Benjamin Bernfeld was born in 1928 in Brasov, Rumania. He graduated wi'th a degree in electrical engineering from the Leningrad Institute of Motion Picture Engineering in 1954 and in 1975 received the DocteurIng6nieur degree from the Louis Pasteur University of Strasbourg, for which his major field was psychoacoustics of sound localization. Dr. Bernfeld worked in the field of audio engineering as a research engineer and was employed as a recording engineer of classical music from 1957 to 1974 in Electrecord Studios, Bucharest. In 1975, Dr. Bemfeld joined E. Voelker Acoustical Consultants in Frankfurt, Germany, and since 1977 has been chief sound engineer of the IRCAM Research Institute in Paris. He is a memberof the AudioEngineering Societyand has presented several papers at its conventions.

==

904

JOURNAL OFTHEAUDIOENGINEERING SOCIETY1 , 979NOVEMBER, VOLUME 27, NUMBER 11

You might also like