Learn R Programming

fftab (version 0.1.0)

add_l2nm: Add L2 Norm and Squared L2 Norm of Frequency Dimensions

Description

These functions compute and append the L2 norm and squared L2 norm of the frequency dimensions (.dim_* columns) as new columns in a fftab object.

Usage

add_l2nm(x)

add_l2sq(x)

get_l2nm(x)

get_l2sq(x)

Value

A vector or fftab object with additional columns:

  • l2nm: The L2 norm of the frequency dimensions.

  • l2sq: The squared L2 norm of the frequency dimensions.

Arguments

x

A fftab object containing frequency dimensions (.dim_*) and associated metadata.

Details

  • add_l2nm(): Appends a column l2nm containing the L2 norm, calculated as the square root of the sum of squared values across .dim_* columns.

  • add_l2sq(): Appends a column l2sq containing the squared L2 norm, calculated as the sum of squared values across .dim_* columns.

  • get_l2nm(): Returns a numeric vector representing the L2 norm for each row.

  • get_l2sq(): Returns a numeric vector representing the squared L2 norm for each row.

See Also

Examples

Run this code
matrix(1:9, 3) |>
  fftab() |>
  print(n = 3) |>
  add_l2nm() |>
  print(n = 3) |>
  add_l2sq() |>
  print(n = 3)

Run the code above in your browser using DataLab