Documentation |
Package: dsp
Window object
The Window object applies a window to an input signal.
To apply a window to an input signal:
Define and set up your window. See Construction.
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.
WindowFunction |
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. |
WeightsOutputPort |
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. |
StopbandAttenuation |
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. |
Beta |
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. |
NumConstantSidelobes |
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. |
MaximumSidelobeLevel |
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. |
Sampling |
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. |
clone | Create window object with same property values |
getNumInputs | Number of expected inputs to step method |
getNumOutputs | Number of outputs of step method |
isLocked | Locked status for input attributes and nontunable properties |
release | Allow property value and input characteristics changes |
step | Multiply input by window |
Apply Hamming window to input signal:
hwin = dsp.Window( ... 'WindowFunction', 'Hamming', ... 'WeightsOutputPort',true); x = rand(64,1); [y, w] = step(hwin, x); % View the window's time and frequency domain responses wvtool(w);
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.
dsp.FFT | sigwin.bartlett | sigwin.blackman | sigwin.chebwin | sigwin.hamming | sigwin.hann | sigwin.kaiser | sigwin.taylorwin | sigwin.triang | wvtool