Test of sound sensor:
Clapping seems to make it go up to 50%, whistling made it go up to 98%.
Clapping at 1-5m away reads a value of about 20%.
Behind it also works.
sample:
we recorded a single clap about 1 meter away. (PLOT)
sound control car:
We implemented buttonlistener as described in the API. The program
works as expected. It only accepts very loud sounds. which meant we
had to get very close to whistle at it to make it switch settings.
Sound identification.
We tried distinguishing between a clap and a general loud noise.
we implemented the sound storage as an array of 60 integers. which was
updated as a circular array. We a circular array as this is very fast
and every ms it takes to add the integer is added to the update-time
(2ms processing time + 5 ms thread.sleep time = 7ms update-time). If
our update-time becomes too big our clap detection analysis would fail.
We implemented the clap-detection by having 3 integers. 1st contains
the average volume of the last 25ms. 2nd has the average of 25ms in
the pat to 225ms in the past. And 3rd has the average of 225ms to 250
ms in the past. A clap is then when the 1st and 3rd integers are
between 30 and 50. and the 2nd is above 85.
Our program worked about every 5th to 10th clap.
Ingen kommentarer:
Send en kommentar