zpad: Zero pad

Description Usage Arguments Value Examples

View source: R/ttools.R

Description

Pad a vector with zeros

Usage

1
zpad(s, n)

Arguments

s

vector of time series samples

n

expansion factor - returned vector will be at least n times original length.

Value

Padded input signal

Examples

1
2
3
4
5
6
7
n <- 16
s <- rep( 1, 32 )
spad <- zpad( s, n )
S <- fft( spad )
# Show 
f <- seq( 0, to = 0.5, length.out = length( spad ) )
plot( f, Mod( S[1:(length( spad ) / 2 + 1 )] ), type = "l", xlab = "Frequency", ylab = "Mod(S)" )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.