Down/Up Sampling Operator

DESCRIPTION:

Down-sampling and up-sampling operators

USAGE:

down.sample(x, factor=2, offset=1) 
up.sample(x, facter) 

REQUIRED ARGUMENTS:

x
a vector.
facter
a positive integer, sampling factor.

OPTIONAL ARGUMENTS:

offset
for down.sample only, a positive integer as the starting index.

VALUE:

down.sample returns a vector of length [(length(x)-offset+1)/factor]; up.sample returns a vector of length length(x)*factor.

DETAILS:

down.sample operator decimates x by a factor and up.sample operator repeats each value in x by factor times.