Main Content

High Precision Calculations in Interpolation Block

This example shows how to perform high precision calculations in the Interpolation Using Prelookup block using internal rules. The Interpolation block allows the data type for intermediate results to be set.

Open the fxpdemo_interp_precision model.

open_system('fxpdemo_interp_precision')

In this model, the table is stored using an 8-bit data type. The calculations are performed using a 16-bit data type with higher precision than both the table and the output port. The default Intermediate results data type is Inherit: Inherit via internal rule that tries to maximize the precision of the intermediate results.

To see this in generated code, select the model and enter Ctrl+B to build it.