Search in sources :

Example 1 with FastFourierTransformer

use of org.hipparchus.transform.FastFourierTransformer in project symja_android_library by axkr.

the class NFourierTransform method evaluate.

@Override
public IExpr evaluate(final IAST ast, EvalEngine engine) {
    Validate.checkRange(ast, 4, 5);
    IExpr expr = ast.arg1();
    ISymbol t = Validate.checkSymbolType(ast, 2);
    // IExpr omega = ast.arg3();
    if (ast.size() > 4) {
        final Options options = new Options(ast.topHead(), ast, 4, engine);
        IExpr optionFourierParameters = options.getOption("FourierParameters");
        if (optionFourierParameters.isList()) {
        // analyze the parameters, if they are correct
        }
    }
    UnivariateFunction f = new UnaryNumerical(expr, t, engine);
    FastFourierTransformer fft = new FastFourierTransformer(DftNormalization.STANDARD);
    org.hipparchus.complex.Complex[] result = fft.transform(f, -1.0, 1.0, 8, TransformType.FORWARD);
    return Object2Expr.convertComplex(result);
}
Also used : Options(org.matheclipse.core.eval.util.Options) UnaryNumerical(org.matheclipse.core.generic.UnaryNumerical) ISymbol(org.matheclipse.core.interfaces.ISymbol) UnivariateFunction(org.hipparchus.analysis.UnivariateFunction) IExpr(org.matheclipse.core.interfaces.IExpr) FastFourierTransformer(org.hipparchus.transform.FastFourierTransformer)

Aggregations

UnivariateFunction (org.hipparchus.analysis.UnivariateFunction)1 FastFourierTransformer (org.hipparchus.transform.FastFourierTransformer)1 Options (org.matheclipse.core.eval.util.Options)1 UnaryNumerical (org.matheclipse.core.generic.UnaryNumerical)1 IExpr (org.matheclipse.core.interfaces.IExpr)1 ISymbol (org.matheclipse.core.interfaces.ISymbol)1