Windower (windower_xs)
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:
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.
Increment
coefficient_index.If
coefficient_indexis greater than or equal towindow_lengthsetcoefficient_indexto zero.
The coefficient_index is reset to zero on receipt of a flush or discontinuity operation on the input port.
The Windower Proxy (windower_xs_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="complex_short_timed_sample-prot"/>
<port name="output" producer="true" protocol="complex_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:
boolAccess:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
True
Default value:
false
window_length: number of coefficients in the window.Type:
ushortAccess:
Parameter:
FalseWritable:
FalseInitial:
TrueVolatile:
False
Default value:
128
coefficients: window function coefficients.Type:
ulongArray dimensions:
['2048']
Access:
Parameter:
FalseWritable:
TrueInitial:
FalseVolatile:
False
Default value:
None
Ports
Inputs:
input: Primary input samples port.Protocol:
complex_short_timed_sample-protOptional:
False
Outputs:
output: Primary output samples port.Protocol:
complex_short_timed_sample-protOptional:
False
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:
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.