java.lang.Object
imagingbook.spectral.dct.Dct1dDirect
- All Implemented Interfaces:
Dct1d
- Direct Known Subclasses:
Dct1dDirect.Double
,Dct1dDirect.Float
Calculates the 1D DFT using tabulated cosine values for float
or
double
data (see sub-classes Dct1dDirect.Float
and
Dct1dDirect.Double
, respectively). This implementation is
considerably faster than the naive version without cosine tables (see
Dct1dSlow
). Other optimizations are possible. Note that this class
has no public constructor - instantiate sub-class Dct1dDirect.Float
or Dct1dDirect.Double
instead, as shown below. See Sec. 20.1 of [1]
for additional details.
Usage example (for float
data):
float[] data = {1, 2, 3, 4, 5, 3, 0}; Dct1d.Float dct = new Dct1dDirect.Float(data.length); dct.forward(data); dct.inverse(data); ...
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
One-dimensional DCT implementation usingdouble
data.static class
One-dimensional DCT implementation usingfloat
data. -
Method Summary
Modifier and TypeMethodDescriptionint
getSize()
Returns the size of this DCT (length of data vectors).