Gain (gain_s_l)

Multiplies all input sample values by a fixed gain value.

Design

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

(89)\[y[n] = G * x[n]\]

In (89):

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

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

  • \(G\) is the gain factor.

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

Block diagram outlining gain implementation.

Figure 137: Gain implementation.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="gain" type="short" writable="true" default="1" description="Gain multiplier value."/>
  <port name="input" producer="false" protocol="short_timed_sample-prot"/>
  <port name="output" producer="true" protocol="long_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: long_timed_sample-prot

    • Optional: False

Opcode Handling

Only values in sample opcode messages are multiplied by a gain value.

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

  • gain: Gain multiplier value.

    • 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="gain_s_l">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.math.gain_s_l" connect="file_write">
    <property name="gain" value="2"/>
  </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

Limitations

Limitations of gain_s_l are:

  • None.

Testing

Tested platforms: None

Component testing not completed.