Friday, 7 December 2007

End Course Project - Sound sensor detailed tests


Date: 07.12.2007
Duration of activity: 6 hours
List of participants: Alessandro, Daniela, Samuele
Goal: Determine which frequencies will be produced by our sound sources, in order to maximize the sound following capability of our robots.

In this test session we wanted to do an extensive test of NXT sound sensor response on a wide range of sound frequencies. We hoped to discover some properties of some range of frequencies that can be useful for our project.
We needed at least to find some frequencies which yield sound sensor values proportional to the distance from the sound source, such that the robot can have some indication about the proximity with the sound source, using only sound sensor readings.

In this test we measured readings of sound sensor values, through pure frequencies sounds from 100 Hz to 10 kHz and were repeated putting the sensor at three different distances from the sound source, at 50, 100 and 200 cm.
As sound source we used speakers of a laptop, and we generated wanted frequencies using a small tone generator software - (NCH Tone-Waveform Generator).


The tests were performed by using a plastic cup on the sensor. As said before, plastic cups will help improving the directionality of the sound sensor, and since we will only use sound sensors with plastic cups, we performed tests under the same condition in which we will use sensors.


Values we used are not directly raw values, but they are the mean value of all samples taken during 1 second; we had to use mean values because of the very noisy lego sensor.
In some cases we also repeated tests, when we got "suspicious" readings, so oscillation of values must not be attributed to random sensor noise, it is always an almost reliable mean of values for the specified frequency.

Those are test results:
frequency: Hzvalue
at 50cm
value
at 100cm
value
at 200cm
100211
200412
400949
45016148
500301811
550412314
600533038
650523138
700501513
750851437
800814311
850917422
900906745
950937793
1000906329
1500938137
2000816243
2500907657
3000754139
350093476
4000754210
4500939360
5000724820
5500936539
6000937247
6500805029
7000813410
706267323
712552226
718836134
725033124
73751351
7500853
7750733
80004131
9000440
10000410

As it can be seen from this table, we sampled with high density where small variations in frequency gave big changes in readings, while skipping where responses were uniform.

These are two graphs obtained from the values above:

2D version


3D version


From the graphs above some sounds sensor features come out:
  • The three shapes in the graph are similar in some way, and there is a decay of readings while the sound source gets far, which is an expected result, and a required condition for our robot to work. This means that near sources will give values higher than distant sources.
  • It is better if we use frequencies between 1kHz and 7kHz, because sensor responses are more uniform and proportional to sound source distance.
  • We can notice, by looking at the red line (which corresponds to the test with the closer sound source, 50cm) that the sensor response is not precise, when pushed to high levels, which means that we must consider every sampling above 70 as "loud sound" indistinctly, i.e. using threshold around 70-80 for loud sounds.
  • It also comes out that there are some frequencies which are still perceived loud by the sound sensor even if they're distant (2.5kHz, 4.5kHz, 6kHz), while others fall down too fast (3.5kHz, 5kHz).
Even if this test pointed out some good characteristics of NXT sound sensor, we noticed the non uniform distribution of values, which makes us worry about the possible capability of recognizing different frequencies.

After some speculation during the tests, we figured out that the problem of that oscillation was given by the environment under which we performed tests: our small office. The sensor readings were probably affected by a phenomenon which in telecommunications field is called multipath fading.
The same sound waves that come out from the sound source arrive more than once to the sensor: first time the waves with a straight path, and immediately afterwards with a different path, after having bounced on the walls. These signals are identical, but with a phase shift, which in some cases can cause them to cancel out partly or completely.


Conclusion
We got some good results, like hints about frequencies to use for sound sources.
We will do further investigation on sensing different frequencies, and avoiding multipath fading, to clarify whether the frequency discerning capability is implementable or not.

References
http://www.mediacollege.com/audio/microphones/directional-characteristics.html
http://en.wikipedia.org/wiki/Multipath_fading

No comments: