java.lang.Object
imagingbook.spectral.dct.Dct1dSlow
- All Implemented Interfaces:
Dct1d,Dct1d.Double
Calculates the 1D discrete cosine transform (DFT) on double data.
This is a naive implementation which calculates cosines repeatedly (i.e., does
NOT use pre-calculated cosine tables), intended for demonstration purposes
only. See Sec. 20.1 (Prog. 20.1) of [1] for additional details.
Usage example:
double[] data = {1, 2, 3, 4, 5, 3, 0};
Dct1d.Double dct = new Dct1dSlow(data.length);
dct.forward(data);
dct.inverse(data);
...
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Version:
- 2022/10/23
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface imagingbook.spectral.dct.Dct1d
Dct1d.Double, Dct1d.Float -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforward(double[] g) Performs an "in-place" 1D DCT forward transformation on the supplied data.intgetSize()Returns the size of this DCT (length of data vectors).voidinverse(double[] G) Performs an "in-place" 1D DCT inverse transformation on the supplied spectrum.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface imagingbook.spectral.dct.Dct1d.Double
checkSize
-
Constructor Details
-
Dct1dSlow
Constructor.- Parameters:
M- the data size
-
-
Method Details
-
getSize
Description copied from interface:Dct1dReturns the size of this DCT (length of data vectors). -
forward
Description copied from interface:Dct1d.DoublePerforms an "in-place" 1D DCT forward transformation on the supplied data. The input signal is replaced by the associated DFT spectrum.- Specified by:
forwardin interfaceDct1d.Double- Parameters:
g- the signal to be transformed (modified)
-
inverse
Description copied from interface:Dct1d.DoublePerforms an "in-place" 1D DCT inverse transformation on the supplied spectrum. The input spectrum is replaced by the associated signal.- Specified by:
inversein interfaceDct1d.Double- Parameters:
G- the spectrum to be transformed (modified)
-