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 BasicFunction
BasicFunction.Differentiable<N,F>, BasicFunction.Integratable<N, F>, BasicFunction.PlainUnary<T, R> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final NumberContextprivate final doubleprivate final double[]private final double[] -
Constructor Summary
ConstructorsConstructorDescriptionFourierSeries(double period, double[] cosCoefficients, double[] sinCoefficients) FourierSeries(double period, ComplexNumber... coefficients) -
Method Summary
Modifier and TypeMethodDescriptionstatic FourierSeriesestimate(DoubleUnaryOperator function, PrimitiveFunction.SampleDomain sampleDomain) static FourierSeriesestimate(PeriodicFunction function, int nbSamples) doubleinvoke(double arg) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DoubleUnaryOperator
andThen, composeMethods inherited from interface PrimitiveFunction.Unary
invokeMethods inherited from interface 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:
invokein interfaceUnaryFunction<Double>
-