Skip to contents

Resamples a list of PhysioExperiment objects so they all share the same sampling rate and have the same number of time points.

Usage

synchronizeSignals(pe_list, target_rate = NULL, method = c("linear", "spline"))

Arguments

pe_list

A list of PhysioExperiment objects.

target_rate

Target sampling rate in Hz. If NULL (default), the highest sampling rate among the inputs is used.

method

Interpolation method: "linear" (default) or "spline".

Value

A list of PhysioExperiment objects, all with the same sampling rate and the same number of rows (time points).

References

Oppenheim AV, Willsky AS, Nawab SH (1997). "Signals and Systems." 2nd ed. Prentice Hall.

See also

resampleSignal() for resampling individual PhysioExperiment objects, resampleVector() for resampling raw numeric vectors.

Examples

pe1 <- PhysioCore::PhysioExperiment(
  assays = S4Vectors::SimpleList(
    raw = matrix(rnorm(100), ncol = 1)
  ),
  colData = S4Vectors::DataFrame(label = "ch1", type = "marker"),
  samplingRate = 100
)
pe2 <- PhysioCore::PhysioExperiment(
  assays = S4Vectors::SimpleList(
    raw = matrix(rnorm(200), ncol = 1)
  ),
  colData = S4Vectors::DataFrame(label = "ch1", type = "marker"),
  samplingRate = 200
)
synced <- synchronizeSignals(list(pe1, pe2))