# EE2.LabB: Measurement and processing of room impulse responses

Teams: 2-4 members per group Audacity, Matlab One week allocated.

## Aims of the Experiment

• The aim of this experiment is to learn how to make MLS-based impulse response measurements and how to use them for analysis and post-processing.

## Equipment

• Two omnidirectional microphones (AKG 414), one loudspeaker, one multichannel soundcard, sound pressure level meter, ear protecting/sound insulating headphones, tape meter, balloons.
• Sound files (on campus only): MLSdual.wav, Cello_Anechoic.wav

## 1. Background

### 1.1 Maximum length sequence (MLS)

A maximum length sequence (MLS) is a pseudo-random binary signal made up of auto-generative 1 s and −1 s commonly used in acoustic measurements. This signal contains equal amounts of energy for all frequencies. Due to its randomness in the time domain, auto-correlation of MLS results in the Dirac delta function.

Consider a linear system with input x(t), transfer function h(t) and output y(t). For this system the cross-correlation between the input and the output, Rxy(t) equals the auto-correlation of the input signal, Rxx(t) convolved with the transfer function h(t):

Rxy(t) = Rxx(t) * h(t).

If the input signal is an MLS, then,

Rxx(t) = δ(t)
Rxy(t) = δ(t) * h(t) = h(t).
Therefore, the transfer function, i.e., the impulse response of a room can be calculated by computing the cross-correlation between the original MLS and its recording in the room.

### 1.2 Reverberation time and decay curve

The reverberation time is the time in seconds that the sound pressure level decreases by 60 dB, at a rate of decay given by the linear least-squares regression of the measured decay curve from a level 5 dB below the initial level to 35 dB below.

The decay curve, E(t), is calculated as

E(t) = 10 log10t h2(τ) ,
where h(t) is the impulse response.

### 1.3 Two-microphone source direction estimation

Two-microphone source direction estimation is done easily by assuming that the sound source is at the far field so that the paths that the sound wave takes from the source to the microphones are parallel to each other. Then using the geometry in Figure 1, the source direction can be found as

θ = cos−1 ( (d1d2 ) / a ).

As this method is based on the estimation of time delay of arrival, care should be taken to avoid aliasing. In order to avoid aliasing, the phase difference between a pair of microphones should be less than π. Then we require that 2πfmaxτ ≤ π, where τ is the time delay and fmax is the maximum frequency of operation. The time delay τ is maximum when the sound source is in line with the microphone pair and so τ = d/c, where d is the microphone spacing and c is the speed of sound. Therefore, d ≤ λmin/2 (or fmax ≤ c/2d), which puts a limit on the maximum frequency of sounds that could be localized by time delay information only.

## 2. Preliminary Work

1. List different reverberation time measurement techniques.
2. Calculate the total volume and total reflecting surface area of the recording environment whose floor plan is shown in Figure 2.
3. Estimate the reverberation time of the room using the Norris-Eyring reverberation equation below:
T = (−0.161V) / (S ln(1−α)),
where V is the volume, S is the surface area, and α is the mean absorption coefficient. Use α = 0.2 for the mean absorption coefficient for the time being.
4. Using this reverberation time, determine the minimum distance between the loudspeaker and the microphones:
dmin = 2 √((V) / (cT)),
where V is the volume of the environment, T is the estimated reverberation time and c is the speed of sound, which is approximately 344 m/s.
5. Auto-correlate the original MLS sequence which was provided and plot the result in Matlab. (You will use xcorr and plot functions in Matlab.) Determine the useful portion of the resulting function that gives a single impulse.
6. Calculate the aliasing frequency for human sound source localisation using the distance between your ears and comment on its relation to interaural time difference (ITD) and interaural intensity difference (IID) cues.

## 3. Experimental Work

### 3.1 Setup and sound level adjustments

