# Algorithm Implementation

Algorithm development for fixed-point data

## Functions

 `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 `cordictanh` CORDIC-based hyperbolic tangent
 `fi` Construct fixed-point numeric object `fimath` Set fixed-point math settings `filter` One-dimensional digital filter of `fi` objects `fipref` Set fixed-point preferences `for` Execute statements specified number of times `mean` Average or mean value of fixed-point array `median` Median value of fixed-point array `numerictype` Construct an `embedded.numerictype` object describing fixed-point or floating-point data type `sqrt` Square root of `fi` object `globalfimath` Configure global fimath and return handle object `resetglobalfimath` Set global fimath to MATLAB factory default `removeglobalfimathpref` Remove global fimath preference

## Examples and How To

### CORDIC

Develop Fixed-Point Algorithms

Develop and verify a simple fixed-point algorithm.

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.

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.

### Application Areas

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.

Real-Time Image Acquisition, Image Processing, and Fixed-Point Blob Analysis for Target Practice Analysis

Acquire real-time images from a webcam, process the images using fixed-point blob analysis, and determine world coordinates to score target practice using a laser pistol

## Concepts

fimath for Rounding and Overflow Modes

Why the order in which you set overflow action and rounding method matters.

fimath for Sharing Arithmetic Rules

Using a `fimath` object to share modular arithmetic information among multiple `fi` objects.

fimath ProductMode and SumMode

Understand the differences among the different settings of the `ProductMode` and `SumMode` properties.

fi Object Properties

Defines the `fi` object properties.

fipref Object Properties

Defines the `fipref` object properties.

quantizer Object Properties

Defines the `quantizer` object properties.

Ways to Construct fi Objects

Teaches you how to create `fi` objects

fi Object Properties

Tells you how to find more information about the properties associated with `fi` objects, and shows you how to set these properties

fi Object Functions

Introduces the functions in the toolbox that operate directly on `fi` objects

How Functions Use fimath

Describes which functions ignore or discard fimath.

fimath Object Construction

How to create `fimath` objects.

fimath Object Properties

How to find more information about the properties associated with `fimath` objects, and how to set these properties.

fipref Object Construction

Teaches you how to create `fipref` objects

fipref Object Properties

Tells you how to find more information about the properties associated with `fipref` objects, and shows you how to set these properties

fi Object Display Preferences Using fipref

Gives examples of using `fipref` objects to set display preferences for `fi` objects

Data Type Override Preferences Using fipref

Describes how to use the `fipref` object to perform data type override

numerictype Object Construction

Teaches you how to create `numerictype` objects

numerictype Object Properties

Tells you how to find more information about the properties associated with `numerictype` objects, and shows you how to set these properties

numerictype Objects Usage to Share Data Type and Scaling Settings of fi objects

Gives an example of using a `numerictype` object to share modular data type and scaling information among multiple `fi` objects

## Troubleshooting

Resolve Error: Mismatched fimath

Troubleshoot mismatched `fimath` errors.

fi Constructor Does Not Follow globalfimath Rules

Troubleshoot getting the `fi` constructor to follow `globalfimath` rules.

Describes the meaning of negative fraction length and fraction length greater than word length.

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

Troubleshoot missing data type proposals for System objects.

## Featured Examples

##### Support 평가판 신청