There are several variants of the discrete sine transform. The present
implementation corresponds to DST-I, with various normalization conventions,
which are specified by the parameter DstNormalization.
It should be noted that regardless to the convention, the first
element of the dataset to be transformed must be zero.
DST-I is equivalent to DFT of an odd extension of the data series. More precisely, if x0, …, xN-1 is the data set to be sine transformed, the extended data set x0#, …, x2N-1# is defined as follows
Then, the standard DST-I y0, …, yN-1 of the real
data set x0, …, xN-1 is equal to half
of i (the pure imaginary number) times the N first elements of the DFT of the
extended data set x0#, …,
x2N-1#
yn = (i / 2) ∑k=02N-1
xk# exp[-2πi nk / (2N)]
k = 0, …, N-1.
The present implementation of the discrete sine transform as a fast sine
transform requires the length of the data to be a power of two. Besides,
it implicitly assumes that the sampled function is odd. In particular, the
first element of the data set must be 0, which is enforced in
transform(UnivariateFunction, double, double, int, TransformType),
after sampling.
| Modifier and Type | Field and Description |
|---|---|
| private final DstNormalization | normalization
The type of DST to be performed. |
| pack-priv static final long | serialVersionUID
Serializable version identifier. |
| Access | Constructor and Description |
|---|---|
| public | FastSineTransformer(final DstNormalization
the type of normalization to be applied to the transformed data normalization)Creates a new instance of this class, with various normalization conventions. |
| Modifier and Type | Method and Description |
|---|---|
| protected double[] | Returns: the real transformed arraythe real data array to be transformed f)Perform the FST algorithm (including inverse). |
| public double[] | transform(final double[]
the real data array to be transformed (signal) f, final TransformType the type of transform (forward, inverse) to be performed type)Implements org. Returns the (forward, inverse) transform of the specified real data set. |
| public double[] | transform(final UnivariateFunction
the function to be sampled and transformed f, final double the (inclusive) lower bound for the interval min, final double the (exclusive) upper bound for the interval max, final int the number of sample points n, final TransformType the type of transform (forward, inverse) to be performed type)Implements org. Returns the (forward, inverse) transform of the specified real function, sampled on the specified interval. |
| normalization | back to summary |
|---|---|
| private final DstNormalization normalization The type of DST to be performed. | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Serializable version identifier. | |
| FastSineTransformer | back to summary |
|---|---|
| public FastSineTransformer(final DstNormalization normalization) Creates a new instance of this class, with various normalization conventions.
| |
| fst | back to summary |
|---|---|
| protected double[] fst(double[] f) throws MathIllegalArgumentException Perform the FST algorithm (including inverse). The first element of the
data set is required to be
| |
| transform | back to summary |
|---|---|
| public double[] transform(final double[] f, final TransformType type) Implements org. Doc from org. Returns the (forward, inverse) transform of the specified real data set.
The first element of the specified data set is required to be
| |
| transform | back to summary |
|---|---|
| public double[] transform(final UnivariateFunction f, final double min, final double max, final int n, final TransformType type) Implements org. Doc from org. Returns the (forward, inverse) transform of the specified real function,
sampled on the specified interval.
This implementation enforces
| |