You are here : matlabSignal Processingwintool

wintool() - Signal Processing

wintool opens the Window
Design and Analysis Tool (WinTool), a graphical user interface (GUI)
for designing and analyzing spectral windows. It opens with a default
64-point Hamming window.Note  

A related tool, wvtool,
is available for displaying, annotating, or printing windows.
wintool has three panels:Window Viewer
displays the time domain and frequency domain representations of the
selected window(s). The currently active window is shown in bold.
Three window measurements are shown below the plots.Leakage factor — ratio of power in the sidelobes
to the total window powerRelative sidelobe attenuation — difference
in height from the mainlobe peak to the highest sidelobe peakMainlobe width (–3dB) — width of the
mainlobe at 3 dB below the mainlobe peakWindow List
lists the windows available for display in the Window Viewer. Highlight
one or more windows to display them. The Window List buttons are:Add a new window — Adds
a default Hamming window with length 64 and symmetric sampling. You
can change the information for this window by applying changes made
in the Current Window Information panel.Copy window — Copies
the selected window(s).Save to workspace —
Saves the selected window(s) as vector(s) to the MATLAB® workspace.
The name of the window in wintool is used as the
vector name.Delete — Removes the
selected window(s) from the window list.Current
Window Information displays information about the currently
active window. The active window name is shown in the Name field.
To make another window active, select its name from the Name menu. Window ParametersEach window is defined by the parameters in the Current Window
Information panel. You can change the current window's characteristics
by changing its parameters and clicking Apply.
The parameters of the current window areName — Name of the window.
The name is used for the legend in the Window Viewer, in the Window
List, and for the vector saved to the workspace. You can either select
a name from the menu or type the desired name in the edit box.Type — Algorithm for the
window. Select the type from the menu. All Signal Processing Toolbox™ windows
are available.MATLAB code — Any valid MATLAB expression
that returns a vector defining the window if Type = User Defined.Length — Number of samples.Parameter — Additional
parameter for windows that require it, such as Chebyshev, which requires
you to specify the sidelobe attenuation. Note that the title "Parameter"
changes to the appropriate parameter name.Sampling — Type of sampling
to use for generalized cosine windows (Hamming, Hann, and Blackman)
— Periodic or Symmetric. Periodic computes
a length n+1 window and returns the first n points,
and Symmetric computes and returns the n points
specified in Length.WinTool MenusIn addition to the usual menu items, wintool contains
these wintool-specific menu commands:File menu: Export — Exports
window coefficient vectors to the MATLAB workspace, a text file,
or a MAT-file.In the Window List in WinTool, highlight
the window(s) you want to export and then select File > Export. For exporting to the workspace or a MAT-file, specify
the variable name for each set of window coefficients. To overwrite
variables in the workspace, select the Overwrite variables check box.Full View Analysis — Copies
the windows shown in both plots to a separate wvtool figure
window. This is useful for printing and annotating. This option is
also available with the Full View Analysis toolbar button.View menu: Time domain — Select to
show the time domain plot in the Window Viewer panel.Frequency domain — Select
to show the frequency domain plot in the Window Viewer panel. Legend — Toggles the window
name legend on and off. This option is also available with the Legend
toolbar button.Analysis Parameters —
Controls the response plot parameters, including number of points,
range, x- and y-axis units,
sampling frequency, and normalized magnitude. You can also access the Analysis Parameters by right-clicking
the x-axis label of a plot in the Window Viewer
panel. The x-axis units for the time domain plot
depend on the selected Sampling Frequency units.Frequency DomainTime
Tools menu: Zoom In — Zooms in along
both x- and y-axes.Zoom X — Zooms in along
the x-axis only. Drag the mouse in the x direction
to select the zoom area.Zoom Y — Zooms in along
the y-axis only. Drag the mouse in the y direction
to select the zoom area.Full View — Returns to
full view.




Bohman Window
Use WinTool to specify a Bohman window of length
128 and export it to the workspace.
Create a Bohman window.From the Type list, select Bohman.Under Length, enter 128.Under Name, enter bohwin.Click Apply. The Window
Viewer box shows the window in the time and frequency domains.
Click Save to workspace. In the
command line, you see this message:bohwin has been exported to the workspace.Verify that the new window is present in the workspace.whos bohwin  Name          Size            Bytes  Class     Attributes

  bohwin      128x1              1024  doubleKaiser Windows
Use WinTool to see how the behavior of a Kaiser
window depends on the window length and the shape parameter, β.
Create a Kaiser window.From the Type list, select Kaiser.Under Length, enter 20.Under Beta, enter 0.Under Name, enter kaiser0.Click Apply. The Window
Viewer box shows the window in the time and frequency domains.Click Add a new window. Create
a Kaiser window of length 20 with Beta equal
to 3. Name the window kaiser3 and
click Apply.Click Copy window to create a third
Kaiser window, kaiser6, with Beta equal
to 6. Click Apply.Under Window List select the three
Select kaiser0 from the Name list
to emphasize it in the Window Viewer plots. Set Length to 10 and Beta to 6.
Click Apply.Select kaiser3 from the Name list.
Leave Length set to 20 and
set Beta to 6. Click Apply.Select kaiser6 from the Name list.
Leave Beta set to 6 and set Length to 40.
Click Apply.Select kaiser3 from the Name list.
Click the Turn Legend On button 
Hamming Window Sidelobes
Use WinTool to visualize the sidelobes of the
default 64-sample Hamming window.
In the View menu, clear Time
domain and click Analysis Parameters.In the dialog box, specify these parameters:Under Number of points, enter 8192.Set Frequency Units to Hz.Set Sampling Frequency to 500 HzSelect Normalize Magnitude.
Click OK to close the dialog box.
Click the Zoom X-Axis button 
. Zoom into the region
between 10 Hz and 35 Hz to view
the window's first two sidelobes in detail.

Output / Return Value


Alternatives / See Also