Windower (windower_s)

Applies a window function to a stream of values.

Design

The size of the window will be set by the window_length property. The windower component will use the coefficients array to read in the coefficients of a particular window.

Once initialised, the windower component sets an internal variable coefficient_index to zero.

When a sample is received on the input port the windower component completes the following steps for each input sample:

  1. Set output sample to \(\frac{input\_sample \times coefficients[coefficient\_index]}{2^{32}}\)

    • Divide by \(2^{32}\) to reduce FPGA logic (unsigned long window coefficients will have values in the range 0 to 0.999…)

    • The output is then rounded using a half up rounder.

  2. Increment coefficient_index.

  3. If coefficient_index is greater than or equal to window_length set coefficient_index to zero.

The coefficient_index is reset to zero on receipt of a flush or discontinuity operation on the input port.

The Windower Proxy (windower_s_proxy) can be used to generate the window coefficients.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="dummy_property" type="bool" volatile="true" writable="true" default="false" description="dummy property required due to bug"/>
  <!-- Dummy property required due to bug (cannot set raw properties without
       a volatile property existing) -->
  <property name="window_length" type="ushort" initial="true" writable="false" default="128" description="number of coefficients in the window"/>
  <!-- LINT EXCEPTION: xml_012: 2: Cannot specify default value on an
       array due to test failing-->
  <property name="coefficients" type="ulong" arraylength="2048" writable="true" description="window function coefficients"/>
  <port name="input" producer="false" protocol="short_timed_sample-prot"/>
  <port name="output" producer="true" protocol="short_timed_sample-prot"/>
</componentspec>

Opcode Handling

The coefficients are applied to each value in sample opcode messages.

When a Flush or Discontinuity opcode is received, the coefficient index is reset and the opcode is forwarded on.

All other opcodes are passed through this component.

Properties

  • dummy_property: dummy property required due to bug. This is only present to work around a bug that means you cannot set raw properties without a volatile property existing. It is not intended to be used, and its value has no effect on the operation of the component.

    • Type: bool

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: True

    • Default value: false

  • window_length: number of coefficients in the window.

    • Type: ushort

    • Access:

      • Parameter: False

      • Writable: False

      • Initial: True

      • Volatile: False

    • Default value: 128

  • coefficients: window function coefficients.

    • Type: ulong

      • Array dimensions: ['2048']

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: None

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: short_timed_sample-prot

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: short_timed_sample-prot

    • Optional: False

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="windower_s">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.dsp.windower_s" connect="file_write">
    <property name="max_window_length" value="128"/>
  </instance>
  <instance component="ocpi.comp.sdr.dsp.windower_s_proxy" slave="windower_s">
    <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:

There is also a dependency on:

  • ieee.std_logic_1164

  • ieee.numeric_std

  • ieee.math_real

Limitations

None

Testing

Tested platforms: None

Component testing not completed.