1. Place the loudspeaker somewhere in the room at least 1 m away from major reflecting surfaces wherever possible. Position the microphones 12 cm apart while their mid-point is more than dmin distance away from the loudspeaker as shown in Figure 3(a). The loudspeaker should face the mid-point of the microphones. Position the heights of the microphones and the loudspeaker, so that they are at least 1 m.

1. On the floor plan of the room mark the loudspeaker and microphone positions indicating their distances from the walls.
2. Measure and record the A-weighted background noise level.
3. When the MLS signal is being played through the loudspeaker measure the peak sound pressure level at the microphone positions and adjust the sound level so that it is at least 45 dB above the background noise level. Protect your ears during this process! Record the adjusted peak sound pressure levels.
4. Make sure that the directivity pattern of the AKG microphones are set to omnidirectional (indicated with a circle) using the switches on the microphones.

### 3.2 Recordings

#### 3.2.1 Recording with MLS

1. Make sure that the gains of the microphone pair are the same. You can adjust the gains using the switches on the microphones. The cut-off settings of the microphones should be at 0 Hz.
2. The MLS signal has been repeated twice in the provided wave file to avoid the transient response of the loudspeaker affecting the recordings. Make a trial recording to observe this transient response. Adjust the gain of the microphones, so that there is no overloading, i.e., clipping of the recorded sound.
3. You are required to make three MLS recordings with three different positioning of the microphones as shown in Figure 2. The playing of the MLS signals and recording should be made synchronously. Make sure that the recording is stopped only after the reverberation completely dies out, not with the end of the MLS signal.

#### 3.2.2 Recording with an Impulsive Source

1. Instead of the loudspeaker you will use balloons to create impulsive sounds. Inflate a balloon and puncture it with a sharp object, while recording the burst sound. In this way make impulse response recordings for the three recording positions.

### 3.3 Analysis and Synthesis

The rest of the tasks will be carried out in Matlab. Therefore, transfer your files to your home directories and then to the Matlab workspace. You may use wavread function of Matlab to do this.

#### 3.3.1 Room Impulse Responses

1. Calculate room impulse responses from the MLS recordings by cross-correlating the recordings with the original MLS sequences and removing the unnecessary portions. Save the resulting impulse responses as 16 bit, 44.1 kHz wave files. (You will use wavwrite function for saving.)
2. Estimate the source direction by calculating the time delay between the impulse responses captured by the pair of the microphones using cross-correlation.
3. Convolve an anechoic sound with one of the calculated room impulse responses and save the result as a 16 bit 44.1 kHz wave file.

#### 3.3.2 Energy Decay Curves

1. Calculate and plot the logarithm of the energy decay curve, E(t) for one of the calculated impulse responses. You will need to implement a simple for loop and use the sum function to calculate the integral in Matlab.

1. Calculate and plot the logarithm of the energy decay curve for the impulse response recorded by bursting a balloon for the same setup and microphone.
2. Compare the two energy decay curves and comment on the factors that would lead to any differences.

#### 3.3.3 Reverberation Time Calculation

1. Estimate the reverberation time from the decay curve of one of the calculated impulse responses. For this purpose refer to the definition of the reverberation time. You will need to fit a line to the measured decay curve from a level 5 dB below the initial level to 35 dB below. Select only this portion of the decay curve which will provide the Y data. Also define the corresponding X data in seconds. Plot the Y data with respect to X data. In the Matlab figure window, open Basic Fitting in the Tools menu. Apply linear fitting with the "show equation" check box selected. Save this figure. Use the coefficients of the resulting line, p1 and p2 to solve the following equation for the reverberation time T:
−60 dB = p1 T + p2.
2. Using the Norris-Eyring reverberation equation below, estimate the average surface absorption, α:
RT60 = (−0.161V) / (S ln(1−α)),
where V is the volume and S is the surface area. Use the reverberation time calculated in the previous step.

 Dept. [ Home ] © 2004-11, written by Banu Gunel, maintained by Philip Jackson, last updated on 28 March 2011. Faculty