Bias (bias_s)

Adds a fixed bias to all input sample values.

Design

The mathematical representation of the implementation is given in (82).

(82)\[y[n] = B + x[n]\]

In (82):

  • \(x[n]\) is the input values.

  • \(y[n]\) is the output values.

  • \(B\) is the bias value.

A block diagram representation of the implementation is given in Figure 130:.

Block diagram outlining bias implementation.

Figure 130: Bias implementation.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="bias" type="short" writable="true" default="1" description="Bias value added to input values."/>
  <port name="input" producer="false" protocol="short_timed_sample-prot"/>
  <port name="output" producer="true" protocol="short_timed_sample-prot"/>
</componentspec>

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

Opcode Handling

A bias is only added to values in sample opcode messages.

As the output data type is larger than the input data type, messages can be split to ensure no output messages are longer than the maximum supported message length of the protocol.

All other opcode messages received are passed through this component without any effect.

Properties

  • bias: Bias value added to input values.

    • Type: short

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: 1

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="bias_s">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.math.bias_s" connect="file_write">
    <property name="bias" value="5"/>
  </instance>
  <instance component="ocpi.core.file_write">
    <property name="filename" value="output.bin"/>
  </instance>
</application>

Dependencies

The dependencies to other elements in OpenCPI are:

  • None

There is also a dependency on:

  • ieee.std_logic_1164

  • ieee.numeric_std

Limitations

Limitations of bias_s are:

  • None.

Testing

Tested platforms: None

Component testing not completed.