The signal vector data is aggregated by an integer factor n. If an eseis object is provided, the meta data is updated. The function is a wrapper for the funcion decimate of the package signal.
signal_aggregate(data, n =2, type ="iir")
Arguments
data: eseis object, numeric vector or list of objects, data set to be processed.
n: Numeric value, number of samples to be aggregated to one new data value. Must be an integer value greater than 1. Default is 2.
type: Character value, filter type used for aggregation. For details see documentation of signal::decimate. Default is "iir".
Returns
Aggregated data set.
Examples
## load example data setdata(rockfall)## aggregate signal by factor 4 (i.e., dt goes from 1/200 to 1/50)rockfall_agg <- signal_aggregate(data = rockfall_z, n =4)## create example data sets <-1:10## aggregate x by factor 2s_agg_2 <- signal_aggregate(data = s, n =2)## aggregate x by factor 3s_agg_3 <- signal_aggregate(data = s, n =3)## plot resultsplot(x = s, y = rep(x =1, times = length(s)), ylim = c(1,3))points(x = s_agg_2, y = rep(x =2, times = length(s_agg_2)), col =2)points(x = s_agg_3, y = rep(x =3, times = length(s_agg_3)), col =3)abline(v = s_agg_2, col =2)abline(v = s_agg_3, col =3)## create signal matrixX <- rbind(1:100,1001:1100,10001:10100)## aggregate signal matrix by factor 4X_agg <- signal_aggregate(data = X,n =4)