From 01569a3ea8a5e74a9f2747f824a70f475f5ada28 Mon Sep 17 00:00:00 2001 From: Alexander James Wallar Date: Mon, 10 Feb 2014 00:30:26 +0000 Subject: [PATCH] Add comments, update todo --- docs/TODO.md | 6 ++++++ locaudio/localization.py | 11 +++++++++++ tests/test_server.py | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/TODO.md b/docs/TODO.md index 7900a9c..2717b76 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -4,3 +4,9 @@ Things to do - Create a "tree" based database lookup for identifying sounds so multiple sounds can represent the same "class" +- Remember, you are breaking up the sounds into sound classes because it +provides a larger search space for the sound recognition and is more +resiliant to changes in the sound. The reference data for each sound in +the sound class is averaged and that is used for the initial guess this +assumes that a chicken will always be as loud as a chicken. + diff --git a/locaudio/localization.py b/locaudio/localization.py index 7d0e95b..6a5c9d4 100644 --- a/locaudio/localization.py +++ b/locaudio/localization.py @@ -413,6 +413,16 @@ def get_node_distance_lists(r_ref, l_ref, node_events, locations): def associate_node_events(r_ref, l_ref, node_events, locations): + """ + + Checks with node events correspond to which peaks so we can optimize + the reference distance and the reference sound pressure level. If we + know the node event association, we can partition the problem into + multiple sets of node events for multiple peaks. Then using this + partitioning, we can optimize different values or r_ref and l_ref for + different sound occurences + + """ distance_lists = get_node_distance_lists( r_ref, l_ref, @@ -424,6 +434,7 @@ def associate_node_events(r_ref, l_ref, node_events, locations): for location_index, distance_list in enumerate(distance_lists): for node_index, distance in enumerate(distance_list): + if distance < DISTANCE_THRESHOLD: if not location_index in association_dict.keys(): association_dict[locations[location_index]] = list() diff --git a/tests/test_server.py b/tests/test_server.py index e09fcfe..a0ccaef 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -79,7 +79,7 @@ def test_server_sound_triangulation(self): print "\n=== Server Sound Triangulation === :: {0}\n".format(pos_list) - def test_server_class_triangulation(self): + def test_server_sound_class_triangulation(self): pos_list = loc.get_class_locations(test_sound_class) print "\n=== Server Class Triangulation === :: {0}\n".format(pos_list)