An overview of how to carry out a recruitment simulation.

The simulation described below is essentially the same as used by Moore and Glasberg (1993).  The sequence of stages in the simulation is as follows: 

(1) A binary file containing the sampled input signal is filtered into thirteen frequency bands, or channels. 

(2) The channels are time aligned (The IIR filters in (1) have impulse responses of varying lengths.  This routine time aligns the peaks of the impulse responses). 

(3) The envelope in each channel is extracted, making use of the Hilbert transform (The signal is represented as an 'envelope' and 'fine structure').
 
(4) The envelope is processed to simulate the effects of recruitment. This is done by raising the envelope to a power greater than one.  The envelope is scaled so that a level of 100 dB in a specific channel gives an envelope magnitude of one.  Thus, a level of 100 dB is left unchanged.  Levels below 100 dB, corresponding to envelope magnitudes less than unity, become reduced.  For example, an envelope magnitude of 0.1 (corresponding to 80 dB) raised to the power 2 becomes 0.01 (corresponding to 60 dB).  For levels above 100 dB the level is left unchanged (since, in a recruiting ear, loudness generally reaches its normal value at a level of about 100 dB).  The processed envelope is recombined with the "fine structure" in that channel. 

(5) The 13 processed channels are recombined. 

Several programs are used to carry out these operations.  The starting point is a 16-bit binary file containing speech or other signals sampled at 16000 Hz (e.g. asl1.1, a 3-seconds long file).  The first stage is to filter the sampled file into 13 channels, using the program 'widefilt.exe': 

widefilt -i asl1.1 -o asl1.1fl 

In this example, -i indicates that the input file is asl1.1 and -o indicates that the output file is asl1.1fl.  The latter contains 13 channels of data which are not time aligned and a text file, biquad.tst, which is needed by the time alignment program (biquad.tst carries information on the channel number, 4 IIR coefficients used for bandpass filters, centre frequency along the 'E' scale (see formulae.c for how to convert this to Hz), 2 "don't care" numbers, and time delay in number of samples caused by filter).  

The 13 channel centre frequencies in Hz are: 

100,190,306,452,640,879,1184,1572,2067,2698,3503,4529 & 5837

The next program, 'f_align.exe', time-aligns the 13 channels: 

f_align -i asl1.1.flt -o asl1.1al 

'f_align' needs, but does not ask for, a file called 'biquad.tst' This file contains parameters that help with the alignment. The time-aligned output, asl1.1al, is used as input to the recruitment simulation program. 

The recruitment simulation program needs the 13-channel file, asl1.1al, and a text file (called here the 'audfile').  The 'audfile' contains information derived from the hearing-impaired audiogram which is being modelled.  Basically, this file specifies the power (expansion ratio) to which the envelope is to be raised for each channel.  Optionally, it specifies the gain to be applied to each channel to simulate linear amplification according to the NAL(R) formula (1986).  The audfile can be obtained either by running the program 'nal_calc.exe' or by directly editing a text file. 

'nal_calc' can be run simply by typing its name.  It asks for the name of the 'audfile' to be written and then asks for the absolute thresholds, in dB HL, of the impairment to be modelled, at the eleven frequencies:  

 .125, .25, .5, .75, 1, 1.5, 2, 3, 4, 6 & 8 kHz  

The output audfile has two columns containing 13 numbers each, one for each of the 13 channels used in the recruitment simulation.  The 1st column is the power to which the envelope of that channel will be raised, and the 2nd column is the gain in dB which the NAL prescription would require to be applied to that channel.  The recruitment simulation can work on any size file since an overlap-add technique (Allen, 1977) is used in the processing.  

The program nal_calc can also be run using an input file (for example 'r2.in') and typing:  

nal_calc < r2.in  

The input file 'r2.in' specifies that the output file (the audfile) is to be called 'n.r2'.  Hence, running the program as described results in the creation of a file n.r2 containing the two columns of 13 numbers.  An audfile called n.r1 is provided that specifies normal hearing (no recuitment and no applied gain).  

The recruitment simulation program can then be run by typing:  

recruit -i asl1.1al -o asl1.1r2 -n n.r2  

where -i specifies that the input (time-aligned) file is asl1.1al, -o specifies that the output file is asl1.1r2, and 
-n specifies that the audfile is n.r2 (there is also a '-v' option to print verbose comments as the processing continues).  

