Absolute (abs_l)
Finds magnitude of sample values.
Design
Finds the magnitude, or absolute value, of the input values.
The mathematical representation of the implementation is given in (77).
In (77):
\(x[n]\) is the input values.
\(y[n]\) is the output values.
A block diagram representation of the implementation is given in Figure 125:.
Figure 125: Absolute implementation.
Interface
<?xml version="1.0"?>
<componentspec>
<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-protOptional:
False
Outputs:
output: Primary output samples port.Protocol:
long_timed_sample-protOptional:
False
Opcode Handling
Absolute value is only calculated on data in sample opcode messages. All other opcode messages are passed through this component without any effect.
Properties
None.
Implementations
Example Application
<?xml version="1.0"?>
<application done="file_write">
<instance component="ocpi.core.file_read" connect="abs_l">
<property name="filename" value="input.bin"/>
</instance>
<instance component="ocpi.comp.sdr.math.abs_l" connect="file_write"/>
<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 abs_l are:
For an input of the minimum value supported by a long (-2147483648) this component will return zero due to an overflow.
Testing
Tested platforms: None
Component testing not completed.