Function

vDSP_blkman_windowD(_:_:_:)

Creates a double-precision Blackman window.

Declaration

func vDSP_blkman_windowD(_ __C: UnsafeMutablePointer<Double>, _ __N: vDSP_Length, _ __Flag: Int32)

Parameters

__C

Double-precision real output vector.

__N

The desired window length.

__Flag

Pass the vDSP_HALF_WINDOW flag to create only the first (n+1)/2 points, or zero for a full-size window.

Discussion

The vDSP_blkman_window(_:_:_:) and vDSP_blkman_windowD(_:_:_:) functions create a Blackman window vector, and write the result to C, which can be multiplied by a vector using vDSP_vmul.

for (n=0; n < N; ++n)
{
    C[n] = 0.42 - (0.5 * cos(  2 * pi * n / N ) ) +
             (0.08 * cos( 4 * pi * n / N) );
}

The following code shows how to generate a Blackman window.

let n = vDSP_Length(1024)

var c = [Float](repeating: 0,
                count: Int(n))

vDSP_blkman_window(&c,
                   n,
                   0)

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

Visualization of Blackman window.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software