applies a bandstop filter with cutoff frequencies ω1 and ω2 to an array of data.


uses center frequency ω and quality factor q.


uses a filter kernel of length n.


applies a smoothing window wfun to the filter kernel.

Details and Options

  • BandstopFilter is used to attenuate mid-range frequencies in a signal while leaving the low and high frequencies unchanged. The range of frequencies that are attenuated is dependent on the values of the cutoff frequencies ω1 and ω2, with ω2>ω1. Bandstop filters are commonly found in audio amplifiers for acoustic instruments, hearing aids and public address systems.
  • The data can be any of the following:
  • listarbitrary-rank numerical array
    tseriestemporal data such as TimeSeries and TemporalData
    imagearbitrary Image or Image3D object
    audioan Audio or Sound object
  • When applied to images and multidimensional arrays, filtering is applied successively to each dimension starting at level 1. BandstopFilter[data,{{ω11,ω21},}] uses the frequency {ω1i,ω2i} for the i^(th) dimension.
  • The frequency values ωi should be between 0 and .
  • BandstopFilter[data,{ω1,ω2}] uses a filter kernel length and smoothing window suitable for the cutoff frequencies {ω1,ω2} and the input data.
  • Typical smoothing windows wfun include:
  • BlackmanWindowsmoothing with a Blackman window
    DirichletWindowno smoothing
    HammingWindowsmoothing with a Hamming window
    {v1,v2,}use a window with values vi
    fcreate a window by sampling f between and
  • The following options can be given:
  • Padding"Fixed"the padding value to use
    SampleRateAutomaticsample 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×.


open all close all

Basic Examples  (3)

Bandstop filtering of a vector:

Click for copyable input

Bandstop filtering of audio:

Click for copyable input

Bandstop filtering of an image:

Click for copyable input

Scope  (12)

Options  (3)

Properties & Relations  (3)

Possible Issues  (1)

Introduced in 2012
Updated in 2016