• No results found

7.2 Version 1: Phased Array Beamforming

7.2.3 Design Considerations

Array Size

The frequency response of a phased array of microphones is dependent on both the number of microphones it contains and the distances between them. At certain combi- nations of sound frequency and DOA the extra distance the sound wave must travel to reach each successive microphone is a multiple of the wavelength. When this happens the signals from the microphones are in phase. The delay and sum beamformer will interpret this as if the DOA of the wave is the same as the steered angle, even when that is not the case.

Equation 7.2 gives the normalised summation of the microphone signals as would be received by a delay and sum beamformer with N microphones equally spaced at intervals of L metres, as a function of the input wave frequency f and DOA θ. The derivation of this equation is given in appendix A.3.

1 N N −1 X m=0 exp(j2πf mL sin θ c ) (7.2)

where c is the speed of sound, which is 343m/s at 20◦C [39].

Figure 7.7 shows an example where there are 10 microphones at 20cm spacing. Ideally, the response will be at maximum for ±0◦ over all frequencies, and at minimum at all other angles and frequencies. Meaning that, ideally, the response will be at maximum only when the steering angle matches the wave’s DOA. Waves from other directions are completely ignored. What figure 7.7 shows is that the phased array is not ideal. Even with a large value of N and L there are certain combinations of frequency and DOA at which the phased array cannot be accurate. Furthermore, at low frequencies, regardless of the DOA, the response is near maximum. Meaning that the directionality of a wave cannot be measured this way if it is low frequency.

Figure 7.7: Example theoretical frequency response of a microphone phased array of 10 microphones spaced 20cm apart. The y axis is the DOA (in degrees) with respect to the angle in which the array is steered, the x axis is frequency of the sound wave. Areas of white indicate that the normalised summation is 1 and the signals are in phase. Areas of black are where the summation is 0 and the signals are 180◦out of phase.

This lack of directionality at low frequencies is caused by the incoming wave’s wave- length being larger than the array. The array size in metres is given by (N − 1)L, which corresponds to a frequency of:

f = c

(N − 1)L (7.3)

At this wavelength, the microphone signals will cancel each other at ±90◦to the steering angle. Frequencies below this will not begin to properly cancel, and consequently the beamformer lacks directionality.

Figure 7.8 shows how changing the number of microphones and the spacing between them affects the frequency response of the phased array beamformer. It can be seen that increasing the number of microphones means that directionality can be measured at lower frequencies. Increasing the spacing between microphones makes the beamforming more precise, so DOAs just above or below the steered angle are more likely to be minimised.

The best design would have a very large number of microphones which are well spaced apart. However, we are constrained by the requirements of the hardware (given in section 7.1.1) that it must fit onto an e-puck, so we must pick values for N and L such that (N − 1)L ≈ 0.07, since the e-pucks have a diameter of 0.07m.

In section 7.2.2 we observed that a high sample rate is needed for the beamforming delays to be accurate. This imposes a limit on the number of microphones we can use because the PIC cannot process multiple analogue inputs in parallel. The PIC has only one analogue to digital converter, which must be multiplexed between different inputs in order to get readings from different sensors. Consequently the microphones can’t be sampled at exactly the same time, but must be sampled consecutively so that corresponding points in the microphone memory buffers are as close together in time as possible. Therefore using additional microphones reduces the overall sample rate and this could negatively impact on the performance of the hardware.

The final phased array design uses 3 microphones spaced at 5cm intervals. The frequency response for a phased array with these parameters is shown in figure 7.9. These parameters are not ideal, but present the best performance within the given con- straints. The array size is 10 cm, which gives a minimum frequency to get directionality of 3430 Hz. To measure a this frequency the array will need a sample rate of 6860 Hz. However, as stated earlier in section 7.2.2, we need to sample at a rate five to ten times this. Consequently the minimum sample rate of the microphones must be 34 kHz.

I2C Data Transfer Timings

To reduce power consumption, beamforming will not be performed constantly but only on request from the e-puck. In order to present requested data to the e-puck in a timely manner and to limit the amount of data sent to the e-puck along the I2C bus, we cannot

perform delay and sum beamforming for every possible DOA but only for a small subset of angles. Consequently, we will only be testing angles 90◦, 45◦, 0◦, −45◦ and −90◦, as illustrated by figure 7.10. By only doing beamforming for five angles we also reduce the amount of time spent computing Fourier transforms, and there is much less data to send to the e-puck.

The FFT algorithm uses 128 points, so will return 128 data values. The first 64 are the power spectral density for each frequency, the last 64 are a complex reflection of the first 64 and can be ignored. To transfer the Fourier transforms of 5 different

(a) 3 mics 2cm separation (b) 5 mics 2cm separation (c) 10 mics 2cm separation

(d) 3 mics 3cm separation (e) 5 mics 3cm separation (f) 10 mics 3cm separation

(g) 3 mics 5cm separation (h) 5 mics 5cm separation (i) 10 mics 5cm separation

(j) 3 mics 10cm separation (k) 5 mics 10cm separation (l) 10 mics 10cm separation

(m) 3 mics 20cm separation (n) 5 mics 20cm separation (o) 10 mics 20cm separation

Figure 7.8: The effects of the number of microphones and the distance between them on the theoretical frequency response of the phased array.

Figure 7.9: The frequency response of the microphone phased array. There are 3 microphones spaced 5cm apart.

beamforming values along the I2C bus we must send 640 bytes1. I2C buses are clocked

at 100 kHz, so it will take 51.2 ms to transfer the data.

This is quite slow, but not unworkable. It would certainly be faster to perform FFT analysis on the board and send the resulting tone frequency and DOA to the e-puck. However, there are two factors which influence our decision to not do this. The first is simply that the time between the e-puck requesting data, to the board having done 5 delay and sum and Fourier transforms, is long enough for the original I2C request

to time out. Secondly, it is far easier to re-program the e-puck than the soundboard. The analysis code may need to be calibrated to cope with different environments, so it is much more flexible if we can change parameters within the e-puck code and leave the board unchanged, rather than reprogramming the soundboard’s PIC each time the swarm is moved to a new environment.