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 TypeMethodDescriptionvoid
forward
(double[] g) Performs an "in-place" 1D DCT forward transformation on the supplied data.int
getSize()
Returns the size of this DCT (length of data vectors).void
inverse
(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, wait
Methods 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:Dct1d
Returns the size of this DCT (length of data vectors). -
forward
Description copied from interface:Dct1d.Double
Performs an "in-place" 1D DCT forward transformation on the supplied data. The input signal is replaced by the associated DFT spectrum.- Specified by:
forward
in interfaceDct1d.Double
- Parameters:
g
- the signal to be transformed (modified)
-
inverse
Description copied from interface:Dct1d.Double
Performs an "in-place" 1D DCT inverse transformation on the supplied spectrum. The input spectrum is replaced by the associated signal.- Specified by:
inverse
in interfaceDct1d.Double
- Parameters:
G
- the spectrum to be transformed (modified)
-