Main Content

sigwin.blackmanharris Class

Namespace: sigwin

Construct Blackman-Harris window object

Description

Note

The use of sigwin.blackmanharris is not recommended. Use blackmanharris instead.

sigwin.blackmanharris creates a handle to a Blackman-Harris window object for use in spectral analysis and FIR filtering by the window method. Object methods enable workspace import and ASCII file export of the window values.

The following equation defines the symmetric Blackman-Harris window of length N:

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

The following equation defines the periodic Blackman-Harris window of length N:

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

The following table lists the coefficients:

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

Construction

H = sigwin.blackmanharris returns a Blackman-Harris window object H of length 64.

H = sigwin.blackmanharris(Length) returns a Blackman-Harris window object H of length Length. Length must be a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer. Entering a 1 for Length results in a window with a single value of 1.

Properties

Length

Blackman-Harris window length. The window length requires a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer. Entering a 1 for Length results in a window with a single value of 1.

SamplingFlag

The type of window returned as one of 'symmetric' or 'periodic'. The default is 'symmetric'. A symmetric window exhibits perfect symmetry between halves of the window. Setting the SamplingFlag property to 'periodic' results in a N-periodic window. The equations for the Blackman-Harris window differ slightly based on the value of the SamplingFlag property. See Description for details.

Methods

generateGenerates Blackman–Harris window
infoDisplay information about Blackman–Harris window object
winwriteSave Blackman–Harris window in ASCII file

Copy Semantics

Handle. To learn how copy semantics affect your use of the class, see Copying Objects in the MATLAB® Programming Fundamentals documentation.

Examples

collapse all

Generate a Blackman-Harris window of length N = 16. Return its values as a column vector. Show information about the window object. Display the window.

H = sigwin.blackmanharris(16);

win = generate(H)
win = 16×1

    0.0001
    0.0036
    0.0267
    0.1030
    0.2680
    0.5206
    0.7938
    0.9749
    0.9749
    0.7938
      ⋮

wininfo = info(H)
wininfo = 4x26 char array
    'Blackman-Harris Window    '
    '----------------------    '
    'Length         : 16       '
    'Sampling Flag  : symmetric'

wvtool(H)

References

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.