|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.berkeley.guir.ptk.PTK
edu.berkeley.guir.ptk.abstraction.Abstractor
edu.berkeley.guir.ptk.abstraction.TelephoneAbstractor
A PTK Library Abstractor that takes an AUDIO event (including volume and frequency samples) and determines if a telephone is ringing. Because it relies on certain frequency sample combinations for recognition, this Abstractor works mainly with "classic" telephone rings (i.e., it does not detect all the ring tones and songs possible with today's mobile phones). Depending on the tone of your phone, the frequency analysis may need some modification.
To customize this abstractor, set the four *_ms_ago
data fields. These correspond to the number of milliseconds ago the abstractor
will check for ring tones. For a standard U.S. phone ring, if there is
a ring tone detected now, then there should be no ring tone 2 seconds ago
and 4 seconds ago, and there should be a ring tone 6 seconds ago.
Also, you may need to customize one line of code: the
return line of checkForRing. This determines if
the past ring events occurred in a pattern that matches a phone ring. For
a standard U.S. phone ring, the rings tones for the four events (that happenned
now, first_ms_ago, second_ms_ago, and third_ms_ago), should be ring tone =
true, false, false, true.
Notes: Standard U.S. phone ring has 2 seconds ring, 4 seconds pause.
| Field Summary | |
long |
first_ms_ago
The number of milliseconds ago for the first historical event to check for ring tones. |
long |
second_ms_ago
The number of milliseconds ago for the second historical event to check for ring tones. |
long |
third_ms_ago
The number of milliseconds ago for the third historical event to check for ring tones. |
| Fields inherited from class edu.berkeley.guir.ptk.abstraction.Abstractor |
data_ids_I_want, replace_data |
| Fields inherited from class edu.berkeley.guir.ptk.PTK |
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG |
| Constructor Summary | |
TelephoneAbstractor()
|
|
| Method Summary | |
protected boolean |
checkForRing(Event e,
Event two_ago,
Event four_ago,
Event six_ago)
Analyzes the the past two events and the new event to determine if a phone is ringing. |
boolean |
doAbstract(Event e,
History h)
Performs the abstraction of the input event data (which consists of several DataNumber objects for volume and frequency samples), replacing it with a DataSwitch that indicates true/false for the presence of a phone ring. |
boolean |
isRingTone(double[] freq)
|
protected boolean |
ringPotential(Event e)
|
| Methods inherited from class edu.berkeley.guir.ptk.abstraction.Abstractor |
addMetadataIWant, canIAbstract, getAllMetadata, getFirstMetadata |
| Methods inherited from class edu.berkeley.guir.ptk.PTK |
getMAX, getMED, getMIN, getNO, printDebug, printDebug, printError |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public long first_ms_ago
public long second_ms_ago
public long third_ms_ago
| Constructor Detail |
public TelephoneAbstractor()
| Method Detail |
public boolean doAbstract(Event e,
History h)
doAbstract in class Abstractore - Event that will be abstracted. The event is
destructively altered.h - History of all events passed to this application.
May be used to perform abstraction.
protected boolean checkForRing(Event e,
Event two_ago,
Event four_ago,
Event six_ago)
protected boolean ringPotential(Event e)
public boolean isRingTone(double[] freq)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||