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

medfilt1

Median filter


Description

Deprecated! Performs an n-point running median. For Matlab/Octave compatibility.

Usage

medfilt1(x, n = 3, ...)

MedianFilter(n = 3)

## S3 method for class 'MedianFilter'
filter(filt, x, ...)

Arguments

x

signal to be filtered.

n

size of window on which to perform the median.

filt

filter to apply to the signal.

...

additional arguments passed to runmed.

Details

medfilt1 is a wrapper for runmed.

Value

For medfilt1, the filtered signal of length(x).

For MedianFilter, a class of “MedianFilter” that can be used with filter to apply a median filter to a signal.

Author(s)

Tom Short.

References

Octave Forge http://octave.sf.net

See Also

Examples

t <- seq(0, 1, len=100)                            # 1 second sample
x <- sin(2*pi*t*2.3) + 0.25*rlnorm(length(t), 0.5) # 2.3 Hz sinusoid+noise
plot(t, x, type = "l")
# 3-point filter
lines(t, medfilt1(x), col="red", lwd=2) 
# 7-point filter
lines(t, filter(MedianFilter(7), x), col = "blue", lwd=2) # another way to call it

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.