MeanFilter[data,r]
filters data by replacing every value by the mean value in its range-r neighborhood.
MeanFilter[data,{r1,r2,…}]
uses ri for filtering the dimension in data.


MeanFilter
MeanFilter[data,r]
filters data by replacing every value by the mean value in its range-r neighborhood.
MeanFilter[data,{r1,r2,…}]
uses ri for filtering the dimension in data.
Details

- MeanFilter is used to locally smooth data and diminish noise, where the amount of smoothing is dependent on the value of r.
- The function applied to each range-r neighborhood is Mean.
- The data can be any of the following:
-
list arbitrary-rank numerical array tseries temporal data such as TimeSeries, TemporalData, … image arbitrary Image or Image3D object audio an Audio object video a Video object - For multichannel images and audio signals, MeanFilter operates separately on each channel.
- MeanFilter[data,{r1,r2,…}] computes the mean value in
blocks centered on each sample.
- MeanFilter assumes the index coordinate system for lists and images.
- At the data boundaries, MeanFilter uses smaller neighborhoods.


Examples
open all close allBasic Examples (3)
Scope (13)
Data (8)
Parameters (5)
Specify one radius to be used in all directions:
Increasing the radius will result in smoother images:
Mean filtering just in the first direction:
Mean filtering of a 3D image in the vertical direction only:
Filtering of the horizontal planes only:
Use a quantity parameter with a TimeSeries input:
Applications (3)
Use MeanFilter to smooth a time series and identify the trend:
Properties & Relations (5)
Compare filtering results using geometric, harmonic and standard mean filters:
For positive data, HarmonicMeanFilter[data,r]≤GeometricMeanFilter[data,r]≤MeanFilter[data,r]:
MeanFilter is equivalent to ListConvolve with a moving-average filter of length , if
samples are removed from the border:
However, ListConvolve is substantially faster:
MeanFilter is a frequency-selective filter with a lowpass characteristic:
Use MedianFilter to avoid excessive edge blurring:
See Also
MovingAverage Mean MeanShiftFilter MedianFilter GuidedFilter ImageConvolve CellularAutomaton
Function Repository: HampelFilter
Tech Notes
History
Introduced in 2008 (7.0) | Updated in 2015 (10.2) ▪ 2016 (11.0) ▪ 2025 (14.3)
Text
Wolfram Research (2008), MeanFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/MeanFilter.html (updated 2025).
CMS
Wolfram Language. 2008. "MeanFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/MeanFilter.html.
APA
Wolfram Language. (2008). MeanFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanFilter.html
BibTeX
@misc{reference.wolfram_2025_meanfilter, author="Wolfram Research", title="{MeanFilter}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/MeanFilter.html}", note=[Accessed: 14-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_meanfilter, organization={Wolfram Research}, title={MeanFilter}, year={2025}, url={https://reference.wolfram.com/language/ref/MeanFilter.html}, note=[Accessed: 14-August-2025]}