Windower Proxy (windower_xs_proxy)

A proxy worker to provide coefficients for the Windower (windower_xs) component.

Design

During start, and when the window_type property is written, this proxy worker calculates the coefficients for a Hann, Blackman-Harris or Hamming window and passes the data on to a window slave worker.

The window type and length is set by the window_type and window_length properties, respectively.

The window proxy worker calculates window_length coefficients for the selected window type. Each coefficient is converted to an integer using the following formula:

\(Integer \space Coefficient = truncate(Max \space Integer \times Coefficient)\)

Integer Coefficient is set to Max Integer if it is greater than Max Integer.

These coefficients are used to set the window slave worker’s coefficients property.

For Hann windows the coefficient formula is:

(52)\[(\sin(\pi * n) / \texttt{window_length}) ^ 2\]

For Blackman-Harris windows the coefficient formula is:

(53)\[a0 - (a1 * cos((2 * \pi * n) / \texttt{window_length})) + (a2 * cos((4 * \pi * n) / \texttt{window_length})) - (a3 * cos((6 * \pi * n) / \texttt{window_length}))\]

Where:

  • \(a0 = 0.35875\)

  • \(a1 = 0.48829\)

  • \(a2 = 0.14128\)

  • \(a3 = 0.01168\)

For Hamming windows the coefficient formula is:

(54)\[0.54 - (0.46 * cos((2 * \pi * n) / \texttt{window_length}))\]

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="window_length" type="ushort" initial="true" writable="false" default="128"
    description="number of coefficients in the window"/>
  <property name="window_type" type="enum" writable="true" enums="hann,blackman_harris,hamming" default="hann"
    description="selects the window type"/>
</componentspec>

Opcode Handling

N/A

Properties

  • window_length: number of coefficients in the window.

    • Type: ushort

    • Access:

      • Parameter: False

      • Writable: False

      • Initial: True

      • Volatile: False

    • Default value: 128

  • window_type: selects the window type.

    • Type: enum

      • Allowed values: ['hann', 'blackman_harris', 'hamming']

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: hann

Ports

None

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="windower_xs">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.dsp.windower_xs" connect="file_write">
    <property name="max_window_length" value="128"/>
  </instance>
  <instance component="ocpi.comp.sdr.dsp.windower_xs_proxy" slave="windower_xs">
    <property name="window_length" value="128"/>
    <property name="window_type" value="hann"/>
  </instance>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

Limitations

None

Testing

None