When used in this way, the NAL gain is NOT applied, i.e. the second column of numbers in the audfile n.r2 is ignored.  If it is wished to simulate the effects of linear amplification according to the NAL prescription, this can be done by typing -b (for boost) on the command line.  For example:  

recruit -i asl1.1al -o asl1.1r2 -n n.r2 -b  

Careful attention has to be paid to the levels of the input and output.  The operation of the recruitment simulation program depends upon absolute level in the input file.  The program 'recruit' has a default level calibration. A full scale 16-bit sinusoid has an SPL of 102 dB.  To measure the rms level of a 16-bit input or output file, a utility program called 'rlevel.exe' has been included.  This can be run by typing:  

rlevel filename  

For example, if you run this program using a file containing a full scale 16-bit sinusoid (ranging from -32767 to +32767) you should get an answer of 102 dB.  To change the calibration in 'rlevel' or in 'recruit', both can take a command line option '-d xxx' where xxx is the value in dB SPL of a 16 bit sinusoid.  

Suppose, for example, that a speech file is reported as having a level of 80 dB SPL using the default calibration ('rlevel filename' gives 80 dB as its answer, i.e. the RMS of 'filename' is 22 dB below full scale).  Suppose also, that it is desired to simulate the situation where the speech is presented with an RMS level of 90 dB.  To achieve this, you would specify a full-scale level of 112 dB.  If you type 

rlevel -d 112.0 filename  

you will get 90 dB SPL as the answer, and  

recruit -i filename.al -o filname.r -n n.r2 -d 112.0  

will carry out the simulation assuming that full scale = 112 dB SPL.  

'rlevel' works by examining each 10 ms frame of the input file. The frames are non-overlapping.  If the RMS value for the frame  exceeds some threshold value (the '-t' option) then it is included in the final RMS value.  If your recording has a lot of background noise, there is a danger that 'rlevel' measures this rather than the true speech level in the file.  This can be avoided by careful choice of the '-t' value.  The threshold value is taken as being relative to full scale which is called '0 dBV' (for reasons of history).  

The following source files ('C' code) are required for each executable:  

(1) For the filtering stage  

WIDEFILT is made from  

filtbank.c initial4.c filtunix.c formulae.c rwbiquad.c rwfiles.c cmplxmth.c recwide4.h & proto.h  

(2) For the time-aligning stage  

F_ALIGN is made from  

f_align.c rwbiquad.c  

(3) For the recruitment simulation stage  

RECRUIT is made from  

recruit.c args_in.c int2real.c cifft.c hilbert.c outbits.c nrutil.c crecruit.h & nrutil.h  

The following utilities are also included on this disk:  

NAL_CALC.C: produces the 'audfile' from an audiogram, needed by 'recruit'  

COMPLEX.C:  a simple program to make an example binary input file 

RLEVEL.C:   used to measure the RMS level of a binary file as well as give the signal range in the file  

DO_REC.BAT: an example batch file to run a simulation  

MAKEFILE:   a makefile for compiling the programs (Watcom 'C' for DOS).  

The following example files are included:  

asl1.1:     an example binary file of speech  

r2.in, r3.in, rx.in     These are example input files for nal_calc. They specify the hearing impairments simulated in Moore and Glasberg (1993).  

n.r1        An audfile specifying normal hearing and no NAL amplification.  

n.r2        An audfile specifying a flat loss of 50 dB HL 

n.r3        An audfile specifying a flat loss of 67 dB HL 

n.rx        An audfile specifying a sloping loss from mild to severe.  

WHOOPS ! If you get the following message after running one of the executables:

Stub exec failed: dos4gw.exe No such file or directory 

then the Watcom compiled executable has not found a copy of DOS4GW.EXE which enables it to map DOS into a 'flat' memory model of up to 16 Mbytes.  

References

Allen, J. B. (1977). Short term spectral analysis, synthesis and modification by discrete Fourier transform. IEEE Trans. Acoust. Speech Sig. Proc. 25, 235-238.

Moore, B.C.J. and Glasberg, B.R. (1993).  Simulation of the effects of loudness recruitment and threshold elevation on the intelligibility of speech in quiet and in a background of speech.  J. Acoust. Soc. Am. 94, 2050-2062.

Brian R. Glasberg, Brian C. J. Moore and Michael A. Stone
August, 1999 
