upsample: Increase sample rate

View source: R/upsample.R

upsampleR Documentation

Increase sample rate

Description

Upsample a signal by an integer factor.

Usage

upsample(x, n, phase = 0)

Arguments

x

input data, specified as a numeric vector or matrix. In case of a vector it represents a single signal; in case of a matrix each column is a signal.

n

upsampling factor, specified as a positive integer. The signal is upsampled by inserting n - 1 zeros between samples.

phase

offset, specified as a positive integer from 0 to n - 1. Default: 0.

Value

Upsampled signal, returned as a vector or matrix.

Author(s)

Paul Kienzle, pkienzle@users.sf.net.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

See Also

downsample, interp, decimate, resample

Examples

x <- seq_len(4)
u <- upsample(x, 3)
u <- upsample(x, 3, 2)

x <- matrix(seq_len(6), 3, byrow = TRUE)
u <- upsample(x, 3)


gjmvanboxtel/gsignal documentation built on Nov. 22, 2023, 8:19 p.m.