noiseMonitor
Class NoiseProcess

java.lang.Object
  extended by PamguardMVC.PamProcess
      extended by noiseMonitor.NoiseProcess
All Implemented Interfaces:
Annotator, PamObserver

public class NoiseProcess
extends PamProcess


Field Summary
private  AcquisitionProcess daqProcess
           
private  FFTDataBlock fftDataSource
           
private  int iMeasurement
          Index of the next measurement to make
private  NoiseSettings lastCheckSet
          Remember the last settings
private  double[][][] measurementData
           
private  long[] measurementTimes
           
private  java.lang.String[] measureNames
           
private  long nextBlockStartSample
           
private  NoiseBinaryDataSource noiseBinaryDataSource
           
private  NoiseControl noiseControl
           
private  NoiseDataBlock noiseDataBlock
           
private  NoiseLogging noiseLogging
           
private  double[] processGains
          Total gain of all upstream processes which will be divided off all noise measurements.
private  java.util.Random r
           
 
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, processName, sampleRate
 
Constructor Summary
NoiseProcess(NoiseControl noiseControl)
           
 
Method Summary
private  void createStats()
           
private  void createStats(int channelIndex, double[][] measurementData)
           
private  void findDataSource()
           
private  double getChannelGains(int iChan)
          Work back through the data model and work out the accumulated gain of all upstream processes.
 java.lang.String[] getDBColNames()
           
 java.lang.String getMeasureNames(int iM)
           
 NoiseControl getNoiseControl()
           
 NoiseDataBlock getNoiseDataBlock()
           
 int getNumMeasures()
           
private  void makeMeasurement(int channelNumber, int iBand, int iMeasurement, FFTDataUnit fftDataUnit)
          Make a single measurement for a single energy band and store it.
private  void makeMeasurments(int channelNumber, int iMeasurement, FFTDataUnit fftDataUnit)
           
 void newData(PamObservable o, PamDataUnit arg)
           
private  void newFFTData(FFTDataUnit fftDataUnit)
           
protected  void newSettings()
          Call when settings dialog has been used or after initialisation
 void notifyModelChanged(int changeType)
           
 void pamStart()
          Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway.
 void pamStop()
          Stops the process.
private  void setMeasurementTimes(long currentTime)
          Work out a new set of measurement times.
 
Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, fillXMLElement, fillXMLParameters, getAncestorDataBlock, getAnnotation, getBackendProcess, getChainPosition, getCpuPercent, getNumAnnotations, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOutputDataBlock, getPamControlledUnit, getParentDataBlock, getParentProcess, getProcessName, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, isCanMultiThread, makePamProcess, masterClockUpdate, noteNewSettings, prepareProcess, relMillisecondsToSamples, relSamplesToMilliseconds, removeObservable, removeOutputDatablock, saveViewerData, setBackendProcess, setCanMultiThread, setParentDataBlock, setParentDataBlock, setProcessName, setSampleRate, setupProcess, toString, update, updateData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

noiseControl

private NoiseControl noiseControl

fftDataSource

private FFTDataBlock fftDataSource

noiseDataBlock

private NoiseDataBlock noiseDataBlock

noiseLogging

private NoiseLogging noiseLogging

measureNames

private java.lang.String[] measureNames

iMeasurement

private int iMeasurement
Index of the next measurement to make


measurementTimes

private long[] measurementTimes

nextBlockStartSample

private long nextBlockStartSample

r

private java.util.Random r

measurementData

private double[][][] measurementData

daqProcess

private AcquisitionProcess daqProcess

noiseBinaryDataSource

private NoiseBinaryDataSource noiseBinaryDataSource

processGains

private double[] processGains
Total gain of all upstream processes which will be divided off all noise measurements.


lastCheckSet

private NoiseSettings lastCheckSet
Remember the last settings

Constructor Detail

NoiseProcess

public NoiseProcess(NoiseControl noiseControl)
Method Detail

newSettings

protected void newSettings()
Call when settings dialog has been used or after initialisation


notifyModelChanged

public void notifyModelChanged(int changeType)
Overrides:
notifyModelChanged in class PamProcess

setMeasurementTimes

private void setMeasurementTimes(long currentTime)
Work out a new set of measurement times.

These are initially set as evenly spread between now and the measurement interval. Then add some jitter at random to each.

Parameters:
currentTime - current sample number.

findDataSource

private void findDataSource()

getChannelGains

private double getChannelGains(int iChan)
Work back through the data model and work out the accumulated gain of all upstream processes.

Returns:
total gain of upstream processes as a factor (not dB).

pamStart

public void pamStart()
Description copied from class: PamProcess
Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway.

Specified by:
pamStart in class PamProcess

pamStop

public void pamStop()
Description copied from class: PamProcess
Stops the process.

Specified by:
pamStop in class PamProcess

newData

public void newData(PamObservable o,
                    PamDataUnit arg)
Overrides:
newData in class PamProcess

newFFTData

private void newFFTData(FFTDataUnit fftDataUnit)

makeMeasurments

private void makeMeasurments(int channelNumber,
                             int iMeasurement,
                             FFTDataUnit fftDataUnit)

makeMeasurement

private void makeMeasurement(int channelNumber,
                             int iBand,
                             int iMeasurement,
                             FFTDataUnit fftDataUnit)
Make a single measurement for a single energy band and store it.

Parameters:
iBand -
iMeasurement -
fftDataUnit -

createStats

private void createStats()

createStats

private void createStats(int channelIndex,
                         double[][] measurementData)

getDBColNames

public java.lang.String[] getDBColNames()

getNoiseControl

public NoiseControl getNoiseControl()

getMeasureNames

public java.lang.String getMeasureNames(int iM)

getNumMeasures

public int getNumMeasures()

getNoiseDataBlock

public NoiseDataBlock getNoiseDataBlock()
Returns:
the noiseDataBlock