>First we clapped at different distances to the sensor in order to measure from how far the sensor Will pick up >sound. We soon realized that the measurements were very inconsistent as it is impossible to make two or more >identical claps in a row.
> First we clapped at different distances to the sensor in order to measure from how far the sensor Will pick up
> sound. We soon realized that the measurements were very inconsistent as it is impossible to make two or more
> identical claps in a row.
>
>To compensate for the inconsistency we decided to use a smartphone and transmit a constant tone. The setup is showed >in the picture below. The car was placed on a table in the middle of the room and loudness were measured from >different distances:
> To compensate for the inconsistency we decided to use a smartphone and transmit a constant tone. The setup is
> showed in the picture below. The car was placed on a table in the middle of the room and loudness were measured
>Fig. 1: Picture of the setup. The robot was placed on a table and the phone was pointed towards the robot. After >each sensor reading the distance to the phone was increased.
> Fig. 1: Picture of the setup. The robot was placed on a table and the phone was pointed towards the robot. After
> each sensor reading the distance to the phone was increased.
>We use the program DataLogger.java from lesson 1 to record data from the program SoundSampler.java. Then we will >process the data and make a graph using excel.
> We use the program DataLogger.java from lesson 1 to record data from the program SoundSampler.java. Then we will
> process the data and make a graph using excel.
>
> #### Result
>
>The DataLogger was used to log data from the sound sensor. The experiment consisted of a period of 10 seconds in >which consecutive snaps were made with the fingers. The graph below shows the results:
> The DataLogger was used to log data from the sound sensor. The experiment consisted of a period of 10 seconds in
> which consecutive snaps were made with the fingers. The graph below shows the results:
> Fig. Recording of a sequence of four finger snaps. The graph shows data logged from the NXT while running the
> SoundSampler program.
>
> The graph shows four distinct spikes in the sound level caused by the finger snapping. The spikes peak at 30-50
> (db?) before the sound level goes back to its normal. The background noise measured is about 2-10 (db?).It is
>interesting to note that the spikes increase faster than they fade away. This observation can be due to resonance or >echo from the sound waves which take some milliseconds to fade away.
> interesting to note that the spikes increase faster than they fade away. This observation can be due to resonance
> or echo from the sound waves which take some milliseconds to fade away.
>
> ---
> ## Exercise 3 - Sound Controlled Car
...
...
@@ -109,16 +118,24 @@
>
> #### Result
>
>The test was conducted on a table where the car was controlled using voice commands. When the car detected the first >spike it would drive forward, when it heard the second it would turn left, on the third it would turn right and on >the fourth it would stop.
> The test was conducted on a table where the car was controlled using voice commands. When the car detected the
> first spike it would drive forward, when it heard the second it would turn left, on the third it would turn right
> and on the fourth it would stop.
>
>As every word has its own sound profile It could be interesting to investigate if the robot could interpret and act >differently on various voice commands. For instance it might be possible for the robot to recognize the difference >in length of words. However if different words are of equal length it might be difficult.
> As every word has its own sound profile It could be interesting to investigate if the robot could interpret and act
> differently on various voice commands. For instance it might be possible for the robot to recognize the difference
> in length of words. However if different words are of equal length it might be difficult.
>
> ---
> ## Exercise 4 - ButtonListener
>
> #### Task
>
>In the program SoundCtrCar.java the ESCAPE button is polled in the outermost loop so that the ESCAPE button can be >used to stop the program. This does not work when the program loops in one of the four inner loops. You can make the >ESCAPE button always work as a program terminator if you also poll the state of the button in the inner loops. But >you can also use the ButtonListener mechanism to listen for the ESCAPE button and exit when ESCAPE is pressed. A >simple example of a ButtonListener can be seen in the leJos tutorial, [4]. Try this in the program.
> In the program SoundCtrCar.java the ESCAPE button is polled in the outermost loop so that the ESCAPE button can be
> used to stop the program. This does not work when the program loops in one of the four inner loops. You can make
> the ESCAPE button always work as a program terminator if you also poll the state of the button in the inner loops.
> But you can also use the ButtonListener mechanism to listen for the ESCAPE button and exit when ESCAPE is pressed.
> A simple example of a ButtonListener can be seen in the leJos tutorial, [4]. Try this in the program.