DifferentiatorFilter[data,ωc]
applies a differentiator filter with a cutoff frequency ωc to an array of data.
DifferentiatorFilter[data,ωc,n]
uses a filter kernel of length n.
DifferentiatorFilter[data,ωc,n,wfun]
applies a smoothing window wfun to the filter kernel.
DifferentiatorFilter
DifferentiatorFilter[data,ωc]
applies a differentiator filter with a cutoff frequency ωc to an array of data.
DifferentiatorFilter[data,ωc,n]
uses a filter kernel of length n.
DifferentiatorFilter[data,ωc,n,wfun]
applies a smoothing window wfun to the filter kernel.
Details and Options
- DifferentiatorFilter is a finite impulse response (FIR) discrete-time filter that is commonly used to approximate the derivative of sampled data.
- The data can be any of the following:
-
list arbitrary-rank numerical array tseries temporal data such as TimeSeries and TemporalData image arbitrary Image or Image3D object audio an Audio or Sound object video a Video object - When applied to images and multidimensional arrays, filtering is applied successively to each dimension, starting at level 1. DifferentiatorFilter[data,{ωc1,ωc2,…}] uses the frequency ωci for the i
dimension. - Filtering with cutoff frequency ωc reduces the susceptibility of the derivative to signal noise, with the amount of smoothing dependent on the value of the cutoff frequency ωc.
- The cutoff frequency ωc should be between 0 and
. Smaller values of ωc result in greater smoothing. - DifferentiatorFilter[data,ωc] uses a filter kernel length and smoothing window suitable for the cutoff frequency ωc and the input data.
- Typical smoothing windows wfun include:
-
BlackmanWindow smoothing with a Blackman window DirichletWindow no smoothing HammingWindow smoothing with a Hamming window {v1,v2,…} use a window with values vi f create a window by sampling f between
and 
- The following options can be given:
-
Padding "Fixed" the padding value to use SampleRate Automatic sample rate assumed for the input - By default, SampleRate->1 is assumed for images as well as data. For sampled sound objects with sample rate r, SampleRate->r is used.
- With SampleRate->r, the cutoff frequency ωc should be between 0 and r×
.
Examples
open all close allBasic Examples (2)
Scope (10)
Data (7)
Filter a 1D triangular sequence:
data = BoxMatrix[5, {41}];
ListLinePlot[{data, DifferentiatorFilter[data, 1.]}, PlotRange -> All]data = Table[UnitBox[(n/7), (m/7)], {n, -7, 7}, {m, -7, 7}];
ListPlot3D[data]ListPlot3D[DifferentiatorFilter[data, 1.], PlotRange -> All]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 = DifferentiatorFilter[ts, Quantity[10, "Hertz"]];ListLinePlot[{ts, 5filtered}, PlotLegends -> {"original", "filtered"}, PlotRange -> All]Digital differentiation of a square wave audio signal:
a = AudioGenerator["Square"]DifferentiatorFilter[a, Quantity[15000, "Hertz"]]DifferentiatorFilter[Video["ExampleData/fish.mp4"], 3]Differentiation of a 3D image:
200DifferentiatorFilter[[image], Pi]DifferentiatorFilter[{0, 0, 0, 1, 1, 1, 0, 0, 0}, Pi, 4]Parameters (3)
With an audio signal, a numeric cutoff frequency is interpreted as radians per second:
a = \!\(\*AudioBox[""]\);DifferentiatorFilter[a, 10000 2 Pi] === DifferentiatorFilter[a, Quantity[10000*2*Pi, "Radians"/"Seconds"]] === DifferentiatorFilter[a, Quantity[10000, "Hertz"]]Differentiation of a unit step sequence using a filter of length 7:
DifferentiatorFilter[{0., 0., 0., 0., 1., 1., 1., 1.}, Pi, 6]Use a different cutoff frequency:
DifferentiatorFilter[{0., 0., 0., 0., 1., 1., 1., 1.}, Pi / 2, 6]Use a specific window function:
DifferentiatorFilter[{0., 0., 0., 0., 1., 1., 1., 1.}, Pi, 6, BlackmanWindow]Specify the window function as a numeric list:
DifferentiatorFilter[{0., 0., 0., 0., 1., 1., 1., 1.}, Pi, 6, {1, 1, 1, 1, 1, 1}]Use different cutoff frequencies in each dimension:
DifferentiatorFilter[[image], {Pi / 3, Pi}, 20]//ImageAdjustOptions (4)
Padding (2)
By default, "Fixed" padding is used:
DifferentiatorFilter[[image], Pi / 3, 21]//ImageAdjustUse Padding->None to eliminate potential image border artifacts:
DifferentiatorFilter[[image], Pi / 3, 21, Padding -> None]//ImageAdjustDifferent padding methods result in different edge effects:
ramp = Range[21] / 21. + RandomReal[.1, 21];
GraphicsRow@(ListLinePlot[{ramp, DifferentiatorFilter[ramp, Pi, 6, Padding -> #]}, ...]& /@ {"Fixed", "Periodic", 0})SampleRate (2)
Use a half-band differentiating filter, assuming a normalized sample rate of 1:
DifferentiatorFilter[{0, 0, 0, 1, 1, 1, 0, 0, 0}, π / 2., 5]DifferentiatorFilter[{0, 0, 0, 1, 1, 1, 0, 0, 0}, 3 π / 2., 5, SampleRate -> 3]Apply a half-band differentiator filter to audio sampled at a rate of
:
a = AudioGenerator[Sin[11025 2 π #^2]&];
sr = QuantityMagnitude@AudioSampleRate[a]DifferentiatorFilter[a, sr π / 2., 21]//PeriodogramApplications (2)
Use a derivative filter to highlight edges in an image:
DifferentiatorFilter[[image], Pi, 6]//ImageAdjustConvert a triangle wave to a square wave:
x = Table[TriangleWave[n / 32], {n, 0, 63}]//N;
y = DifferentiatorFilter[x, Pi, 6, Padding -> "Periodic"];GraphicsRow[{ListPlot[x, Filling -> 0, ImageSize -> Small], ListPlot[y, Filling -> 0, ImageSize -> Small]}]Properties & Relations (7)
Create a differentiator filter using LeastSquaresFilterKernel and a Hamming window:
n = 5;
ω = 1.5;
win = Array[HammingWindow, n, {-1 / 2, 1 / 2}];
ker = win LeastSquaresFilterKernel[{"Differentiator", ω}, n]ListConvolve[ker, {0, 0, 0, 0, 1, 1, 1, 1}, Ceiling[n / 2], 0]Compare with the result of DifferentiatorFilter:
DifferentiatorFilter[{0, 0, 0, 0, 1, 1, 1, 1}, ω, n, win, Padding -> 0]Impulse response of an odd-length, full-band derivative filter of length 21:
h = DifferentiatorFilter[ArrayPad[{1.}, 10], Pi, 21]ListPlot[h, PlotRange -> All, Filling -> 0]Magnitude spectrum of the filter:
Plot[Abs[ListFourierSequenceTransform[h, ω]], {ω, 0, π}]Magnitude spectrum of an odd-length, full-band derivative filter with no smoothing window:
Plot[Evaluate@Abs[ListFourierSequenceTransform[DifferentiatorFilter[ArrayPad[{1.}, 10], Pi, 21, None], ω]], {ω, 0, π}]Impulse response of an even-length derivative filter:
h = DifferentiatorFilter[ArrayPad[{1.}, 10], Pi, 20]ListPlot[h, PlotRange -> All, Filling -> 0]Magnitude spectrum of the filter:
Plot[Abs[ListFourierSequenceTransform[h, ω]], {ω, 0, π}, PlotRange -> All]Magnitude spectrum of an even-length, full-band derivative filter with no smoothing window:
Plot[Evaluate@Abs[ListFourierSequenceTransform[DifferentiatorFilter[ArrayPad[{1.}, 10], Pi, 20, None], ω]], {ω, 0, π}]Magnitude response of an odd-length differentiator filter for different filter lengths:
Manipulate[
ListLinePlot[Abs[Fourier[DifferentiatorFilter[ArrayPad[{1.}, 128], Pi, n], FourierParameters -> {1, -1}]][[ ;; 129]], ...], {{n, 21}, 3, 127, 2}]Impulse response of a half-band, odd-length derivative filter:
h = DifferentiatorFilter[ArrayPad[{1.}, 10], Pi / 2, 21]ListPlot[h, PlotRange -> All, Filling -> 0]Magnitude spectrum of the filter:
Plot[Abs[ListFourierSequenceTransform[h, ω]], {ω, 0, π}]History
Introduced in 2012 (9.0) | Updated in 2015 (10.2) ▪ 2016 (11.0) ▪ 2025 (14.3)
Text
Wolfram Research (2012), DifferentiatorFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/DifferentiatorFilter.html (updated 2025).
CMS
Wolfram Language. 2012. "DifferentiatorFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/DifferentiatorFilter.html.
APA
Wolfram Language. (2012). DifferentiatorFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DifferentiatorFilter.html
BibTeX
@misc{reference.wolfram_2026_differentiatorfilter, author="Wolfram Research", title="{DifferentiatorFilter}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/DifferentiatorFilter.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_differentiatorfilter, organization={Wolfram Research}, title={DifferentiatorFilter}, year={2025}, url={https://reference.wolfram.com/language/ref/DifferentiatorFilter.html}, note=[Accessed: 12-June-2026]}