RecurrenceFilter[{α,β},x]
filters x using a linear recurrence equation with coefficients α and β.
RecurrenceFilter[tf,x]
uses a discrete-time filter defined by the TransferFunctionModel tf.
RecurrenceFilter[…,x,{y0,y-1,…}]
uses a specified list {y0,y-1,…} as the initial condition.
RecurrenceFilter[…,image]
filters image.
RecurrenceFilter[…,sound]
filters sampled sound object.
RecurrenceFilter
RecurrenceFilter[{α,β},x]
filters x using a linear recurrence equation with coefficients α and β.
RecurrenceFilter[tf,x]
uses a discrete-time filter defined by the TransferFunctionModel tf.
RecurrenceFilter[…,x,{y0,y-1,…}]
uses a specified list {y0,y-1,…} as the initial condition.
RecurrenceFilter[…,image]
filters image.
RecurrenceFilter[…,sound]
filters sampled sound object.
Details and Options
- RecurrenceFilter[{α,β},x] gives the response y to the causal input x by solving the recurrence equation
for n from 1 to Length[x], where i is Length[α] and j is Length[β]. - RecurrenceFilter[{α,β},x] uses an initial condition
. - RecurrenceFilter[{α,β},x] pads the input x so that
. The values can be changed with the Padding option. With Padding->None, the response y effectively starts at yj, and the output dimensions are normally smaller than the input. » - The specified coefficients α and β are respectively the denominator and numerator polynomial coefficients of the desired transfer function model.
- In RecurrenceFilter[tf,…], tf should be a single-input single-output (SISO) system.
- RecurrenceFilter works with arbitrary-rank numerical arrays, 2D and 3D images, and sampled sound objects, operating separately on each channel.
- Possible sound objects include:
-
SampledSoundList[{a1,a2,…},r] amplitude levels given in a list SampledSoundFunction[f,n,r] amplitude levels generated by a function Sound[prims,…] excluding SoundNote objects in prims - When applied to images and multidimensional arrays, the specified filter is applied successively to each dimension, starting at level 1.
- For multichannel image and sound objects, RecurrenceFilter is applied to each channel separately.
Examples
open all close allBasic Examples (2)
Scope (5)
Use symbolic values for filter coefficients:
RecurrenceFilter[{{1, Subscript[α, 1]}, {β}}, {1, 0, 0, 0, 0, 0}]RecurrenceFilter[{{1, -(1/2)}, {1}}, {a, b, c, d}]Apply a filter specified using a transfer function model:
RecurrenceFilter[TransferFunctionModel[{{{z}}, -1/2 + z}, z,
SamplingPeriod -> 1], {1, 0, 0, 0, 0, 0}]RecurrenceFilter[{{1, -(1/2)}, {1}}, {1, 0, 0, 0, 0, 0}, {1}]Filter a TimeSeries:
ts = TemporalData[TimeSeries, {{{0., -0.27267267057145633, -0.6672983789995302, -0.5338541947930846,
-0.6117404489279314, -0.6755527076595494, -0.02125421294486496, -0.10792797291843935,
-0.6138271235477938, -0.3248568606554575, -0.08843449054 ... 2053424, -0.49980440691873723, -0.5388679788215971,
-0.4101602764645551}}, {{0, 1., 0.01}}, 1, {"Continuous", 1}, {"Continuous", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, False,
10.1];filtered = RecurrenceFilter[{{.3}, {.1}}, ts]ListLinePlot[{ts, filtered}, PlotLegends -> {"original data", "filtered"}]Options (1)
Padding (1)
By default, RecurrenceFilter uses zero padding:
RecurrenceFilter[{{1}, {1 / 3, 1 / 3, 1 / 3}}, Range[6]]RecurrenceFilter[{{1}, {1 / 3, 1 / 3, 1 / 3}}, Range[6], Padding -> -1]RecurrenceFilter[{{1}, {1 / 3, 1 / 3, 1 / 3}}, Range[6], Padding -> "Periodic"]With Padding->None, a shorter sequence is returned:
RecurrenceFilter[{{1}, {1 / 3, 1 / 3, 1 / 3}}, Range[6], Padding -> None]Applications (3)
Filtering a noisy sinusoid signal with a recursive smoothing filter:
data = Table[Sin[i ^ 2 + i] + RandomReal[{-.2, .3}], {i, 0, Pi, 0.01}];
{ListLinePlot[data], ListLinePlot[RecurrenceFilter[{{1, -(4/5)}, {(1/5)}}, data]]}s = Sound[SampledSoundList[Table[Cos[( i/4.) + ((i/50.))^2], {i, 8000}], 8000]]RecurrenceFilter[{{1, -(4/5)}, {(1/5)}}, s]Filter an image using a lowpass Butterworth filter:
RecurrenceFilter[ToDiscreteTimeModel[ButterworthFilterModel[{3, .5}, s], 1], [image]]Properties & Relations (5)
Impulse response of first-order recursive filter:
RecurrenceFilter[{{1, -(1/2)}, {1}}, {1, 0, 0, 0, 0, 0}]Step response of a non-recursive filter:
RecurrenceFilter[{{1}, {1 / 3, 1 / 3, 1 / 3}}, {1, 1, 1, 1, 1, 1}]In 2D, the filter is applied successively to rows and columns:
data = (| | | | | |
| - | - | - | - | - |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 |);
RecurrenceFilter[{{1, -1 / 2}, {1}}, data]//MatrixFormUse Map to apply the filter to rows only:
Map[RecurrenceFilter[{{1, -1 / 2}, {1}}, #]&, data]//MatrixFormFor 1D arrays, OutputResponse is equivalent to RecurrenceFilter:
sys = TransferFunctionModel[(z/z - (1/2)), z, SamplingPeriod -> 1];
OutputResponse[sys, {1, 0, 0, 0, 0, 0, 0, 0}][[1]] ==
RecurrenceFilter[sys, {1, 0, 0, 0, 0, 0, 0, 0}]Use RecurrenceTable when describing the filter using a difference equation:
RecurrenceTable[{y[n] - (1/2)y[n - 1] == DiscreteDelta[n], y[-1] == 0}, y[n], {n, 0, 7}] == RecurrenceFilter[{{1, -(1/2)}, {1}}, {1, 0, 0, 0, 0, 0, 0, 0}]ListConvolve and RecurrenceFilter return equivalent results for non-recursive digital filters:
ker = {1 / 3, 1 / 3, 1 / 3};data = {0, 0, 1, 1, 1, 1, 0, 0};
ListConvolve[ker, data] == RecurrenceFilter[{{1}, ker}, data][[3 ;; ]]Related Guides
Text
Wolfram Research (2012), RecurrenceFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/RecurrenceFilter.html (updated 2014).
CMS
Wolfram Language. 2012. "RecurrenceFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/RecurrenceFilter.html.
APA
Wolfram Language. (2012). RecurrenceFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RecurrenceFilter.html
BibTeX
@misc{reference.wolfram_2026_recurrencefilter, author="Wolfram Research", title="{RecurrenceFilter}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/RecurrenceFilter.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_recurrencefilter, organization={Wolfram Research}, title={RecurrenceFilter}, year={2014}, url={https://reference.wolfram.com/language/ref/RecurrenceFilter.html}, note=[Accessed: 13-June-2026]}