barthannwin

Bartlett-Hann window.

Syntax

w = barthannwin(n)

w = barthannwin(n,type)

Inputs

n
Length of the barthannwin window.
Type: integer
Dimension: scalar
type
Type of the window.
Type: string ('symmetric' (default) or 'periodic')

Outputs

w
Window coefficients.

Examples

Symmetric barthannwin example:

w = barthannwin(6,'symmetric')
w = [Matrix] 6 x 1
0.00000
0.35857
0.87943
0.87943
0.35857
0.00000
Periodic barthannwin example:
w = barthannwin(5,'periodic')
w = [Matrix] 5 x 1
0.00000
0.35857
0.87943
0.87943
0.35857

Comments

The window type depends on the application. If the window is used to pre-process data for an FFT, then the type should be 'periodic'. If the window is used to design an FIR filter, then the type should be 'symmetric'. The difference is that the periodic window omits the right endpoint so that consecutively positioned windows are not duplicating the right endpoint of the first window at the left endpoint of the second window. The two endpoints of the symmetric window have equal values.