Contents

vDSP_hann_windowD

Creates a double-precision Hann window.

Declaration

extern void vDSP_hann_windowD(double *__C, vDSP_Length __N, int __Flag);

Parameters

  • __C:

    The output vector.

  • __N:

    The number of elements in the output vector.

  • __Flag:

    A value that specifies the type of window that the function creates.

Discussion

The vDSP_hann_window and vDSP_hann_windowD functions create a Hann window vector using the following operation:

If Flag & vDSP_HALF_WINDOW:
    Length = (N+1)/2;
Else
    Length = N;

If Flag & vDSP_HANN_NORM:
    W = .8165;
Else
    W = .5;

for (n = 0; n < Length; ++n)
    C[n] = W * (1 - cos(2*pi*n/N));

Use vDSP_vmulD to multiply the Hann window result by a noninteger-periodic signal prior to a Fourier transform.

The following code shows how to generate a Hann window:

let n = vDSP_Length(1024)
var c = [Double](repeating: 0,
                 count: Int(n))

vDSP_hann_windowD(&c,
                  n,
                  Int32(vDSP_HANN_DENORM))

The following illustrates the values of the output vector, c:

[Image]

See Also

Vector generation with window functions