Algorithm Implementation

Algorithm development for fixed-point data


bitand Bitwise AND of two fi objects
bitor Bitwise OR of two fi objects
bitshift Shift bits specified number of places
cordicabs CORDIC-based absolute value
cordicangle CORDIC-based phase angle
cordicatan2 CORDIC-based four quadrant inverse tangent
cordiccart2pol CORDIC-based approximation of Cartesian-to-polar conversion
cordiccexp CORDIC-based approximation of complex exponential
cordiccos CORDIC-based approximation of cosine
cordicpol2cart CORDIC-based approximation of polar-to-Cartesian conversion
cordicrotate Rotate input using CORDIC-based approximation
cordicsin CORDIC-based approximation of sine
cordicsincos CORDIC-based approximation of sine and cosine
cordicsqrt CORDIC-based approximation of square root
fi Construct fixed-point numeric object
filter One-dimensional digital filter of fi objects
for Execute statements specified number of times
mean Average or mean value of fixed-point array
median Median value of fixed-point array
sqrt Square root of fi object

Examples and How To


Develop Fixed-Point Algorithms

Develop and verify a simple fixed-point algorithm.

Calculate Fixed-Point Sine and Cosine

This example shows how to use both CORDIC-based and lookup table-based algorithms provided by Fixed-Point Designer to approximate the MATLAB sine and cosine functions.

Compute Sine and Cosine Using CORDIC Rotation Kernel

This example shows how to compute sine and cosine using a CORDIC rotation kernel in MATLAB.

Calculate Fixed-Point Arctangent

This example shows how to use the CORDIC algorithm, polynomial approximation, and lookup table approaches to calculate the fixed-point, four quadrant inverse tangent.

Perform QR Factorization Using CORDIC

This example shows how to write MATLAB code that works for both floating-point and fixed-point data types. The algorithm used in this example is the QR factorization implemented via CORDIC.

Compute Square Root Using CORDIC

This example shows how to compute square root using a CORDIC kernel algorithm in MATLAB.

Convert Cartesian to Polar Using CORDIC Vectoring Kernel

This example shows how to convert Cartesian to polar coordinates using a CORDIC vectoring kernel algorithm in MATLAB.

Lookup Tables

Normalize Data for Lookup Tables

This example shows how to normalize data for use in lookup tables.

Implement Fixed-Point Log2 Using Lookup Table

This example shows how to implement fixed-point log2 using a lookup table. Lookup tables generate efficient code for embedded devices.

Implement Fixed-Point Square Root Using Lookup Table

This example shows how to implement fixed-point square root using a lookup table.

System Objects

Convert dsp.FIRFilter Object to Fixed-Point Using the Fixed-Point Converter App

This example converts a dsp.FIRFilter System object™, which filters a high-frequency sinusoid signal, to fixed-point using the Fixed-Point Converter app.

Parallel Computing

Fixed-Point Design Exploration in Parallel

This example shows how to explore and test fixed-point designs by distributing tests across many computers in parallel.


fimath for Rounding and Overflow Modes

Gives an example that shows that the order in which you set overflow action and rounding method matters

fimath for Sharing Arithmetic Rules

Gives an example of using a fimath object to share modular arithmetic information among multiple fi objects

fimath ProductMode and SumMode

Shows the differences among the different settings of the ProductMode and SumMode properties

How Functions Use fimath

Describes which functions ignore or discard fimath

System Objects Supported by Fixed-Point Converter App

You can use the Fixed-Point Converter app to automatically propose and apply data types for commonly used system objects.


Mismatched fimath Errors

How to fix mismatched fimath errors

fi Constructor Does Not Follow globalfimath Rules

How to get the fi constructor to follow globalfimath rules

Frequently Asked Questions About Fixed-Point Numbers

A fraction length greater than the word length of a fixed-point number occurs when the number has an absolute value less than one and contains leading zeros.

Why Does the Fixed-Point Converter App Not Propose Data Types for System Objects?

How to troubleshoot missing data type proposals for System objects

Was this topic helpful?