Resamples all (or selected) numeric assays of a PhysioExperiment object to a new target sampling rate. Both upsampling and downsampling are supported.
Usage
resampleSignal(
pe,
target_rate,
method = c("linear", "spline"),
assay_names = NULL
)Value
A new PhysioExperiment with resampled assays, updated
samplingRate, and updated metadata$time vector.
See also
resampleVector() for resampling individual numeric vectors,
synchronizeSignals() for synchronizing multiple experiments.
Examples
pe <- PhysioCore::PhysioExperiment(
assays = S4Vectors::SimpleList(
position_x = matrix(sin(seq(0, 2 * pi, length.out = 100)), ncol = 1)
),
colData = S4Vectors::DataFrame(label = "M1", type = "marker"),
samplingRate = 100
)
pe2 <- resampleSignal(pe, target_rate = 200)
PhysioCore::samplingRate(pe2) # 200
#> [1] 200