Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top