|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.transform.FastSineTransformer
public class FastSineTransformer
Implements the Fast Sine Transform for transformation of one-dimensional data sets. For reference, see Fast Fourier Transforms, ISBN 0849371635, chapter 3.
FST is its own inverse, up to a multiplier depending on conventions. The equations are listed in the comments of the corresponding methods.
Similar to FFT, we also require the length of data set to be power of 2. In addition, the first element must be 0 and it's enforced in function transformation after sampling.
Field Summary | |
---|---|
(package private) static long |
serialVersionUID
serializable version identifier |
Constructor Summary | |
---|---|
FastSineTransformer()
Construct a default transformer. |
Method Summary | |
---|---|
protected double[] |
fst(double[] f)
Perform the FST algorithm (including inverse). |
double[] |
inversetransform(double[] f)
Inversely transform the given real data set. |
double[] |
inversetransform(UnivariateRealFunction f,
double min,
double max,
int n)
Inversely transform the given real function, sampled on the given interval. |
double[] |
inversetransform2(double[] f)
Inversely transform the given real data set. |
double[] |
inversetransform2(UnivariateRealFunction f,
double min,
double max,
int n)
Inversely transform the given real function, sampled on the given interval. |
double[] |
transform(double[] f)
Transform the given real data set. |
double[] |
transform(UnivariateRealFunction f,
double min,
double max,
int n)
Transform the given real function, sampled on the given interval. |
double[] |
transform2(double[] f)
Transform the given real data set. |
double[] |
transform2(UnivariateRealFunction f,
double min,
double max,
int n)
Transform the given real function, sampled on the given interval. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
Constructor Detail |
---|
public FastSineTransformer()
Method Detail |
---|
public double[] transform(double[] f) throws MathException, java.lang.IllegalArgumentException
The formula is $ F_n = \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
f
- the real data array to be transformed
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] transform(UnivariateRealFunction f, double min, double max, int n) throws MathException, java.lang.IllegalArgumentException
The formula is $ F_n = \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
f
- the function to be sampled and transformedmin
- the lower bound for the intervalmax
- the upper bound for the intervaln
- the number of sample points
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] transform2(double[] f) throws MathException, java.lang.IllegalArgumentException
The formula is $ F_n = \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
f
- the real data array to be transformed
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] transform2(UnivariateRealFunction f, double min, double max, int n) throws MathException, java.lang.IllegalArgumentException
The formula is $ F_n = \sqrt{2/N} \Sigma_{k=0}^{N-1} f_k \sin(\pi nk/N) $
f
- the function to be sampled and transformedmin
- the lower bound for the intervalmax
- the upper bound for the intervaln
- the number of sample points
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] inversetransform(double[] f) throws MathException, java.lang.IllegalArgumentException
The formula is $ f_k = (2/N) \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
f
- the real data array to be inversely transformed
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] inversetransform(UnivariateRealFunction f, double min, double max, int n) throws MathException, java.lang.IllegalArgumentException
The formula is $ f_k = (2/N) \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
f
- the function to be sampled and inversely transformedmin
- the lower bound for the intervalmax
- the upper bound for the intervaln
- the number of sample points
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] inversetransform2(double[] f) throws MathException, java.lang.IllegalArgumentException
The formula is $ f_k = \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
f
- the real data array to be inversely transformed
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidpublic double[] inversetransform2(UnivariateRealFunction f, double min, double max, int n) throws MathException, java.lang.IllegalArgumentException
The formula is $ f_k = \sqrt{2/N} \Sigma_{n=0}^{N-1} F_n \sin(\pi nk/N) $
f
- the function to be sampled and inversely transformedmin
- the lower bound for the intervalmax
- the upper bound for the intervaln
- the number of sample points
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalidprotected double[] fst(double[] f) throws MathException, java.lang.IllegalArgumentException
f
- the real data array to be transformed
MathException
- if any math-related errors occur
java.lang.IllegalArgumentException
- if any parameters are invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |