MagnitudeAngle to Complex
Convert magnitude and/or a phase angle signal to complex signal
Libraries:
Simulink /
Math Operations
HDL Coder /
HDL Floating Point Operations
Description
Supported Operations
The MagnitudeAngle to Complex block converts magnitude and phase angle inputs to a complex output. The angle input must be in rad.
When there are two block inputs, the block supports these combinations of input dimensions:
Two inputs of equal dimensions
One scalar input and the other an ndimensional array
If the block input is an array, the output is an array of complex signals. The elements of a magnitude input vector map to the magnitudes of the corresponding complex output elements. Similarly, the elements of an angle input vector map to the angles of the corresponding complex output elements. If one input is a scalar, it maps to the corresponding component (magnitude or angle) of all the complex output signals.
Effect of OutofRange Input on CORDIC Approximations
If you use the CORDIC approximation method [1], the block input for phase angle has these restrictions:
For signed fixedpoint types, the input angle must fall within the range [–2π, 2π) rad.
For unsigned fixedpoint types, the input angle must fall within the range [0, 2π) rad.
This table summarizes the effects of an outofrange input:
Block Usage  Effect of OutofRange Input 

Simulation modes  An error appears. 
Generated code  Undefined behavior occurs. 
When you use the CORDIC approximation, ensure that you use an inrange input for the MagnitudeAngle to Complex block. Avoid relying on undefined behavior for generated code or accelerator modes.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

More About
References
[1] Volder, Jack E., “The CORDIC Trigonometric Computing Technique.” IRE Transactions on Electronic Computers EC8 (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 1820, 1971: 379–386.
[4] Schelin, Charles W., “Calculator Function Approximation,” The American Mathematical Monthly 90, no. 5 (1983): 317–325.