calculating phase using ARCTAN(Q/I)

Status
Not open for further replies.

sweethomela8

Member level 4
Joined
Apr 28, 2010
Messages
70
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,766
I'm trying to calculate the phase of a signal by digitizing the inphase and quadrature parts and then doing an digital ARCTAN(Q/I) function on it. My question is, what happens when the inphase component=0? and is there anything you can do about it.

Thanks.
 

Standard C has a function atan2() fot this purpose.
 

You can always do the check (I wrote it in pseudocode):

if (I = 0)
then angle = 90
else angle = arctan(Q/I)
 

I !=0 doesn't actually guarantee that Q/I is a valid float value. That's one reason why atan2() is provided by most C compiler math libraries.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…