Package pulse.math
Class Harmonic
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- pulse.util.Group
-
- pulse.util.Accessible
-
- pulse.util.PropertyHolder
-
- pulse.math.Harmonic
-
- All Implemented Interfaces:
Serializable,Comparable<Harmonic>,Optimisable,Descriptive
public class Harmonic extends PropertyHolder implements Optimisable, Comparable<Harmonic>
Harmonic class.It is given by the expression , where f is the frequency (in Hz), A is the amplitude, φ is the phase shift.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(ParameterVector params)Assigns parameter values of thisOptimisableusing the optimisation vectorparams.intcompareTo(Harmonic o)booleanequals(Object o)NumericPropertygetAmplitude()NumericPropertygetFrequency()NumericPropertygetPhaseShift()intgetRank()HarmonicincreaseAmplitudeBy(int amplitudeFactor)Set<NumericPropertyKeyword>listedKeywords()Listed properties include the frequency, amplitude, phase shift, and intercept.voidoptimisationVector(ParameterVector output)The optimisation vector can include the amplitude, frequency and phase shift of a sinusoid, and a baseline intercept value of the superclass.voidset(NumericPropertyKeyword type, NumericProperty property)An abstract method, which must be overriden to gain access over setting the values of all relevant (selected by the programmer)NumericProperties in subclasses ofAccessible.voidsetAmplitude(NumericProperty amplitude)voidsetFrequency(NumericProperty frequency)voidsetPhaseShift(NumericProperty phaseShift)voidsetRank(int rank)StringtoString()doublevalueAt(double x)Amplitude form of the Fourier harmonic-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, data, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, ignoreSiblings, initListeners, isListedNumericType, isListedParameter, listedTypes, numericData, parameterListChanged, removeListeners, setPrefix, updateProperties, updateProperty
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperties, genericProperty, numericProperties, numericProperty, property, update, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, identify, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Constructor Detail
-
Harmonic
public Harmonic()
-
Harmonic
public Harmonic(double amplitude, double frequency, double phaseShift)
-
Harmonic
public Harmonic(Harmonic h)
-
-
Method Detail
-
getFrequency
public NumericProperty getFrequency()
-
getAmplitude
public NumericProperty getAmplitude()
-
getPhaseShift
public NumericProperty getPhaseShift()
-
setFrequency
public final void setFrequency(NumericProperty frequency)
-
setAmplitude
public final void setAmplitude(NumericProperty amplitude)
-
setPhaseShift
public final void setPhaseShift(NumericProperty phaseShift)
-
valueAt
public double valueAt(double x)
Amplitude form of the Fourier harmonic- Parameters:
x-- Returns:
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
Listed properties include the frequency, amplitude, phase shift, and intercept.- Overrides:
listedKeywordsin classPropertyHolder- Returns:
- a set of
NumericPropertyKeywordinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder.
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
Description copied from class:AccessibleAn abstract method, which must be overriden to gain access over setting the values of all relevant (selected by the programmer)
NumericProperties in subclasses ofAccessible. Typically this involves aswitchstatement that goes through the different options for thetypeand invokes differentset(...)methods to update the matchingNumericPropertywithproperty.- Specified by:
setin classAccessible- Parameters:
type- the type, which must be equal by definition toproperty.getType().property- the property, which contains new information.
-
optimisationVector
public void optimisationVector(ParameterVector output)
The optimisation vector can include the amplitude, frequency and phase shift of a sinusoid, and a baseline intercept value of the superclass.- Specified by:
optimisationVectorin interfaceOptimisable- Parameters:
output- the output vector where the result will be stored
-
assign
public void assign(ParameterVector params)
Description copied from interface:OptimisableAssigns parameter values of thisOptimisableusing the optimisation vectorparams. Only those parameters will be updated, the types of which are listed as indices in theparamsvector.- Specified by:
assignin interfaceOptimisable- Parameters:
params- the optimisation vector, containing a similar set of parameters to thisProblem
-
setRank
public void setRank(int rank)
-
getRank
public int getRank()
-
increaseAmplitudeBy
public Harmonic increaseAmplitudeBy(int amplitudeFactor)
-
compareTo
public int compareTo(Harmonic o)
- Specified by:
compareToin interfaceComparable<Harmonic>
-
-