Calculates discrete cosine transforms, as introduced by Dommergues and colleagues, on open outlines.

dfourier(x, nb_h, raw = FALSE, from_col, to_col, drop_coo, ...)

dfourier_i(x, nb_h, nb_pts, from_col, to_col, ...)

Arguments

x

coo_single, coo_list or mom_tbl

nb_h

int nb of harmonics. Default to 6 for dfourier, to all of them for dfourier_i

raw

logical whether to return raw and full results for dfourier

from_col, to_col

column names

drop_coo

logical whether to drop coo column (default to TRUE)

...

for generics. Useless here.

nb_pts

int nb of points for the reconstruction

Value

a list with components when applied on a single shape:

Details

Shapes must be normalized, ie using coo_bookstein before performing the dct transform.

Functions

  • dfourier_i: inverse dfourier method

References

  • Dommergues, C. H., Dommergues, J.-L., & Verrecchia, E. P. (2007). The Discrete Cosine Transform, a Fourier-related Method for Morphometric Analysis of Open Contours. Mathematical Geology, 39(8), 749-763. doi:10.1007/s11004-007-9124-6

  • Many thanks to Remi Laffont for the original translation in R).

See also

Other morphometrics: efourier(), npoly(), opoly()

Examples

olea[1:3, ] %>% dfourier()
#> ! dfourier: 'nb_h' not provided and set to 6
#> dfourier: `raw` provided but useless here
#> # A tibble: 3 x 5 #> var domes view ind coe #> <fct> <fct> <fct> <fct> <list<coe_single[,0]>> #> 1 Aglan cult VD O10 <tibble [1 × 12]> #> 2 Aglan cult VL O10 <tibble [1 × 12]> #> 3 Aglan cult VD O11 <tibble [1 × 12]> #> ❯mom_tbl