Sine HDL Optimized and Cosine HDL Optimized
Implement fixed-point sine and cosine wave by using lookup table approach optimized for HDL code generation
Libraries:
HDL Coder /
Lookup Tables
Description
The Sine HDL Optimized block and Cosine HDL Optimized block implements a fixed-point sine or cosine wave by using a lookup table method that exploits quarter-wave symmetry.
For the most efficient HDL implementation, configure the block with an exact power of two
as the number of elements. In the Block Parameters dialog box, for Number of data
points, specify an integer that is an exact power of two. That is, specify the
lookup table data points to be (2^n)
, where
n is an integer. By default, the Number of data
points is 64.
When you specify a power of two for the Number of data points, the lookup tables precede a register without reset after HDL code generation. The combination of the lookup table block and register without reset maps efficiently to RAM on the target device.
Depending on your selection of the Output formula parameter, the blocks can output these functions of the input signal:
sin(2πu)
cos(2πu)
exp(i2πu)
sin(2πu) and cos(2πu)
Use the Table data type parameter to specify the word length of the fixed-point output data type. The fraction length of the output is the output word length minus 2.
Ports
Input
Output
Parameters
Extended Capabilities
Version History
Introduced in R2016b