Logarithm and Exponential Data
Building the Cantata Workspace
To build the logarithm table of length 256 with values ranging from 0 to
255, we can use the following recipe:
- Create a 1D ramp signal type "float" (width 1, height 256) varying
from 0 to 1000 using the following parameters in the
Piecewise Linear operator:
Number Rows: 256 Sampling Freq: 1
Number Cols: 1 Minimum Value: 0
Number Bands: 1 Maximum Value: 1000
X Period: 256 Y Period: 256
X Rise Time: 0 Y Rise Time: 256
X Fall Time: 0 Y Fall Time: 0
X Pulse Width 0 Y Pulse Width: 0
- Take the log(value+1) of the table using the
Logarithm operator.
- Normalize and convert the result of the logarithm table to type
unsigned byte using the
Normalize operator.
- Plot the table using the
2D Plot operator.
- To make this 1D signal a color table it is necessary to transfer the
data from the Value segment to the Map segment.
Use the Copy from Value operator.
- You can print the table using the operators
Print Data and
File Viewer.
To build the exponential table, you can follow the same procedure
described above but applying the
Exponential operator in step 2.
Exercises
- Build a piecewise linear LUT.
- Build a sinusoidal LUT.
DIP Feedback Form