These functions add additional representations to a fftab object without removing or modifying existing representations.
Details
add_cplx(): Adds a complex ("cplx") representation to the Fourier coefficients.add_rect(): Adds a rectangular ("rect") representation to the Fourier coefficients.add_polr(): Adds a polar ("polr") representation to the Fourier coefficients.
These functions are useful for working with multiple representations simultaneously without overwriting existing data.
Examples
matrix(1:9, 3) |>
fftab() |>
print(n = 3) |>
add_polr() |>
print(n = 3) |>
add_rect() |>
print(n = 3) |>
add_cplx() |>
print(n = 3)
#> # A tibble: 9 × 3
#> .dim_1 .dim_2 fx
#> * <dbl> <dbl> <cpl>
#> 1 0 0 45.0+0.000000i
#> 2 0.333 0 -4.5+2.598076i
#> 3 -0.333 0 -4.5-2.598076i
#> # ℹ 6 more rows
#> # A tibble: 9 × 5
#> .dim_1 .dim_2 fx mod arg
#> <dbl> <dbl> <cpl> <dbl> <dbl>
#> 1 0 0 45.0+0.000000i 45 0
#> 2 0.333 0 -4.5+2.598076i 5.20 2.62
#> 3 -0.333 0 -4.5-2.598076i 5.20 -2.62
#> # ℹ 6 more rows
#> # A tibble: 9 × 7
#> .dim_1 .dim_2 fx mod arg re im
#> <dbl> <dbl> <cpl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 0 45.0+0.000000i 45 0 45 0
#> 2 0.333 0 -4.5+2.598076i 5.20 2.62 -4.5 2.60
#> 3 -0.333 0 -4.5-2.598076i 5.20 -2.62 -4.5 -2.60
#> # ℹ 6 more rows
#> # A tibble: 9 × 7
#> .dim_1 .dim_2 fx mod arg re im
#> <dbl> <dbl> <cpl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 0 45.0+0.000000i 45 0 45 0
#> 2 0.333 0 -4.5+2.598076i 5.20 2.62 -4.5 2.60
#> 3 -0.333 0 -4.5-2.598076i 5.20 -2.62 -4.5 -2.60
#> # ℹ 6 more rows
