dsp.Window System object

Package: dsp

Window object


The Window object applies a window to an input signal.

To apply a window to an input signal:

  1. Define and set up your window. See Construction.

  2. Call step to apply the window according to the properties of dsp.Window. The behavior of step is specific to each object in the toolbox.


H = dsp.Window returns a window object, H, that applies a Hamming window with symmetric sampling.

H = dsp.Window('PropertyName',PropertyValue, ...) returns a window object, H, with each property set to the specified value.

H = dsp.Window(WINDOW,'PropertyName',PropertyValue, ...) returns a window object, H, with the WindowFunction property set to WINDOW and other properties set to the specified values.



Type of window

Specify the type of window to apply as Bartlett, Blackman, Boxcar, Chebyshev, Hamming , Hann, Hanning, Kaiser, Taylor, Triang. This property is tunable. The default is Hamming.


Enable the output of window weights

Set this property to true to output the window weights. The weights are an M-by-1 vector with M equal to the first dimension of the input. The default is false.


Level of stopband attenuation in decibels

Specify the level of stopband attenuation in decibels. This property only applies when the WindowFunction property is Chebyshev. The default is 50. This property is tunable.


Kaiser window parameter

Specify the Kaiser window parameter as a real number. Increasing the absolute value of Beta widens the mainlobe and decreases the amplitude of the window sidelobes in the window's frequency magnitude response. This property only applies when WindowFunction property is Kaiser. The default is 10. This property is tunable.


Number of constant sidelobes

Specify the number of constant sidelobes as an integer greater than zero. This property only applies when WindowFunction property is Taylor. The default is 4. This property is tunable.


Maximum sidelobe level relative to mainlobe

Specify, in decibels, the maximum sidelobe level relative to the mainlobe as a real number less than or equal to zero. The default is –30, which produces sidelobes with peaks 30 dB down from the mainlobe peak. This property only applies when WindowFunction property is Taylor. This property is tunable.


Window sampling for generalized-cosine windows

Specify the window sampling for generalized-cosine windows as Symmetric or Periodic. This property only applies when WindowFunction property is Blackman, Hamming, Hann, or Hanning. This property is tunable.

 Fixed-Point Properties


cloneCreate window object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
stepMultiply input by window


Apply Hamming window to input signal:

  hwin = dsp.Window( ...
 'WindowFunction', 'Hamming', ...
  x = rand(64,1);
 [y, w] = step(hwin, x);
 % View the window's time and frequency domain responses 


This object implements the algorithm, inputs, and outputs described on the Window Function block reference page. The object properties correspond to the block parameters, except:

  • Operation — The window object does not support the Generate window option.

  • Operation — The Generate and apply window option on the block corresponds to the WeightsOutputPort property set to true on the window object.

  • The window object only supports frame-based processing.

Was this topic helpful?