Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

shift

Function to shift the elements of a vector.


Description

The function makes use of the function 'filter' to delay or advance a signal by k points.

Usage

shift(x, delta = 1, circular = TRUE)

Arguments

x

A numeric vector

delta

A single element numeric vector. Defines the number of points by which the signal should be shifted.

circular

Logical. If T, the signal is wrapped around itself so that if delta = 1, x[n] becomes x[1]. Otherwise, if delta is positive, the same number of zeros are prepended to the signal

Details

The function makes use of the function 'filter' for linear filtering to carry out the shifting.

Value

The signal shifted by a certain number of points. ...

Author(s)

Jonathan Harrington

See Also

filter

Examples

vec = 1:10
shift(vec, 2)
shift(vec, -2)
shift(vec, 2, circular=FALSE)

emuR

Main Package of the EMU Speech Database Management System

v2.2.0
GPL (>= 2)
Authors
Raphael Winkelmann [aut, cre], Klaus Jaensch [aut, ctb], Steve Cassidy [aut, ctb], Jonathan Harrington [aut, ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.