---
title: "HighpassFilter"
language: "en"
type: "Symbol"
summary: "HighpassFilter[data, \\[Omega]c] applies a highpass filter with a cutoff frequency \\[Omega]c to an array of data. HighpassFilter[data, \\[Omega]c, n] uses a filter kernel of length n. HighpassFilter[data, \\[Omega]c, n, wfun] applies a smoothing window wfun to the filter kernel."
keywords: 
- highpass filter
- high pass
- high-pass
- low-cut
- low-cut filter
- cutoff frequency
- image filter
- data filter
- sound filtering
- sound highpass filter
canonical_url: "https://reference.wolfram.com/language/ref/HighpassFilter.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Linear and Nonlinear Filters"
    link: "https://reference.wolfram.com/language/guide/LinearAndNonlinearFilters.en.md"
  - 
    title: "Image Filtering & Neighborhood Processing"
    link: "https://reference.wolfram.com/language/guide/ImageFilteringAndNeighborhoodProcessing.en.md"
  - 
    title: "Time Series Processing"
    link: "https://reference.wolfram.com/language/guide/TimeSeries.en.md"
  - 
    title: "Signal Filtering & Filter Design"
    link: "https://reference.wolfram.com/language/guide/SignalFilteringAndFilterDesign.en.md"
  - 
    title: "Video Computation: Update History"
    link: "https://reference.wolfram.com/language/guide/VideoComputation-UpdateHistory.en.md"
related_functions: 
  - 
    title: "LowpassFilter"
    link: "https://reference.wolfram.com/language/ref/LowpassFilter.en.md"
  - 
    title: "LeastSquaresFilterKernel"
    link: "https://reference.wolfram.com/language/ref/LeastSquaresFilterKernel.en.md"
  - 
    title: "ListConvolve"
    link: "https://reference.wolfram.com/language/ref/ListConvolve.en.md"
  - 
    title: "ImageConvolve"
    link: "https://reference.wolfram.com/language/ref/ImageConvolve.en.md"
---
# HighpassFilter

HighpassFilter[data, ωc] applies a highpass filter with a cutoff frequency ωc to an array of data.

HighpassFilter[data, ωc, n] uses a filter kernel of length n.

HighpassFilter[data, ωc, n, wfun] applies a smoothing window wfun to the filter kernel.

## Details and Options

* Highpass filtering is typically used to diminish a signal's low-frequency content while preserving the high frequencies.

* ``HighpassFilter`` convolves a digital signal with a finite impulse response (FIR) kernel created using the window method.

[image]

* Larger cutoff frequencies result in greater loss of low frequencies. Longer kernels result in a better frequency discrimination.

* 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. ``HighpassFilter[data, {ωc1, ωc2, …}]`` uses the frequency ``ωc*i*`` for the $i$$$^{\text{th}}$$ dimension.

