Skip to main content
Skip table of contents

Pow2Fract32

Overview

Computes 2^x using a fast polynomial approximation.

Discussion

This module computes 2^x for fractional input values. The input is in Q6.26 and the output is in Q16.16. The module uses a polynomial based approximation to the pow2() function and the result is accurate to within 0.04 dB (when you look at the result on a db20 scale). The maximum error occurs for very small input values. Over most of the usable range the error is within 0.004 dB.

Type Definition

CODE
typedef struct _ModulePow2Fract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
} ModulePow2Fract32Class;

Pins

Input Pins

Name: in

Description: Input signal

Data type: fract32

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: Output signal

Data type: fract32

MATLAB Usage

File Name: pow2_fract32_module.m

CODE
 M = pow2_fract32_module(NAME)
 Creates an Audio Weaver module that computes 2^x using a fast polynomial
 approximation.  The input is in Q6.26 format and the output is in 
 Q16.16 format.  Arguments:
    NAME - name of the module.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.