cycle_calc: Calculate cycles

View source: R/tfr_analysis.R

cycle_calcR Documentation

Calculate cycles

Description

A helper function for calculating the appropriate min-max cycles for a fixed time window/frequency resolution for use with compute_tfr. For some analyses you may wish to keep a fixed frequency resolution across the range being analysed, which requires using a fixed time window. compute_tfr expects the minimum and maximum number of cycles to be supplied. Use this function to calculate the equivalent number of cycles at each frequency.

Usage

cycle_calc(time_win, frex)

Arguments

time_win

Time window in seconds.

frex

Frequencies of interest.

Value

the number of cycles for each frequency of interest

See Also

compute_tfr

Examples

cycle_calc(.5, seq(3, 30, length.out = 10))
no_scale_tfr <- compute_tfr(demo_epochs, foi = c(3, 30),
 n_cycles = range(cycle_calc(0.5, seq(3, 30, length.out = 10))),
  n_freq = 10)

neuroconductor/eegUtils documentation built on Feb. 3, 2023, 5:33 p.m.