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

signal.package

Signal processing


Description

A set of generally Matlab/Octave-compatible signal processing functions. Includes filter generation utilities, filtering functions, resampling routines, and visualization of filter models. It also includes interpolation functions and some Matlab compatibility functions.

Details

The main routines are:

Filtering: filter, fftfilt, filtfilt, medfilt1, sgolay, sgolayfilt

Resampling: interp, resample, decimate

IIR filter design: bilinear, butter, buttord, cheb1ord, cheb2ord, cheby1, cheby2, ellip, ellipord, sftrans

FIR filter design: fir1, fir2, remez, kaiserord, spencer

Interpolation: interp1, pchip

Compatibility routines and utilities: ifft, sinc, postpad, chirp, poly, polyval

Windowing: bartlett, blackman, boxcar, flattopwin, gausswin, hamming, hanning, triang

Analysis and visualization: freqs, freqz, impz, zplane, grpdelay, specgram

Most of the functions accept Matlab-compatible argument lists, but many are generic functions and can accept simpler argument lists.

For a complete list, use library(help="signal").

Author(s)

Most of these routines were translated from Octave Forge routines. The main credit goes to the original Octave authors:

Paul Kienzle, John W. Eaton, Kurt Hornik, Andreas Weingessel, Kai Habel, Julius O. Smith III, Bill Lash, André Carezia, Paulo Neis, David Billinghurst, Friedrich Leisch

Translations by Tom Short tshort@eprisolutions.com (who maintained the package until 2009).

Current maintainer is Uwe Ligges ligges@statistik.tu-dortmund.de.

References

Octave Forge http://octave.sf.net

Package matlab by P. Roebuck

For Matlab/Octave conversion and compatibility, see http://mathesaurus.sourceforge.net/octave-r.html by Vidar Bronken Gundersen and http://cran.r-project.org/doc/contrib/R-and-octave.txt by Robin Hankin.

Examples

## The R implementation of these routines can be called "matlab-style",
bf <- butter(5, 0.2)
freqz(bf$b, bf$a)
## or "R-style" as:
freqz(bf)

## make a Chebyshev type II filter:
ch <- cheby2(5, 20, 0.2) 
freqz(ch, Fs = 100)  # frequency plot for a sample rate = 100 Hz

zplane(ch) # look at the poles and zeros

## apply the filter to a signal
t <- seq(0, 1, by = 0.01)                     # 1 second sample, Fs = 100 Hz
x <- sin(2*pi*t*2.3) + 0.25*rnorm(length(t))  # 2.3 Hz sinusoid+noise
z <- filter(ch, x)  # apply filter
plot(t, x, type = "l")
lines(t, z, col = "red")

# look at the group delay as a function of frequency
grpdelay(ch, Fs = 100)

signal

Signal Processing

v0.7-6
GPL-2
Authors
Uwe Ligges [aut, cre] (new maintainer), Tom Short [aut] (port to R), Paul Kienzle [aut] (majority of the original sources), Sarah Schnackenberg [ctb] (various test cases and bug fixes), David Billinghurst [ctb], Hans-Werner Borchers [ctb], Andre Carezia [ctb], Pascal Dupuis [ctb], John W. Eaton [ctb], E. Farhi [ctb], Kai Habel [ctb], Kurt Hornik [ctb], Sebastian Krey [ctb], Bill Lash [ctb], Friedrich Leisch [ctb], Olaf Mersmann [ctb], Paulo Neis [ctb], Jaakko Ruohio [ctb], Julius O. Smith III [ctb], Doug Stewart [ctb], Andreas Weingessel [ctb]
Initial release
2015-07-29

We don't support your browser anymore

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