Resample all streams onto a single common-rate view
Source:R/MultiRatePhysioExperiment-class.R
resampleToCommon.RdInterpolates every stream onto a shared time grid at rate, honouring
each stream's start offset on the master clock, and returns a single
PhysioExperiment whose channels are the union of all streams'
channels (prefixed with the stream name). Grid positions before/after a
stream's coverage are NA.
Examples
kin <- PhysioExperiment(
S4Vectors::SimpleList(raw = matrix(rnorm(100 * 2), 100, 2)), samplingRate = 100)
emg <- PhysioExperiment(
S4Vectors::SimpleList(raw = matrix(rnorm(1000 * 2), 1000, 2)), samplingRate = 1000)
mr <- MultiRatePhysioExperiment(kin = kin, emg = emg)
aligned <- resampleToCommon(mr, 1000)
dim(SummarizedExperiment::assay(aligned, "aligned"))
#> [1] 1000 4