%% Apply Hamming Window
% Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

win = dsp.Window( ...
    'WindowFunction','Hamming', ...
    'WeightsOutputPort',true);
x = rand(64,1);
[y,w] = win(x);

%
% View the window's time and frequency domain responses

wvtool(w)

% Copyright 2012 The MathWorks, Inc.