noiseMonitor
Class NoiseControl

java.lang.Object
  extended by PamController.PamControlledUnit
      extended by noiseMonitor.NoiseControl
All Implemented Interfaces:
PamSettings

public class NoiseControl
extends PamControlledUnit
implements PamSettings

Extract noise statistics from acoustic data.

Measurements will be written out to a database at regular intervals (about once a minute), however, not every sample of incoming data will be used, but a sub sample from within the measuremetnInterval.

For each measure, the output will include the mean, and the median and some other statistics from the distribution of noise measures.

Author:
Doug Gillespie

Nested Class Summary
(package private)  class NoiseControl.DisplayOptions
           
(package private)  class NoiseControl.SettingsMenu
           
 
Field Summary
 java.lang.String[] measureNames
           
private  NoiseProcess noiseProcess
           
protected  NoiseSettings noiseSettings
           
private  NoiseTabPanel noiseTabPanel
           
static double[] THIRDOCTAVES
          Centre frequencies for third octave bands.
 
Fields inherited from class PamController.PamControlledUnit
isViewer
 
Constructor Summary
NoiseControl(java.lang.String unitName)
           
 
Method Summary
 java.lang.String createDBColumnName(int iBand, int iMeasure)
           
 javax.swing.JMenuItem createDetectionMenu(java.awt.Frame parentFrame)
          Create a JMenu object containing MenuItems associated with PamProcesses
 javax.swing.JMenuItem createDisplayMenu(java.awt.Frame parentFrame)
          Create a JMenu object containing MenuItems associated with the view
protected  double[][] createThirdOctaveBands(double fmin, double fmax)
          Work out the frequency edges of third octave bands between fmin and fmax.
 void displayOptions(java.awt.Frame parentFrame)
           
 int getChannelMap()
           
private  double getNextCent(int index, double multiplier)
          Get next third octave centre
 NoiseProcess getNoiseProcess()
           
private  double getPrevCent(int index, double multiplier)
          get rpevioud third octave centre
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 PamTabPanel getTabPanel()
          Gets a reference to a panel to be added to a view
protected  void noiseSettings(java.awt.Frame parentFrame)
           
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
private  void times10(double[] a)
          multiple an array by 10 (used to multiply up third oct edges)
 
Methods inherited from class PamController.PamControlledUnit
addOtherRelatedMenuItems, addPamProcess, addRelatedMenuItems, canClose, createFileMenu, createHelpMenu, fillXMLElement, fillXMLParameters, getFrameNumber, getNumPamProcesses, getPamController, getPamModuleInfo, getPamProcess, getPamView, getSidePanel, getTabClipCopier, getTabSpecificMenuBar, getUnitName, getUnitType, gotoTab, notifyArrayChanged, notifyModelChanged, pamHasStopped, pamToStart, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, setupControlledUnit, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface PamController.PamSettings
getUnitName, getUnitType
 

Field Detail

noiseSettings

protected NoiseSettings noiseSettings

noiseProcess

private NoiseProcess noiseProcess

noiseTabPanel

private NoiseTabPanel noiseTabPanel

THIRDOCTAVES

public static final double[] THIRDOCTAVES
Centre frequencies for third octave bands. Bands extend from f^(-1/6) to f^(1/6) or from 0.891f to 1.122f (Richardson et al. p24.)


measureNames

public java.lang.String[] measureNames
Constructor Detail

NoiseControl

public NoiseControl(java.lang.String unitName)
Method Detail

createDetectionMenu

public javax.swing.JMenuItem createDetectionMenu(java.awt.Frame parentFrame)
Description copied from class: PamControlledUnit
Create a JMenu object containing MenuItems associated with PamProcesses

Overrides:
createDetectionMenu in class PamControlledUnit
Parameters:
parentFrame - The owner frame of the menu
Returns:
reference to a JMenu which can be added to an existing menu or menu bar

Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.


createThirdOctaveBands

protected double[][] createThirdOctaveBands(double fmin,
                                            double fmax)
Work out the frequency edges of third octave bands between fmin and fmax. fmin should be > 0 and should in practice also be greater than the minimum frequency resolution of the FFT you are using. fmax will probably be niquist but the highest band edge will probably end up being below this, i.e. it will stop at 20kHz for 44kHz sampled data.

Parameters:
fmin -
fmax -
Returns:
array of edges of bands. Final number of bands will be this - 1.

getNextCent

private double getNextCent(int index,
                           double multiplier)
Get next third octave centre

Parameters:
index -
multiplier -
Returns:

getPrevCent

private double getPrevCent(int index,
                           double multiplier)
get rpevioud third octave centre

Parameters:
index -
multiplier -
Returns:

times10

private void times10(double[] a)
multiple an array by 10 (used to multiply up third oct edges)

Parameters:
a -

noiseSettings

protected void noiseSettings(java.awt.Frame parentFrame)

createDisplayMenu

public javax.swing.JMenuItem createDisplayMenu(java.awt.Frame parentFrame)
Description copied from class: PamControlledUnit
Create a JMenu object containing MenuItems associated with the view

Overrides:
createDisplayMenu in class PamControlledUnit
Returns:
reference to a JMenu which can be added to an existing menu or menu bar

Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.


displayOptions

public void displayOptions(java.awt.Frame parentFrame)

getSettingsReference

public java.io.Serializable getSettingsReference()
Specified by:
getSettingsReference in interface PamSettings
Returns:
The serialisable object that will be stored

getSettingsVersion

public long getSettingsVersion()
Specified by:
getSettingsVersion in interface PamSettings
Returns:
An integer version number for the settings

restoreSettings

public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
Specified by:
restoreSettings in interface PamSettings
Returns:
true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required

createDBColumnName

public java.lang.String createDBColumnName(int iBand,
                                           int iMeasure)

getTabPanel

public PamTabPanel getTabPanel()
Description copied from class: PamControlledUnit
Gets a reference to a panel to be added to a view

Overrides:
getTabPanel in class PamControlledUnit
Returns:
reference to a PamTabPanel object
See Also:
PamTabPanel, PamSidePanel

getChannelMap

public int getChannelMap()

getNoiseProcess

public NoiseProcess getNoiseProcess()
Returns:
the noiseProcess