org.fraid.math
Class MathHelperSampled
java.lang.Object
org.fraid.math.MathHelperSampled
public class MathHelperSampled
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MathHelperSampled
public MathHelperSampled()
intervalSearch
public static int intervalSearch(double aX,
Samples aSamples)
- Parameters:
aX
- the number we are trying to fit into an interval.aPoints
- the x portions don't have to be equally spaced
but need to be ordered from smaller to bigger
- Returns:
- returns the index of the interval where aX belongs,
-1 if it is less than the lower boundary of the array,
aPoints.length if it is greater than the upper boundary
approximateY
public static Complex approximateY(double aX,
Samples aSamples)
throws ComplexFunctionException
- Approximates the value of a function sampled by n discrete points.
- Parameters:
aX
- the point at which we want to approximate;aPoints
- array with the sampled values;
- Returns:
- the approximated value of the function at point aX
- Throws:
java.lang.Exception
- if the array contains less than three elements
ComplexFunctionException
abstractFFT
public static Samples abstractFFT(Samples aInputSamples,
MathHelperSampled.FFTType aType,
int aStartSample,
int aLength)
throws ComplexFunctionException
- Throws:
ComplexFunctionException
trimAndScaleForwardFFT
public static Samples trimAndScaleForwardFFT(Samples vFftSamples)
createDummySamples
public static Samples createDummySamples(int aDesiredSamplingFrequency)
Fraid (system and language). (C) 2003-2007 Ivaylo Iliev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.