Learn R Programming

fCWTr (version 0.2.1)

as.data.frame.fcwtr_scalogram: Coerce the scalogram matrix to a data frame

Description

Internally, the scalogram resulting from fcwt() is represented by a numeric matrix. This method coerces this matrix into a reasonable data frame. Note that this conversion has a significant run time cost.

Usage

# S3 method for fcwtr_scalogram
as.data.frame(x, ...)

Value

A data.frame() object representing the scalogram data with four columns:

time_ind

An integer index uniquely identifying time slices.

time

The time difference to the first time slice in physical units. The time unit is the inverse of the frequency unit chosen by the user for the sample_freq argument of fcwt().

freq

The frequency in the same units as the sample_freq argument of fcwt().

value

The fCWT result for the particular time-frequency combination.

Arguments

x

An object resulting from fcwt().

...

additional arguments to be passed to or from methods.

Examples

Run this code
fcwt(
  sin((1:5000) * 2 * pi * 440 / 44100),
  sample_freq = 44100,
  n_freqs = 10
) |>
as.data.frame() |>
head()

Run the code above in your browser using DataLab