001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.commons.math.transform;
018
019 import org.apache.commons.math.FunctionEvaluationException;
020 import org.apache.commons.math.analysis.UnivariateRealFunction;
021
022 /**
023 * Interface for one-dimensional data sets transformations producing real results.
024 * <p>Such transforms include {@link FastSineTransformer sine transform},
025 * {@link FastCosineTransformer cosine transform} or {@link
026 * FastHadamardTransformer Hadamard transform}. {@link FastFourierTransformer
027 * Fourier transform} is of a different kind and does not implement this
028 * interface since it produces {@link org.apache.commons.math.complex.Complex complex}
029 * results instead of real ones.
030 * </p>
031 * @version $Revision: 1070725 $ $Date: 2011-02-15 02:31:12 +0100 (mar. 15 f??vr. 2011) $
032 * @since 2.0
033 */
034 public interface RealTransformer {
035
036 /**
037 * Transform the given real data set.
038 * @param f the real data array to be transformed (signal)
039 * @return the real transformed array (spectrum)
040 * @throws IllegalArgumentException if any parameters are invalid
041 */
042 double[] transform(double f[])
043 throws IllegalArgumentException;
044
045 /**
046 * Transform the given real function, sampled on the given interval.
047 * @param f the function to be sampled and transformed
048 * @param min the lower bound for the interval
049 * @param max the upper bound for the interval
050 * @param n the number of sample points
051 * @return the real transformed array
052 * @throws FunctionEvaluationException if function cannot be evaluated at some point
053 * @throws IllegalArgumentException if any parameters are invalid
054 */
055 double[] transform(UnivariateRealFunction f, double min, double max, int n)
056 throws FunctionEvaluationException, IllegalArgumentException;
057
058 /**
059 * Inversely transform the given real data set.
060 * @param f the real data array to be inversely transformed (spectrum)
061 * @return the real inversely transformed array (signal)
062 * @throws IllegalArgumentException if any parameters are invalid
063 */
064 double[] inversetransform(double f[])
065 throws IllegalArgumentException;
066
067 /**
068 * Inversely transform the given real function, sampled on the given interval.
069 * @param f the function to be sampled and inversely transformed
070 * @param min the lower bound for the interval
071 * @param max the upper bound for the interval
072 * @param n the number of sample points
073 * @return the real inversely transformed array
074 * @throws FunctionEvaluationException if function cannot be evaluated at some point
075 * @throws IllegalArgumentException if any parameters are invalid
076 */
077 double[] inversetransform(UnivariateRealFunction f, double min, double max, int n)
078 throws FunctionEvaluationException, IllegalArgumentException;
079
080 }