highPass: SPM high pass filter

Description Usage Arguments Value Author(s) Examples

Description

Removes low frequency drifts from data.

Usage

1
highPass(x, freq, tr)

Arguments

x

Numeric matrix or vector. If a vector is supplied it will be coerced to a matrix.

freq

This is the cutoff frequency. It is specified in seconds for comparability with SPM.

tr

This is the time between samples(or the TR for fMRI data.)

Value

A high pass filtered matrix will always be returned.

Author(s)

Tim Tierney

Examples

1
2
3
4
5
6
7
8
9
t<-seq(1,300)
y<-cos(.01*pi*t)+.1*cos(.2*pi*t)   ## time series with low frequency drift
plot(t,y,type="l",col="red",lwd=5) ## plot it
hp.y<-highPass(y,128,2.16)        ## filter it at 128s (like in SPM) with a tr of 2.16
lines(t,hp.y,col="blue",lwd=5)     ## result has no drift
legend(x="topright",               ## Create the Legend
legend=c("Raw Signal",
         "Highpass Filtered"),
col=c("red","blue"),lwd=2)

FIACH documentation built on May 1, 2019, 8:02 p.m.

Related to highPass in FIACH...