-
-
Notifications
You must be signed in to change notification settings - Fork 43
Cosine Transforms
The DiscreteCosine and FastCosine classes decomposes a finite sequence of data points in terms of a sum of cosine functions of different frequencies. This is different from the Fourier transform which decomposes the input signal into both sine and cosine functions.
This class incorporates 4 of the 8 types of transforms - Type I - IV. Refer to this link for more details about each type - and their utlities.
STANDARD NORMALIZATION
If using DCT, we can use all types 1 to 4, while performing the transformation:
DiscreteCosine dct = new DiscreteCosine(signal); //signal is a double[]
// Type 1
dct.transform(1);
double[] outputType1 = dct.getMagintude()
// Type 2
dct.transform(2);
double[] outputType2 = dct.getMagintude()
// Type 3
dct.transform(3);
double[] outputType3 = dct.getMagintude()
// Type 4
dct.transform(4);
double[] outputType4 = dct.getMagintude()
Fast Cosine Transform is a more efficient implementation but only exists for Type 1 Transform. This acts as a wrapper on top of Apache Math 3's implementation of FastCosineTransformer
FastCosine f1 = new FastCosine(signal); //signal is a double[]
f1.transform();
double[] out = f1.getMagnitude();
ORTHOGONAL NORMALIZATION
If using DCT, we can use all types 1 to 4, while performing the transformation:
DiscreteCosine dct = new DiscreteCosine(signal, DiscreteCosine.Normalization.ORTHOGONAL); //signal is a double[]
dct.transform(1); // Type can be 1, 2, 3 or 4
double[] outputType1 = dct.getMagintude()
Fast Cosine Transform is a more efficient implementation but only exists for Type 1 Transform. This acts as a wrapper on top of Apache Math 3's implementation of FastCosineTransformer
FastCosine f1 = new FastCosine(signal, FastCosine.Normalization.ORTHOGONAL); //signal is a double[]
f1.transform();
double[] out = f1.getMagnitude();
Wiki
-
Filters
- IIR Filters
- FIR Filters
- Kernel-Based Filter
- Adaptive Filters
-
Signals
-
Peak Detection
-
Transformations
-
Speech
-
Windowing