API Reference
This page documents the package API automatically.
DST
PolyHarmonicTrigTransforms.DST.dst — Function
dst(x; dims=1)Compute the Type-I Discrete Sine Transform (DST) of x along dims.
Arguments
x: anAbstractArray(vector or matrix).dims: dimension to transform (default1).
Returns
- transformed array of the same shape as
x.
Example
y = dst([1.0,2.0,3.0])PolyHarmonicTrigTransforms.DST.dst! — Function
dst!(x; dims=1)In-place DST that overwrites x with its transform when possible. Falls back to a safe out-of-place compute and copy if the in-place routine is not available on the current platform.
PolyHarmonicTrigTransforms.DST.plan_dst — Function
plan_dst(x; dims=1, flags=FFTW.MEASURE)Create an FFTW r2r plan for the DST (RODFT00) on x. The returned plan can be executed with plan * x.
IDST
PolyHarmonicTrigTransforms.IDST.idst — Function
idst(y; dims=1)
Inverse Type-I Discrete Sine Transform (IDST) of y along dims.
Arguments
y: anAbstractArrayof DST coefficients.dims: dimension to transform (default1).
Returns
- reconstructed array in the original domain.
PolyHarmonicTrigTransforms.IDST.plan_idst — Function
plan_idst(y; dims=1, flags=FFTW.MEASURE)
Create an FFTW r2r plan suitable for the IDST (uses the DST plan internally).
PolyHarmonicTrigTransforms.IDST.idst! — Function
idst!(y; dims=1)
In-place inverse DST: overwrite y with the reconstructed data when possible. Falls back to computing out-of-place and copying the result. Uses an FFTW r2r plan for the in-place computation when available. The result is scaled by 1/(N+1) to account for the normalization of the DST. Note that the input y should contain the DST coefficients, and after this function, it will contain the reconstructed data in the original domain.
LLST
PolyHarmonicTrigTransforms.LLST.llst2d — Function
llst2d(data)
Compute the 2D LLST (localized lattice-sine transform) decomposition of data.
Returns a level-list representation suitable for further processing.
PolyHarmonicTrigTransforms.LLST.llst2d! — Function
llst2d!(data)
In-place variant of llst2d that writes the decomposition back into data when possible.
PolyHarmonicTrigTransforms.LLST.illst2d — Function
illst2d(data)
Inverse 2D LLST: reconstruct the data from a level-list decomposition.
PolyHarmonicTrigTransforms.LLST.illst2d! — Function
illst2d!(data)
In-place inverse LLST that attempts to reconstruct into data without allocation.
ILLST
PolyHarmonicTrigTransforms.ILLST.illst — Function
illst(coef, ll)
Reconstruct an image from LLST coefficients coef using level-list ll. This is a thin wrapper around llst(..., inverse=true).
LLST2
PolyHarmonicTrigTransforms.LLST2.llst2 — Function
llst2(data, ll; inverse=false)
Perform the LLST block-based transform using level-list ll on data.
data: input 2D array.ll: level-list describing the quadtree partition.inverse: when true performs the inverse transform.
Returns the transformed array.
PolyHarmonicTrigTransforms.LLST2.llst2! — Function
llst2!(data, ll; inverse=false)
In-place variant of llst2 that overwrites data with the transformed result. Uses broadcasting assignment as a safe fallback.
LLSTAPPROX2
PolyHarmonicTrigTransforms.LLSTAPPROX2.llstapprox2 — Function
llstapprox2(data, levlist, krange; bdrykeep=false)
Evaluate LLST approximation quality for data using levlist over a range of retained coefficient counts krange. Returns PSNR values for each k.
PHLCT
PolyHarmonicTrigTransforms.PHLCT.phlct_backward — Function
phlct_backward(input, N)
Reconstruct an image from block-based PHLCT DCT coefficients.
Arguments
input: m×n array of DCT coefficients (block-based, m and n multiples ofN).N: block size (integer).
Returns
- reconstructed m×n image (real array).
PolyHarmonicTrigTransforms.PHLCT.phlct_backward! — Function
phlct_backward!(input, N)
In-place variant: overwrite input with the reconstructed image. Computes phlct_backward and assigns the result into input.
PolyHarmonicTrigTransforms.PHLCT.phlct_forward — Function
phlct_forward(input, N)
Compute block-based PHLCT forward transform (returns DCT coefficients).
Arguments
input: m×n image array (m and n must be multiples ofN).N: block size.
Returns
- m×n array of DCT coefficients for the PHLCT representation.
PolyHarmonicTrigTransforms.PHLCT.phlct_forward! — Function
phlct_forward!(input, N)
In-place variant: overwrite input with its PHLCT coefficients.
PolyHarmonicTrigTransforms.PHLCT.phlct_restore — Function
phlct_restore(in, qt)
Restore truncated DCT coefficients in using PHLCT and quantization table qt.
Returns the restored coefficient matrix.
PHLCT2D
PolyHarmonicTrigTransforms.PHLCT2D.phlct2d — Function
phlct2d(F, N)
Compute the 2D PHLCT coefficients for block-DCT coefficient matrix F.
F: m×n block-based DCT coefficient matrix (m,n multiples ofN).N: block size.
Returns the PHLCT coefficients V = F - U.
QTLLST2DL1
PolyHarmonicTrigTransforms.QTLLST2DL1.qtllst2dl1 — Function
qtllst2dl1(signal, lmax)
Find a quadtree level-list up to depth lmax that minimizes a DST-based cost.
Returns (liste, cost) where liste encodes the partition and cost is the objective value.
SOLVELAPLACE
PolyHarmonicTrigTransforms.SOLVELAPLACE.solvelaplace — Function
solvelaplace(image)
Solve the Laplace (Poisson) equation on the interior of image using DST/IDST.
Arguments
image: m×n array with boundary values; the routine solves for the interior (returns array sized m×n with boundary preserved).
Returns
- array with the computed solution where interior values have been solved and boundaries are unchanged.