Learn R Programming

FBN (version 1.5.2)

meanFilter: 1D Mean Filter

Description

1-dimensional mean filter with a specified windowSize of the inputData

Usage

meanFilter(inputData, windowSize)
meanFilter(inputData = NULL, windowSize = 3)

Value

The output data has the same size of the input data. If the window half-size is smaller or equal to 1, then the input data is passed directly to the output data.

Arguments

inputData

The vector of values to be filtered

windowSize

The half-size of the filtering window (default windowSize = 3)

Author

Adrian Andronache adi.andronache@gmail.com
Luca Agnelli luca.agnelli@gmail.com

Details

Classical implementation of a mean filter, using a sliding window. By default, the half-size of the sliding window is set to 3 unless otherwise specified.

Examples

Run this code
x <- meanFilter(c(0, 0, 0, 1, 1, 1, 0, 0, 1, 0))
x <- meanFilter(c(0, 0, 0, 1, 0, 0, 0, 0, 1, 0), windowSize = 5)

Run the code above in your browser using DataLab