Package org.ojalgo.function.series
Class FourierSeries
- java.lang.Object
-
- org.ojalgo.function.series.FourierSeries
-
- All Implemented Interfaces:
java.util.function.DoubleUnaryOperator
,java.util.function.Function<java.lang.Double,java.lang.Double>
,java.util.function.UnaryOperator<java.lang.Double>
,BasicFunction
,PrimitiveFunction.Unary
,UnaryFunction<java.lang.Double>
public class FourierSeries extends java.lang.Object implements PrimitiveFunction.Unary
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 java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.Integratable<N extends java.lang.Comparable<N>,F extends BasicFunction>, BasicFunction.PlainUnary<T,R>
-
-
Field Summary
Fields Modifier and Type Field Description private static NumberContext
ACCURACY
private double
myAngularFrequency
private double[]
myCosCoefficients
private double[]
mySinCoefficients
-
Constructor Summary
Constructors Constructor Description FourierSeries(double period, double[] cosCoefficients, double[] sinCoefficients)
FourierSeries(double period, ComplexNumber... coefficients)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FourierSeries
estimate(java.util.function.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 org.ojalgo.function.PrimitiveFunction.Unary
invoke
-
Methods inherited from interface org.ojalgo.function.UnaryFunction
andThen, apply, applyAsDouble, compose, invoke, invoke, invoke, invoke, invoke
-
-
-
-
Field Detail
-
ACCURACY
private static final NumberContext ACCURACY
-
myAngularFrequency
private final double myAngularFrequency
-
myCosCoefficients
private final double[] myCosCoefficients
-
mySinCoefficients
private final double[] mySinCoefficients
-
-
Constructor Detail
-
FourierSeries
public FourierSeries(double period, ComplexNumber... coefficients)
- 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 Detail
-
estimate
public static FourierSeries estimate(java.util.function.DoubleUnaryOperator function, PrimitiveFunction.SampleDomain sampleDomain)
-
estimate
public static FourierSeries estimate(PeriodicFunction function, int nbSamples)
-
invoke
public double invoke(double arg)
- Specified by:
invoke
in interfaceUnaryFunction<java.lang.Double>
-
-