This function will tidily apply the Discrete Cosine Transform with forward
normalization (see dct for more info) to the targeted columns.
Identifying tokens
The DCT only works on a by-token basis, so there must be a column that
uniquely identifies (or, in combination with a .by grouping, uniquely
identifies) each individual token. This column should be passed to
.token_id_col.
Order
The number of DCT coefficients to return is defined by .order. The default
value is 5. Larger numbers will lead to less smoothing when the Inverse
DCT is applied (see idct). Smaller numbers will lead to more smoothing.
If NA is passed to .order, all DCT parameters will be returned, which
when the Inverse DCT is supplied, will completely reconstruct the original
data.
Sorting by Time
An optional .time_col can also be defined to ensure that the data is
correctly arranged by time.