|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.webkitchen.eeg.analysis.BandMonitor
public class BandMonitor
Listens for samples in a given band, calculates the amplitude average for the samples, and notifies listeners of the new average amplitude. Objects can add themselves as listeners/observers to receive copies of all new average amplitudes.
| Constructor Summary | |
|---|---|
BandMonitor(int sampleSize,
double tolerance,
int minNotificationInterval)
Creates a new monitor that will calculate amplitude values for a filtered signal |
|
| Method Summary | |
|---|---|
void |
addAmplitudeListener(IAmplitudeListener listener)
Attach listener to receive notification/copies of new amplitude levels |
void |
receiveBand(double bandSample)
Processes the sample to calculate the signal amplitude, and notifies all listeners if the difference between the new amplitude and last sent amplitude is greater than our tolerance amount, or if the number of processed values has reached our minNotificationInterval |
void |
removeAllAmplitudeListeners()
Remove all listeners from our notification list |
void |
removeAmplitudeListener(IAmplitudeListener listener)
Remove listener from our notification list |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BandMonitor(int sampleSize,
double tolerance,
int minNotificationInterval)
sampleSize - the number of samples to use in our RMS calculationtolerance - the amount of change in amplitude required before notifying listenersminNotificationInterval - the minimum interval for notifying listeners, even if amplitude
has not changed beyond tolerance amount| Method Detail |
|---|
public void receiveBand(double bandSample)
receiveBand in interface IBandSampleListenerbandSample - the filtered sample valuepublic void addAmplitudeListener(IAmplitudeListener listener)
addAmplitudeListener in interface IAmplitudeGeneratorlistener - the observer who wants to receive amplitude levelspublic void removeAmplitudeListener(IAmplitudeListener listener)
removeAmplitudeListener in interface IAmplitudeGeneratorlistener - the observer to removepublic void removeAllAmplitudeListeners()
removeAllAmplitudeListeners in interface IAmplitudeGenerator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||