Package org.ojalgo.function.series
Class FourierSeries
java.lang.Object
org.ojalgo.function.series.FourierSeries
- All Implemented Interfaces:
DoubleUnaryOperator
,Function<Double,
,Double> UnaryOperator<Double>
,BasicFunction
,PrimitiveFunction.Unary
,UnaryFunction<Double>
This is the real coefficient trigonometric form of the Fourier series.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ojalgo.function.BasicFunction
BasicFunction.Differentiable<N extends Comparable<N>,
F extends BasicFunction>, BasicFunction.Integratable<N extends Comparable<N>, F extends BasicFunction>, BasicFunction.PlainUnary<T, R> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final NumberContext
private final double
private final double[]
private final double[]
-
Constructor Summary
ConstructorsConstructorDescriptionFourierSeries
(double period, double[] cosCoefficients, double[] sinCoefficients) FourierSeries
(double period, ComplexNumber... coefficients) -
Method Summary
Modifier and TypeMethodDescriptionstatic FourierSeries
estimate
(DoubleUnaryOperator function, PrimitiveFunction.SampleDomain sampleDomain) static FourierSeries
estimate
(PeriodicFunction function, int nbSamples) double
invoke
(double arg) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.function.DoubleUnaryOperator
andThen, compose
Methods inherited from interface org.ojalgo.function.PrimitiveFunction.Unary
invoke
Methods inherited from interface org.ojalgo.function.UnaryFunction
andThen, apply, applyAsDouble, compose, invoke, invoke, invoke, invoke, invoke
-
Field Details
-
ACCURACY
-
myAngularFrequency
private final double myAngularFrequency -
myCosCoefficients
private final double[] myCosCoefficients -
mySinCoefficients
private final double[] mySinCoefficients
-
-
Constructor Details
-
FourierSeries
- Parameters:
period
- The period of the functioncoefficients
- The Fourier coefficients. The first coefficient is the constant term (the real part of that complex number), then the following coefficients are the coefficients of the cos and sin terms with increasing frequency.
-
FourierSeries
FourierSeries(double period, double[] cosCoefficients, double[] sinCoefficients)
-
-
Method Details
-
estimate
public static FourierSeries estimate(DoubleUnaryOperator function, PrimitiveFunction.SampleDomain sampleDomain) -
estimate
-
invoke
public double invoke(double arg) - Specified by:
invoke
in interfaceUnaryFunction<Double>
-