Department of Experimental Psychology, University of Cambridge,
Downing Street, Cambridge CB2 3EB, England.

This disc contains the executable program "LOUDAES" which should run on an 
IBM PC or compatible. It calculates the loudness of a sound according to 
the procedure described in Moore, Glasberg and Baer(1997).  This procedure 
is only applicable to subjects with normal hearing.

Each stimulus is specified in terms of its spectrum, which can be 
entered in several ways: as a series of sinusoidal components; as one or 
more pink or white noise bands; as a mixture of these two; or as the 
level in each successive one-third octave band.  

The disc also contains the program "PARTLOUD" which can be used for 
calculating the loudness of a sound in the presence of a background 
sound.  This program is also applicable only to normal hearing.  For the 
program PARTLOUD, the spectrum of the signal is entered separately from 
that of the background.  If the signal is completely masked by the 
background (according to the calculations performed by the program), a 
message to that effect is given and no loudness is specified.

To run the program LOUDAES you can either just type

LOUDAES

and answer the questions one at a time (manual input), or you can use an 
input file such as the example LOUDFF.IN and type

LOUDAES < LOUDFF.IN

There are two "flags" (command line options); these are

-p	This turns off some of the information that is printed to the
	screen.
-q	This prevents the "questions" from being printed to the screen. 

If you just want to know the final loudness, and you are using an input file,
use both options:

LOUDAES -p -q < LOUDFF.IN

By default, the answer is printed to the screen.  If you wish the result to be 
stored in a file, type

LOUDAES < LOUDFF.IN > LOUDFF.OUT

The result will then be stored in the file LOUDFF.OUT

The format of the input file can vary depending on various options in 
the program; some of the questions asked by the program are conditional 
on the answers given to earlier questions.  Therefore, to be sure that 
an input file is in the right format, you may need to go through the 
stage of running the program with manual input. 

The contents of the example file LOUDFF.IN are described below:

f		This selects free-field presentation (frontal incidence)
f		This selects frontal (as against diffuse) presentation
b		Specifies binaural presentation
m		This selects a mixed signal containing sinusoids and noise
h		This selects a harmonic signal for the sinusoidal part
800,1200,200	Frequencies of lowest harmonic, highest harmonic and F0 
0		No components are removed (complete harmonic series)
1		One inharmonic component is added
1750		Frequency of added inharmonic component
60		Level in dB SPL of first harmonic component
65		Level in dB SPL of next harmonic component
63		Level in dB SPL of last harmonic component
61		Level of added inharmonic component
p		Pink noise is added
1500		Frequency at which the spectrum level of the pink noise
		is specified
45		Spectrum level of the pink noise in dB at the specified
		frequency
1000,1200	Lower and upper frequency limits of pink noise
20		Spacing of noise components; the noise is approximated as
		a series of sinusoidal components with the specified 
		spacing.  For highest accuracy the spacing should be less
		than 0.25 ERB in the frequency region of interest.  The
		spacing can be increased to speed computation, but
		to avoid large errors it should not be more than 0.5 ERB.
e		End of noise spectrum input
s		Stop execution

If an "s" is not encountered the program assumes that a new data set 
will be present, i.e. it will calculate the loudness of the next signal 
specified.  In this case it is assumed that the subject and conditions 
of presentation are the same.  Thus, the program assumes that the 
specification starts from line 4 (m above).

Note that the resulting output is the calculated total loudness of all 
the sinusoidal components plus the noise.  The answer in this case is 
14.48 sones, equivalent to 78.6 phons.

Another example input file is described below.  This file, LOUDHP.IN, 
illustrates calculations for stimuli presented via headphones.

To run this type LOUDAES < LOUDHP.IN

The file contents are as follows

h		Specifies that headphone presentation is used.
y		A correction file is to be specified to allow for the
		non-flat response of the headphone at the eardrum
