Main Content

blackmanharris

Minimum four-term Blackman-Harris window

Description

w = blackmanharris(L) returns an L-point symmetric four-term Blackman-Harris window.

example

w = blackmanharris(L,sflag) returns a Blackman-Harris window using the window sampling method specified by sflag.

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

Examples

collapse all

Create a 32-point symmetric Blackman-Harris window. Display the result using wvtool.

L = 32;
wvtool(blackmanharris(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

Window sampling method, specified as:

  • "symmetric" — Use this option when using windows for filter design.

  • "periodic" — This option is useful for spectral analysis because it enables a windowed signal to have the perfect periodic extension implicit in the discrete Fourier transform. When 'periodic' is specified, the function computes a window of length L + 1 and returns the first L points.

Data Types: char | string

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

Blackman-Harris window, returned as a column vector.

Algorithms

The equation for the symmetric four-term Blackman-Harris window of length N is

w(n)=a0a1cos(2πnN1)+a2cos(4πnN1)a3cos(6πnN1),0nN1

The equation for the periodic four-term Blackman-Harris window of length N is

w(n)=a0a1cos2πnN+a2cos4πnNa3cos6πnN,0nN1

The periodic window is N-periodic.

CoefficientValue
a00.35875
a10.48829
a20.14128
a30.01168

References

[1] harris, fredric j. “On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform.” Proceedings of the IEEE®. Vol. 66, January 1978, pp. 51–83.

Extended Capabilities

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

Version History

Introduced before R2006a

expand all