Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Downscaling

Hi all,

Im trying to implement an arctan function in Quartus II using a Chebyshev approximation algorithm. The problem is that it only accepts numbers between -1 and 1 as arguments(including fractions) and my data goes as high as 20. Im using this arctan to get the phase between my in-phase and quadrature channels and the quotient samples of the Q/I are higher than/lower than -1 and 1(up to +-20). How can I scale this data down to be a valid input for the arctan since the division megafunction doesnt give desirable results?

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    How many bits are you are using for I and Q channels? How many are for fractional and integer parts?

    Which are maximum and minimum values for I and Q channels?.

    However, if the I Q channels bit size (N) don't grow, you should be able to use the arctan core without problems assuming a signed fixed point format b_N-1. b_N-2 ... b_0, any scale value is canceled after doing Q/I.

    Be careful with divider circuit, because it can introduce overflows.

    Fixed point division is performed correctly by doing

    (Q<<Nf)/I

    Where Nf is the fractional bits size.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    How many bits are you are using for I and Q channels? How many are for fractional and integer parts?

    Which are maximum and minimum values for I and Q channels?.

    However, if the I Q channels bit size (N) don't grow, you should be able to use the arctan core without problems assuming a signed fixed point format b_N-1. b_N-2 ... b_0, any scale value is canceled after doing Q/I.

    Be careful with divider circuit, because it can introduce overflows.

    Fixed point division is performed correctly by doing

    (Q<<Nf)/I

    Where Nf is the fractional bits size.

    --- Quote End ---

    My "channel" is basically a stream of 8bit symbols representing signed integers 1,-1,3,-3 (16QAM). These values are upsampled & filtered with a nyquist filter, therefore causing their amplitudes to vary around their nominal values. The divider prior to the arctan will therefore be dividing 8bit symbols with one another and then sending the output to the arctan as an argument (which need to be between -1 & 1).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The main issue is with divider. arctan core input format can be assumed arbitrarily as i said.