imat_fn/window


Purpose

Create a window function.

Syntax

g=window(imat_fn,'hanning',8192)
g=window(imat_fn,'exponential',1024,0.2)
g=window(F,TYPE,L,ARGS)

Description

WINDOW creates a window function based on the type of window specified in the string TYPE. F must be an imat_fn. It can be an empty imat_fn. If F is not empty, WINDOW will extract the AbscissaMin and AbscissaInc attributes from the first function in F, provided that it is evenly spaced. L is the length of the window in samples.

Some of the windows have additional optional or required arguments. These are described in more detail below.

Several window types are supported. Some of these are built-in, and some require the Signal Processing Toolbox. The built-in windows are described here. For a list of the windows provided by the Signal Processing toolbox, see the help for the function WINDOW provided by that toolbox.

TYPE DESCRIPTION
'hanning' Hann window, sin(pt/T)2
'hamming' Hamming window, 0.54-0.46*cos(2pt/T))
'halfsine' Half sine window, sin(pt/T)
'flattop' Flattop window.  Almost identical to 'flattopwin' from the Signal Processing toolbox. Equation fromhttp://zone.ni.com/reference/en-XX/help/371361A-01/lvanlsconcepts/char_smoothing_windows/
'exponential' Exponential decay window. One additional required input argument, DECAY. This specifies the amplitude fraction at the 50% point of the window. For example, to set the window amplitude to be 30% at the halfway point, set DECAY=0.3.
'impact' Impact window. It is set to 1 at the beginning of the window and zero everywhere past the fraction of the window specified by the required input argument FRAC. FRAC should be between 0.0 and 1.0.

Examples

>> w=window(imat_fn,'hanning',8192)

w =

1x1 IMAT Function with the following attributes:

Record Name         FunctionType     AbscissaSpacing  NumberElements
------------------- ---------------- ---------------- ----------------
1_(1X+,1X+)         Time Response    Even             8192            

>> w.idline1

ans =

'Window: 'hanning', 8192 points'

>>

See Also

imat_fn/csd, imat_fn/psd