Engee documentation

Magnitude-Angle to Complex

Converts the modulus and/or phase angle of the signal into a complex signal.

blockType: MagnitudeAngleToComplex

Path in the library:

/Basic/Math Operations/Magnitude-Angle to Complex

Description

Supported operations

Block Magnitude-Angle to Complex Converts the module and phase angle input signals into a complex output value. The angle at the Input must be given in radians.

With two input ports, the unit supports any combination of dimensions that satisfy the capabilities of the broadcast.

If there is an array at the Input of the block, then there will be an array of complex signals at the output. The elements of the input vector of modules correspond to the modules of complex output elements. Similarly, the elements of the input vector of angles correspond to the angles of the complex output elements. If one of the input signals is a scalar, then it corresponds to the component (module or angle) of all complex output signals.

The effect of going out of range on the CORDIC approximation

If the CORDIC approximation method is used [1], then the following restrictions are imposed on the Input of the block for the phase angle:

  • The input angle should lie in the range .

Ports

Input

# |u| — module
scalar | vector | matrix | N-dimensional array

Details

A module in the form of a real scalar, vector, matrix or N-dimensional array.

Dependencies

To use this port, set the Input parameter to Magnitude and angle or Magnitude.

Limitations.

If one of the inputs has a floating point data type, the other input must use the same data type.

Data types

Float32, Float64.

Complex numbers support

No

# ∠u — phase angle
scalar | vector | matrix | N-dimensional array

Details

The phase angle in radians given as a real scalar, vector, matrix, or N-dimensional array. If the CORDIC approximation method is used for calculations, the input angle must lie in the range .

Dependencies

To use this port, set the Input parameter to Magnitude and angle or Angle.

Limitations.

If one of the inputs has a floating point data type, the other input must use the same data type.

Data types

Float32, Float64.

Complex numbers support

No

Output

# u — complex signal
scalar | vector | matrix

Details

A complex signal formed from given values of modulus and phase angle.

If the input of the block is an array, the output is an array of complex signals. The elements of the input modulus vector correspond to the moduli of the complex output elements. Similarly, the elements of the input vector of angle correspond to the angles of the complex output elements. If one of the input signals is a scalar, it corresponds to a component (module or angle) of all complex output signals.

Data types

Float32, Float64.

Complex numbers support

Yes

Parameters

Main

# Input — input port type
Magnitude | Angle | Magnitude and angle

Details

Specify which input data is used:

  • Magnitude - modulus.

  • Angle - angle.

  • Magnitude and angle - modulus and angle.

Values

Magnitude | Angle | Magnitude and angle

Default value

Magnitude and angle

Program usage name

Input

Tunable

No

Evaluatable

No

# Approximation method — approximation method
None | CORDIC

Details

Specify the approximation method for calculating the output.

Approximation method When to use this method

None (By default).

If the Taylor series algorithm is used (by default).

CORDIC.

If a quick and approximate calculation is needed.

Values

None | CORDIC

Default value

None

Program usage name

ApproximationMethod

Tunable

No

Evaluatable

No

# Magnitude — output module
Scalar / array of real numbers

Details

A constant output modulus specified as a real scalar, vector, matrix, or N-dimensional array.

Dependencies

To use this parameter, set the Input parameter to Angle.

Default value

0

Program usage name

ConstantPartMagnitude

Tunable

No

Evaluatable

Yes

# Angle — input signal phase angle
Scalar / array of real numbers

Details

The phase angle in radians specified as a real scalar, vector, matrix or N-dimensional array. If the CORDIC approximation method is used for calculations, the input angle must lie in the range .

Dependencies

To use this parameter, set the Input parameter to Magnitude.

Default value

0

Program usage name

ConstantPartAngle

Tunable

No

Evaluatable

Yes

# Number of iterations — number of iterations for the CORDIC algorithm
Real number

Details

The number of iterations to execute the CORDIC algorithm as a positive integer.

Dependencies

To use this parameter, set the Approximation method parameter to CORDIC.

Default value

11

Program usage name

NumberOfIterations

Tunable

No

Evaluatable

Yes

# Scale output by reciprocal of gain factor — scaling option for real and imaginary parts of the complex output
Logical

Details

Select this check box to scale the real and imaginary parts of the complex output signal by a factor of . This value depends on the number of iterations specified. As the number of iterations increases, the value approaches 1.647.

This checkbox is selected by default, which leads to a numerically more accurate result for the complex output . However, scaling the output adds two additional multiplication operations, one for and one for .

Dependencies

To use this option, set the Approximation method parameter to CORDIC.

Default value

true (switched on)

Program usage name

ScaleReciprocalGainFactor

Tunable

No

Evaluatable

No

Additional information

CORDIC

CORDIC is an abbreviation for COordinate Rotation DIgital Computer. The CORDIC algorithm based on Givens rotation is one of the most hardware efficient algorithms, since it requires only iterative shift-add operations (see References). The CORDIC algorithm eliminates the need for explicit multipliers. Various functions such as sine, cosine, arcsine, arccosine, arctangent and vector modulus can be calculated using CORDIC. This algorithm can also be used for division, square root, hyperbolic and logarithmic functions.

References

  1. Volder, Jack E., “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers EC-8 (1959); 330–334.

  2. Andraka, Ray “A Survey of CORDIC Algorithm for FPGA Based Computers.” Proceedings of the 1998 ACM/SIGDA Sixth International Symposium on Field Programmable Gate Arrays. Feb. 22–24 (1998): 191–200.

  3. Walther, J.S., “A Unified Algorithm for Elementary Functions,” Proceedings of the Spring Joint Computer Conference, May 18-20, 1971: 379–386.

  4. Schelin, Charles W., “Calculator Function Approximation,” The American Mathematical Monthly 90, no. 5 (1983): 317–325.