# conversion of phase from radian to deg

#### Maitry07

Hello support team,

I am capturing the absolute phase in radians with the 2QN format( FIX16_13 format) .
1 sign bit, 1 integer bit , 13 fraction bits

Now I want to convert the absolute phase from radians to deg. i.e
So, I am using multiplier IP core - xilinx to multiply the phase (2QN format) with 57 integer value( 180/Pi).
but I am not understanding on how to understand the multiplier output ? so, my question is weather I can directly multiply 57 with 2QN format and it will provide correct result or do I need to do some conversion from 2QN format to any other format?

You'll first define the target number format, e.g. 8Q7, then the respective fixed point multiply.

Fixed point libraries can perform the required shift and truncate operation for you. A bit more accuracy than integer factor 57 would be appropriate for 16 bit resolution.

I wonder what's the purpose of converting angle to degrees in FPGA?
--- Updated ---

Is your FPGA providing human interface, e.g. driving a display or printing numbers to an UART?

Last edited:

Hello,
Actually My final agenda is to measure the relative phase in deg. between the 2 outputs. and this relative phase I will further provide to DAC to get the equivalent analog voltage for the measured relative phase.

If you send the output to DAC, why scale to degree? Instead you'll scale directly to DAC range.

You mean to say, I directly figure out the relative phase by subtraction between 2 absolute phase ( FIX16_13 Format) and get the relative phase in radians.

And this radians result further I give it to DAC without any conversion to deg.

Is my understanding correct?

Xilinx cordic IP has unusual phase range of +/- 4 instead of +/- pi. Therefore subtraction result lays possibly outside normal range. I would normalize first to +/- pi and then substract. Difference can be send to DAC without further scaling, presuming a binary DAC input format.

Yes, I have already set the Coarse rotation parameter to extend the CORDIC range to full circle instead of +/-4.
Thank you for the response.

Why, expect you want normalized phase difference, but don't know your specification. Suggest to test your math with pencil and paper method.

Hello,
Let me give you a detailed brief.

I am using the DDC algorithm with 2 RF-ADC that take CW RF input( No modulation). DDC converts both RF inputs to I, and Q samples which I am further proving it to CORDIC vector translation mode to generate amp and phase.
CORDIC output phase is in radians. then I will subtract both phases to get the relative phase.

As my RF input is a pure sine wave. my phase range will be -pi to pi. ( full circle). both RF inputs will be having a phase difference which I want to measure. that's why I have set the coarse rotation parameter of the CORDIC.

I have verified the individual amplitude at the CORDIC output, which is accurate. now I am working on relative phase.

Coarse rotation option is in fact neccessary. In addition, you need to take care, that substraction is executed as modulo 2*pi operation. For example, if you have A = pi, B = -0.5 pi, you get A - B = pi + 0.5 pi = 1.5 pi, but the expected normalized result is -0.5 pi. By upscaling phase range to +/- pi, you get automatic modulo operation during substraction.

YES, I am using coarse rotation.

## Commands Quick-Menu: 