# How do you calculate the phase of this complex equation? $\frac{m+in}{p+iq}$, where m,n,p,q are real

I am trying to solve phase of a complex number and I'm not sure how to do it.

The expression I have come to and I am stuck on is:

$$H(e^{i\omega}) =\frac{m+in}{p+iq} \tag 1$$

$$m$$, $$n$$, $$p$$, and $$q$$ are all real constant numbers.

What is the phase of this equation?

I know that for a given complex equation of:

$$z= x+iy$$

Where φ is the angle between the x axis and the vector z measured counterclockwise in radians:

$$φ = atan2(y, x)$$

Therefore is it correct that the final solution for the phase of my equation would be?

$$φ = \frac{atan2(n,m)}{atan2(q,p)}$$

I believe this implies the numerator and denominator will both be phases in radians. Can you divide phases in radians to get another phase in radians as your final answer like this?

Or how do I solve it? If it is correct, can that final equation be simplified any further?

Edit: Solution given here:

https://dsp.stackexchange.com/questions/67504/is-this-the-correct-solution-for-finding-the-samples-of-phase-delay-at-a-given-f/67506#67506

$$\mathcal{R}\left(H(e^{i\omega})\right)=\frac 12\left(H(e^{i\omega})+H(e^{-i\omega})\right) = \frac{m p+n q}{p^2+q^2}\\ \mathcal{I}\left(H(e^{i\omega})\right)=\frac {1}{2i}\left(H(e^{i\omega})-H(e^{-i\omega})\right)=\frac{n p-m q}{p^2+q^2}$$
and $$x+i y = \sqrt{x^2+y^2}e^{i\arctan\frac yx}$$