Main Content

barthannwin

Modified Bartlett-Hann window

Description

w = barthannwin(L) returns an L-point modified Bartlett-Hann window.

example

w = barthannwin(L,typeName) specifies the option to return the window w with single or double precision.

Examples

collapse all

Create a 64-point Bartlett-Hann window. Display the result using wvtool.

L = 64;
wvtool(barthannwin(L))

Figure Window Visualization Tool contains 2 axes objects and other objects of type uimenu, uitoolbar, uipanel. Axes object 1 with title Time domain, xlabel Samples, ylabel Amplitude contains an object of type line. Axes object 2 with title Frequency domain, xlabel Normalized Frequency (\times\pi rad/sample), ylabel Magnitude (dB) contains an object of type line.

Input Arguments

collapse all

Window length, specified as a positive integer.

Note

If you specify L as noninteger, the function rounds it to the nearest integer value.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Since R2024b

Output data type (class), specified as one of these:

  • "double" — Use this option to return a double-precision output w.

  • "single" — Use this option to return a single-precision output w.

Data Types: char | string

Output Arguments

collapse all

Modified Bartlett-Hann window, returned as a column vector of length L.

Algorithms

The equation for computing the coefficients of a Modified Bartlett-Hanning window is

w(n)=0.620.48|(nN0.5)|+0.38cos(2π(nN0.5))

where 0nN and the window length is L=N+1.

Like Bartlett, Hann, and Hamming windows, this window has a mainlobe at the origin and asymptotically decaying sidelobes on both sides. It is a linear combination of weighted Bartlett and Hann windows with near sidelobes lower than both Bartlett and Hann and with far sidelobes lower than both Bartlett and Hamming windows. The mainlobe width of the modified Bartlett-Hann window is not increased relative to either Bartlett or Hann window mainlobes.

References

[1] Ha, Y. H., and J. A. Pearce. “A New Window and Comparison to Standard Windows.” IEEE® Transactions on Acoustics, Speech, and Signal Processing. Vol. 37, Number 2, 1999, pp. 298–301.

[2] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1999, p. 468.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

expand all