gov.nist.microanalysis.EPQLibrary
Class NoisySpectrum

java.lang.Object
  extended by gov.nist.microanalysis.EPQLibrary.BaseSpectrum
      extended by gov.nist.microanalysis.EPQLibrary.DerivedSpectrum
          extended by gov.nist.microanalysis.EPQLibrary.NoisySpectrum
All Implemented Interfaces:
ISpectrumData, java.lang.Comparable

public class NoisySpectrum
extends DerivedSpectrum

Adds Poisson noise to a spectrum. It is assumed that the initial spectrum is "noise free." This function may either be used to simulate short acquisition times given a spectrum with a much longer acquisition time or it may be used to add noise to a theoretically generated spectrum.

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Field Summary
 
Fields inherited from class gov.nist.microanalysis.EPQLibrary.DerivedSpectrum
mSource
 
Fields inherited from class gov.nist.microanalysis.EPQLibrary.BaseSpectrum
mHashCode, NULL_HASH, NullSpectrum
 
Constructor Summary
NoisySpectrum(ISpectrumData src, double scale, int seed)
          NoisySpectrum - Create a new noisy spectrum from the data in src scaled by the factor scale (nominally 0
 
Method Summary
 double getCounts(int i)
          getCounts - see ISpectrumData
 java.lang.String toString()
           
 
Methods inherited from class gov.nist.microanalysis.EPQLibrary.DerivedSpectrum
equals, getBaseSpectrum, getChannelCount, getChannelWidth, getProperties, getZeroOffset, isAlreadyDerivedFrom, isDerivedFrom
 
Methods inherited from class gov.nist.microanalysis.EPQLibrary.BaseSpectrum
compareTo, hashCode, initializeSpectrumIndex
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoisySpectrum

public NoisySpectrum(ISpectrumData src,
                     double scale,
                     int seed)
NoisySpectrum - Create a new noisy spectrum from the data in src scaled by the factor scale (nominally 0
Parameters:
src - ISpectrumData
scale - double
Method Detail

getCounts

public double getCounts(int i)
getCounts - see ISpectrumData

Parameters:
i - int
Returns:
double

toString

public java.lang.String toString()
Overrides:
toString in class BaseSpectrum