Convolution is an integral or sum that represents the overlap between two functions or vectors (Pauly). Convolving two signals essentially merges them together by emphasizing the characteristics they have in common and muting the ones they do not. As we discussed earlier, by convolving the input signal and impulse response of a system we can produce the output signal we would hear if we played the sound in/from that location. We have measured impulse responses for both the left and right microphones given impulses at varying angles relative to the microphones. The next step is convolution.
The equation for discrete convolution is straightforward;
where f and g are the two vectors we are convolving. In our case, the two vectors are the impulse response and input signal (i.e. the sound of a buzzing bee). As we briefly hinted at in the last subsection, we can convolve an input signal with the two impulse responses associated with a certain angle (left and right microphone recordings), create a two-track audio file with the two convolved vectors, and play the file so that the convolution with the left impulse response plays in the left ear and the convolution with the right impulse response plays in the right ear. We will do this now; our input signal is a recording of a person walking in a meadow, and we will use the impulse responses recorded from an impulse 80 degrees from the microphones (right side).
The impulse responses we are going to use are shown in Figure 5 -- they have been truncated to eliminate noise. The right microphone's impulse response is shown in blue, and the left microphone's impulse response is shown in red. The right response has a greater magnitude than the left's, which is sensible considering the impulse is at 80 degrees and therefore closer to the right microphone than the left. There is also a slight delay (21 samples, or .4 milliseconds) between the peak times of the right and left impulse responses; the right impulse response occurs just a little ahead of the left's, because the sound reaches the right microphone first. We can expect the left and right convolved signals to have similar behavior: The right convolved signal should have a higher amplitude and take place slightly before the left convolved signal.
This is exactly what we see in Figure 6. The blue and red lines in Figure 6a and 6b are the signal before and after it's convolved, respectively. The signal has a lower magnitude after it's convolved with the left impulse response and a higher magnitude after it's convolved with the right impulse response, which is what we expected to see since the impulse signal shown in Figure 6 has the same behavior. There is also a relative delay in Figure 6b, as per its corresponding impulse response, but that is not clearly visible since the delay is only 21 samples out of 250,000. If we were to play the left convolved signal and right convolved signal to someone's left and right ears, respectively, they should be able to use the difference in amplitude and slight delay between the sounds to judge the approximate angle it is playing from (80 degrees), which is the goal of the project.