* ``HighpassFilter[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 $-1/2$ and $1/2$ |

* 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 lists. For audio signals and time series, the sample rate is either extracted or computed from the input data.

* With ``SampleRate -> sr``, the cutoff frequency ``ωc`` should be between 0 and ``sr``×$\pi$.

---

## Examples (32)

### Basic Examples (3)

Highpass filtering of a sinusoidal sequence:

```wl
In[1]:=
data = Table[Cos[2x] + 0.5Cos[20x], {x, 0, 2Pi, 0.04}];
ListLinePlot[{data, HighpassFilter[data, 0.6, 21]}, PlotLegends -> {"original", "filtered"}]

Out[1]= [image]
```

---

Highpass filtering of an ``Audio`` object:

```wl
In[1]:= HighpassFilter[\!\(\*AudioBox["![Embedded Audio Player](audio://content-1323j)"]\), Quantity[1000, "Hertz"]]

Out[1]= \!\(\*AudioBox["![Embedded Audio Player](audio://content-o1h9w)"]\)
```

---

Highpass filtering of an image:

```wl
In[1]:= HighpassFilter[[image], 1., 21]//ImageAdjust

Out[1]= [image]
```

### Scope (14)

#### Data (9)

Filter a 1D pulse sequence:

```wl
In[1]:=
data = BoxMatrix[5, {41}];
ListLinePlot[{data, HighpassFilter[data, 1.]}, PlotRange -> All]

Out[1]= [image]
```

---

Filter a 2D pulse sequence:

```wl
In[1]:=
data = Table[UnitBox[(n/7), (m/7)], {n, -7, 7}, {m, -7, 7}];
ListPlot3D[data]

Out[1]= [image]

In[2]:= HighpassFilter[data, 1.]//ListPlot3D

Out[2]= [image]
```

---

Filter a ``TimeSeries`` :

```wl
In[1]:=
ts = TemporalData[TimeSeries, {CompressedData["«1188»"], {{0, 1., 0.01}}, 1, {"Continuous", 1}, {"Continuous", 1}, 1, 
  {ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, False, 
 10.1];
filtered = HighpassFilter[ts, Quantity[5, "Hertz"]];

In[2]:= ListLinePlot[{ts, filtered}, PlotLegends -> {"original", "filtered"}, PlotRange -> All]

Out[2]= [image]
```

---

Highpass filtering of a swept-sine audio signal:

```wl
In[1]:= a = AudioGenerator[Sin[5000. π#^2 + 1000. #]&]

Out[1]= \!\(\*AudioBox["![Embedded Audio Player](audio://content-ed7zj)"]\)

In[2]:= HighpassFilter[a, Quantity[2500, "Hertz"], 101, BlackmanWindow]

Out[2]= \!\(\*AudioBox["![Embedded Audio Player](audio://content-5kmp7)"]\)
```

---

Highpass filtering of a ``Sound`` object of a dual-tone multi-frequency (DTMF) signal:

```wl
In[1]:= snd = Sound[SampledSoundList[Table[Sin[2 π 697 t] + Sin[2 π 1209 t], {t, 0., 0.3, 1 / 8000.}], 8000]]

Out[1]= Sound[SampledSoundList[CompressedData["«24012»"], 8000]]
```

Use a cutoff frequency midway between the two frequencies, a filter of length 101 and a Blackman window:

```wl
In[2]:= HighpassFilter[snd, Quantity[953, "Hertz"], 101, BlackmanWindow]

Out[2]= Sound[SampledSoundList[CompressedData["«13852»"], 8000], SoundVolume -> 1]
```

---

Highpass filtering of a halftone image:

```wl
In[1]:= HighpassFilter[[image], 0.5]//ImageAdjust

Out[1]= [image]
```

---

Filter video frames:

```wl
In[1]:= HighpassFilter[Video["ExampleData/fish.mp4"], .5]

Out[1]= \!\(\*VideoBox["![Embedded Video Player](video://content-wpih0)"]\)
```

---

Highpass filtering of a 3D image:

```wl
In[1]:= HighpassFilter[[image], 0.5]

Out[1]= [image]
```

---

Filter using exact precision:

```wl
In[1]:= HighpassFilter[{0, 0, 0, 1, 1, 1, 0, 0, 0}, Pi / 2, 3]

Out[1]= {0, 0, -(2/23 π), (1/2) - (2/23 π), (1/2) - (4/23 π), (1/2) - (2/23 π), -(2/23 π), 0, 0}
```

#### Parameters (5)

With an audio signal, a numeric cutoff frequency is interpreted as radians per second:

```wl
In[1]:=
a = \!\(\*AudioBox["![Embedded Audio Player](audio://content-iz4x8)"]\);
HighpassFilter[a, 1000 2 Pi] === HighpassFilter[a, Quantity[1000*2*Pi, "Radians"/"Seconds"]] === HighpassFilter[a, Quantity[1000, "Hertz"]]

Out[1]= True
```

---

Filter a white noise signal using a cutoff frequency of 15000 Hz:

```wl
In[1]:=
noise = AudioGenerator["White", 0.2];
Periodogram[noise]

Out[1]= [image]

In[2]:= Periodogram[HighpassFilter[noise, Quantity[15000, "Hertz"]]]

Out[2]= [image]
```

Use a lower-frequency value:

```wl
In[3]:= Periodogram[HighpassFilter[noise, Quantity[10000, "Hertz"]]]

Out[3]= [image]
```

---

By default, the length of the filter and therefore its frequency discrimination depend on the cutoff frequency:

```wl
In[1]:=
noise = AudioGenerator["White", 0.2];
Periodogram[HighpassFilter[noise, Quantity[18000, "Hertz"]]]

Out[1]= [image]
```

Shorter filter kernels are used for lower frequencies:

```wl
In[2]:= Periodogram[HighpassFilter[noise, Quantity[15000, "Hertz"]]]

Out[2]= [image]
```

Increase frequency discrimination by using a longer kernel:

```wl
In[3]:= Periodogram[HighpassFilter[noise, Quantity[15000, "Hertz"], 55]]

Out[3]= [image]
```

---

Vary the amount of stopband attenuation by using different window functions:

```wl
In[1]:=
a = AudioGenerator[Sin[11025 2 π  #^2]&];
Periodogram[HighpassFilter[a, Quantity[15000, "Hertz"], 33, #]& /@ {DirichletWindow, HammingWindow, BlackmanWindow}, PlotLegends -> {"Dirichlet", "Hamming", "Hann"}]

Out[1]= [image]
```

Vary the amount of attenuation by using the adjustable Kaiser window:

```wl
In[2]:= Periodogram[Table[HighpassFilter[a, Quantity[15000, "Hertz"], 33, KaiserWindow[#, b]&], {b, {3, 5, 7}}], PlotLegends -> {3, 5, 7}]

Out[2]= [image]
```

Specify the window function as a numeric list:

```wl
In[3]:= Periodogram[HighpassFilter[a, Quantity[15000, "Hertz"], 33, ConstantArray[1, {33}]]]

Out[3]= [image]
```

---

Use different cutoff frequencies in each dimension:

```wl
In[1]:= HighpassFilter[[image], {1., 1.75}]//ImageAdjust

Out[1]= [image]
```

### Options (3)

#### Padding (1)

Different padding methods result in different edge effects:

```wl
In[1]:=
ramp = Range[21] / 21. + RandomReal[.1, 21];
GraphicsRow@(ListLinePlot[{ramp, HighpassFilter[ramp, 0.5, Padding -> #]}, ...]& /@ {"Fixed", "Periodic", 0})

Out[1]= [image]
```

#### SampleRate (2)

Use a highpass half-band filter of length 5, assuming a normalized sample rate of ``sr = 1`` :

```wl
In[1]:= HighpassFilter[{0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, π / 2., 5]

Out[1]= {0., 0., 0., -1.6948573184866838`*^-18, -0.172995, 0.327005, 0.154011, 0.154011, 0.154011, 0.154011}
```

Assume a sample rate of ``sr = 3`` :

```wl
In[2]:= HighpassFilter[{0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, 3 π / 2., 5, SampleRate -> 3]

Out[2]= {0., 0., 0., -1.6948573184866838`*^-18, -0.172995, 0.327005, 0.154011, 0.154011, 0.154011, 0.154011}
```

---

Apply a half-band highpass filter to audio sampled at a rate of $44100\text{Hz}$ :

```wl
In[1]:=
noise = AudioGenerator["White", 0.2];
sr = QuantityMagnitude@AudioSampleRate[noise]

Out[1]= 44100

In[2]:= HighpassFilter[noise, sr π / 2., 21]//Periodogram

Out[2]= [image]
```

### Applications (3)

Reduce the zero-frequency component in a periodic sequence:

```wl
In[1]:=
x = Table[SawtoothWave[n / 8], {n, 0, 63}];
y = HighpassFilter[x, Pi / 16, 21, None, Padding -> "Periodic"];
GraphicsRow[{ListPlot[x, Filling -> 0], ListPlot[y, Filling -> 0]}]

Out[1]= [image]
```

---

Use ``HighpassFilter`` to make an ``Audio`` object sound "thinner":

```wl
In[1]:= cello = \!\(\*AudioBox["![Embedded Audio Player](audio://content-8satj)"]\);

In[2]:= HighpassFilter[cello, Quantity[800, "Hertz"]]

Out[2]= \!\(\*AudioBox["![Embedded Audio Player](audio://content-o01r1)"]\)
```

---

On a modern 88-key piano, key 55 (note ``C5``) has a fundamental frequency of approximately 523 Hz. Use ``HighpassFilter`` to effectively remove the fundamental and retain all the harmonics of this key in the following audio clip:

```wl
In[1]:= key55 = \!\(\*AudioBox["![Embedded Audio Player](audio://content-sglcp)"]\);
```

Use a highpass filter of length 59 with a cutoff frequency midway between the fundamental (523 Hz) and its first harmonic at 1046 Hz:

```wl
In[2]:=
f = 1.5 523;
res = HighpassFilter[key55, 2 π f, 59]

Out[2]= \!\(\*AudioBox["![Embedded Audio Player](audio://content-42csh)"]\)
```

Compare the frequency spectra of the two audio clips:

```wl
In[3]:= Periodogram[{key55, res}, ...]

Out[3]= [image]
```

### Properties & Relations (8)

Using a cutoff frequency of ``0`` returns the original sequence:

```wl
In[1]:= HighpassFilter[{0, 0, 0, 0, 1, 1, 1, 1}, 0]

Out[1]= {0, 0, 0, 0, 1, 1, 1, 1}
```

---

Using cutoff frequency of ``π`` or greater returns a zero sequence:

```wl
In[1]:= HighpassFilter[{0, 0, 0, 0, 1, 1, 1, 1}, Pi]

Out[1]= {0, 0, 0, 0, 0, 0, 0, 0}
```

---

Create a highpass filter using ``LeastSquaresFilterKernel`` and ``HammingWindow`` :

```wl
In[1]:=
n = 5;
ω = 1.;
win = Array[HammingWindow, n, {-1 / 2, 1 / 2}];
ker = win LeastSquaresFilterKernel[{"Highpass", ω}, n]

Out[1]= {-0.0125843, -0.14557, 0.68169, -0.14557, -0.0125843}

In[2]:= ListConvolve[ker, {0, 0, 0, 0, 1, 1, 1, 1}, Ceiling[n / 2], 0]

Out[2]= {0., 0., -0.0125843, -0.158154, 0.523536, 0.377966, 0.377966, 0.523536}
```

Compare with the result of ``HighpassFilter`` :

```wl
In[3]:= HighpassFilter[{0, 0, 0, 0, 1, 1, 1, 1}, ω, n, win, Padding -> 0]

Out[3]= {0., 0., -0.0125843, -0.158154, 0.523536, 0.377966, 0.377966, 0.523536}
```

---

Impulse response of a half-band highpass filter of length 21:

```wl
In[1]:= h = HighpassFilter[ArrayPad[{1}, 10], Pi / 2., 21]

Out[1]= {-2.372800245881358`*^-18, -0.00386571, 5.091336417952884`*^-18, 0.0125115, -1.0457632986217073`*^-17, -0.0345989, 2.001373761213114`*^-17, 0.0861362, -1.7791492202448308`*^-17, -0.311198, 0.5, -0.311198, -1.7791492202448305`*^-17, 0.0861362, 2.001373761213113`*^-17, -0.0345989, -1.045763298621707`*^-17, 0.0125115, 5.091336417952884`*^-18, -0.00386571, -2.372800245881358`*^-18}

In[2]:= ListPlot[h, PlotRange -> All, Filling -> 0]

Out[2]= [image]
```

Magnitude spectrum of the filter:

```wl
In[3]:= Plot[Abs[ListFourierSequenceTransform[h, ω]], {ω, 0, π}]

Out[3]= [image]
```

---

Impulse response of a half-band highpass filter of length 21 without a smoothing window:

```wl
In[1]:= h = HighpassFilter[ArrayPad[{1}, 10], π / 2., 21, None]

Out[1]= {-2.7287202827635634`*^-17, -0.0353678, 2.923628874389532`*^-17, 0.0454728, -2.598781221679584`*^-17, -0.063662, 2.923628874389532`*^-17, 0.106103, -1.9490859162596877`*^-17, -0.31831, 0.5, -0.31831, -1.9490859162596877`*^-17, 0.106103, 2.923628874389532`*^-17, -0.063662, -2.598781221679584`*^-17, 0.0454728, 2.923628874389532`*^-17, -0.0353678, -2.7287202827635634`*^-17}

In[2]:= ListPlot[h, PlotRange -> All, Filling -> 0]

Out[2]= [image]
```

Magnitude spectrum of the filter:

```wl
In[3]:= Plot[Abs[ListFourierSequenceTransform[h, ω]], {ω, 0, π}]

Out[3]= [image]
```

---

Impulse response of an even-length filter:

```wl
In[1]:= h = HighpassFilter[ArrayPad[{1}, 10], π / 2., 20, None]

Out[1]= {0., -0.0571988, 0.0109683, -0.0124308, 0.0835983, -0.098798, 0.020718, -0.0266374, 0.217356, -0.362259, 0.186462, 0.186462, -0.362259, 0.217356, -0.0266374, 0.020718, -0.098798, 0.0835983, -0.0124308, 0.0109683, -0.0571988}

In[2]:= ListPlot[h, PlotRange -> All, Filling -> 0]

Out[2]= [image]
```

Magnitude spectrum of the filter:

```wl
In[3]:= Plot[Abs[ListFourierSequenceTransform[h, ω]], {ω, 0, π}]

Out[3]= [image]
```

---

The frequency discrimination of a highpass filter improves as the length of the filter is increased:

```wl
In[1]:=
Manipulate[
	ListLinePlot[Abs[Fourier[HighpassFilter[ArrayPad[{1.}, 128], Pi / 2, n, DirichletWindow], FourierParameters -> {1, -1}]][[ ;; 129]], ...], {{n, 21}, 3, 63, 2}]

Out[1]= DynamicModule[«8»]
```

---

The length of the impulse response increases as the bandwidth of the filter is decreased:

In[1]:= Manipulate[ListPlot[x=DeleteCases[HighpassFilter[ArrayPad[{1.},65],\[Omega],Padding->None],0.],],{{\[Omega],2.5,"Subscript[\[Omega], c]"},2.,3.}]

Out[1]=
Manipulate[ListPlot[x = DeleteCases[HighpassFilter[ArrayPad[{1.}, 65], \[Omega], 
      Padding -> None], 0.], Sequence[PlotRange -> {{0, Length[x] + 1}, 
      Automatic}, Filling -> 0, Axes -> {True, False}, Ticks -> None]], 
  {{\[Omega], 2.5, "\!\(\*SubscriptBox[\(\[Omega]\), \(c\)]\)"}, 2., 3.}]

### Possible Issues (1)

Using ``Padding -> None`` will result in an output that is shorter in length than the input:

```wl
In[1]:= HighpassFilter[{0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, 1., Padding -> None]

Out[1]= {-0.308753, 0.372937}
```

Using kernels longer than the input will result in an empty list:

```wl
In[2]:= HighpassFilter[{0, 0, 0, 1, 0, 0, 0}, 1., 11, Padding -> None]

Out[2]= {}
```

## See Also

* [`LowpassFilter`](https://reference.wolfram.com/language/ref/LowpassFilter.en.md)
* [`LeastSquaresFilterKernel`](https://reference.wolfram.com/language/ref/LeastSquaresFilterKernel.en.md)
* [`ListConvolve`](https://reference.wolfram.com/language/ref/ListConvolve.en.md)
* [`ImageConvolve`](https://reference.wolfram.com/language/ref/ImageConvolve.en.md)

## Related Guides

* [Linear and Nonlinear Filters](https://reference.wolfram.com/language/guide/LinearAndNonlinearFilters.en.md)
* [Image Filtering & Neighborhood Processing](https://reference.wolfram.com/language/guide/ImageFilteringAndNeighborhoodProcessing.en.md)
* [Time Series Processing](https://reference.wolfram.com/language/guide/TimeSeries.en.md)
* [Signal Filtering & Filter Design](https://reference.wolfram.com/language/guide/SignalFilteringAndFilterDesign.en.md)
* [Video Computation: Update History](https://reference.wolfram.com/language/guide/VideoComputation-UpdateHistory.en.md)

## History

* [Introduced in 2012 (9.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn90.en.md) \| [Updated in 2015 (10.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn102.en.md) ▪ [2016 (11.0)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn110.en.md) ▪ [2025 (14.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn143.en.md)