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.

See Also

Vector Generation with Window Functions

Using Windowing with Discrete Fourier Transforms

Multiply signal data by window sequence values to reduce spectral leakage.

enum vDSP.WindowSequence

Constants specifying window sequence functions.