tdh.39		The name of the correction file.  The first line in 
		this file specifies the number of points, N (28 in this 
		example). This is followed by a list of N frequencies, 
		separated by commas. Then follows a list of "corrections" 
		in dB, indicating the differences between the nominal input 
		level and the level actually achieved at the eardrum.  
		For example, for a nominal input level of 60 dB SPL, the 
		eardrum sound pressure at 80 Hz might be 44.7 dB SPL, so 
		the correction is 15.3 dB.  Note the convention that the 
		correction is positive when the eardrum SPL is below the 
		nominal SPL.
		Some headphones (e.g. the Sennheiser HD414) are designed 
		to have a free-field response, i.e. their response at
		the eardrum is similar to what would be achieved with
		free-field presentation.  In such cases, it may be 
		simpler to specify f for free-field rather than h for 
		headphones.  
b		Specifies binaural presentation
o		The stimulus will be specified as the levels in 1/3
		octave bands.  The program runs more slowly when this 
		option is selected.
10		Level in first 1/3 octave band
10		Level in second 1/3 octave band
.
.
.
.
.
.
20		Level in 26th (last) 1/3 octave band
s		Stop execution 


A third example input file is TONE.IN.
Try running it as:

LOUDAES -p -q < TONE.IN

  The contents of this file are as 
follows:

f		Free-field presentation
f		This selects frontal (as against diffuse) presentation
b		Binaural presentation
t		Tone signal
i		Inharmonic signal
1		One component
1000		Frequency of 1000 Hz
60		Level of 60 dB
t		Another tonal signal
i		Inharmonic signal
1		One component
1000		Frequency of 1000 Hz
70		Level of 70 dB
s		Stop execution

The program can be interrupted by typing ctrl-C (hold down the ctrl key 
and press C). 

The program PARTLOUD is used in a similar way.  You can either type

PARTLOUD

and answer the questions, or you can use an input file.  A suitable 
input file is PARTLOUD.IN.   So, to run this program, type

PARTLOUD < PARTLOUD.IN

The contents of the input file are as follows:

f		This selects free-field presentation
f		This selects frontal incidence (not diffuse)
b		This selects binaural listening
t		This selects a complex tone signal
h		This selects a harmonic signal
800,1200,200	Frequencies of lowest harmonic, highest harmonic and F0 
0		No components are removed (complete harmonic series)
1		One inharmonic component is added
1750		Frequency of added inharmonic component
60		Level in dB SPL of first harmonic component
65		Level in dB SPL of next harmonic component
63		Level in dB SPL of last harmonic component
61		Level of added inharmonic component
n		Type of partial masker - noise in this case
p		Pink noise for the partial masker
1500		Frequency at which the spectrum level of the pink noise
		is specified
45		Spectrum level of the pink noise in dB at the specified
		frequency
1000,1200	Lower and upper frequency limits of pink noise
20		Spacing of noise components
e		End of noise input
s		Stop execution

The calculated partial loudness is 7.95 sones, 69.7 phons. 

Both programs give some information in addition to the calculated 
loudness.  This information is suppressed when the -p flag is used.
The program LOUDAES displays four columns.  The first gives the 
filter centre frequency (spaced uniformly in ERBs).  The second gives 
the interpolated excitation threshold (in dB HL) at each frequency.  The 
third gives the excitation level and the fourth gives the specific 
loudness.  Results are only displayed for frequencies where the 
excitation is above threshold.

The program PARTLOUD displays seven columns.  The first is an index 
which should be ignored.  The second gives the number of ERBs. The third 
gives the filter centre frequency (spaced uniformly in ERBs). The fourth 
gives the total excitation level evoked by the signal and background. 
The fifth gives the excitation level evoked by the background alone and 
the sixth gives the excitation level evoked by the signal alone.  The 
seventh gives the specific partial loudness. 

Reference

Moore, B. C. J., Glasberg, B. R., and Baer, T. (1997). A model for the 
prediction of thresholds, loudness and partial loudness. J. Audio Eng. Soc., 
45, 224-240.

Please let us know if there are any problems, but no promises
come with this software.  

Brian Moore and Brian Glasberg, February, 1998
email: bcjm@cus.cam.ac.uk, bg12@cus.cam.ac.uk
