Zero Padder (zero_padder_l)

Adds a settable number of zeros after each input data value.

Design

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

(55)\[\begin{split}y[n] = \begin{cases} x[\frac{n}{R}] & \frac{n}{R} \in \mathbb{Z} \\ 0 & \text{otherwise} \end{cases}\end{split}\]

In (55):

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

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

  • \(R\) is the number of zeros added after each sample.

Interface

<?xml version="1.0"?>
<componentspec>
  <property name="samples" type="uchar" writable="true" default="0"
    description="Number of zero valued samples to add between each sample."/>
  <port name="input" producer="false" protocol="long_timed_sample-prot"/>
  <port name="output" producer="true" protocol="long_timed_sample-prot"/>
</componentspec>

Ports

Inputs:

  • input: Primary input samples port.

    • Protocol: long_timed_sample-prot

    • Optional: False

Outputs:

  • output: Primary output samples port.

    • Protocol: long_timed_sample-prot

    • Optional: False

Opcode Handling

Zeros are only added after values in a sample opcode message. Message boundaries will be kept in the same relative position to the data, unless the output message would exceed the maximum message length for the protocol type, in which case the message is split.

All other opcodes pass through this component without any effect.

Properties

  • samples: Number of zero valued samples to add between each sample. If set to zero the input data samples are passed through unmodified.

    • Type: uchar

    • Access:

      • Parameter: False

      • Writable: True

      • Initial: False

      • Volatile: False

    • Default value: 0

Implementations

Example Application

<?xml version="1.0"?>
<application done="file_write">
  <instance component="ocpi.core.file_read" connect="zero_padder_l">
    <property name="filename" value="input.bin"/>
  </instance>
  <instance component="ocpi.comp.sdr.dsp.zero_padder_l" connect="file_write">
    <property name="samples" value="255"/>
  </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 zero_padder_l are:

  • None.

Testing

Tested platforms: None

Component testing not completed.