WorkshopDemo
Class WorkshopProcess.ChannelDetector
java.lang.Object
WorkshopDemo.WorkshopProcess.ChannelDetector
- Enclosing class:
- WorkshopProcess
class WorkshopProcess.ChannelDetector
- extends java.lang.Object
Since the detector may be running on several channels, make a sub class for the actual detector
code so that multiple instances may be created.
- Author:
- Doug
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
channel
int channel
detectionOn
boolean detectionOn
background
double background
callCount
int callCount
setupCount
static final int setupCount
- See Also:
- Constant Field Values
detectionEndSample
long detectionEndSample
detectionStartSample
long detectionStartSample
detectionEnergy
double detectionEnergy
detectionSliceCount
int detectionSliceCount
WorkshopProcess.ChannelDetector
public WorkshopProcess.ChannelDetector(int channel)
pamStart
public void pamStart()
newData
public void newData(PamObservable o,
FFTDataUnit arg)
- Performs the same funciton as newData in the outer class, but this
time it should only ever get called with data for a single channel.
For the first few calls, it just updates the background by taking a straight mean
of the energy values. After that it calculates a decaying average of
the background.
- Parameters:
o - arg -
energySum
private double energySum(Complex[] fftData,
int bin1,
int bin2)
startDetection
private void startDetection(FFTDataUnit dataUnit,
double energy)
continueDetection
private void continueDetection(FFTDataUnit dataUnit,
double energy)
endDetection
private void endDetection()