Jump to content
  • 0

How to find phase angle from ADC sample using FFT and CORDIC IP core?


kalainan

Question

@D@n @Pavel @zygot@QuailJohn @msamirh @petriggg @RCB

Hi, 

     I have to find the phase angle from ADC samples. The input signal is from the function generator which is given to ADC and then the ADC sampled data is buffered and given to FFT IP core. Then the output of the FFT IP core is given to CORDIC IP core to get the phase angle, but I am not getting correct phase angle for the respective input signal. Refer the parameters which I have given below. 

Input frequency => 23.5MHz sine wave with 45 degree phase shift which was generated by function generator

ADC sampling frequency => 188MHz

FFT samples  N=> 256 points

Frequency resolution => FS/N

                                   => 188MHz/256

                                   =>734375Hz

Frequency bin => input frequency/frequency resolution 

                         => 23500000/734375

                         => 32nd bin 

The real and imaginary value of 32nd bin is given to CORDIC IP core to get the phase angle value as 45degree but I am getting the varying phase angle.

Here I  have attached the configuration settings of FFT and CORDIC IP core. 

s_cordic1.thumb.JPG.8a03e42db4a7aaddb3e5d9e842b13123.JPGs_fft1.thumb.JPG.ccead86cb548e8903ba37e70b8c01e6d.JPGs_fft2.thumb.JPG.c486140c6d3f0a8b6005704744e8c499.JPGs_fft3.thumb.JPG.08cbfd7681425154d9e17babf992000e.JPG

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
So, a second version of your first post with some changes and a bit more information about what you are doing, but not what you want to do; other than measure "phase angle" for some purpose that you don't mention.

It has the appearance to me of a lab or homework assignment. In my first reply, I was thinking that perhaps there was some real world application that you wanted to accomplish. The new information doesn't support that idea, so I'm left with appearances.

You say that you're using a single sine-wave signal generated by a function generator having a 45 degree phase shift. A phase shift relative to what? I gather that you are supposed to detect this phase shift value relative to some reference sine-wave?

Perhaps starting out with a piece of paper with x-y coordinates and a sine-wave drawn on it at some arbitrary location relative to {0,0} and a few thought experiments might be the way to start. I think that something about what you think that you want to do is missing in terms of definition. It possibly might just be me though. Edited by zygot
Link to comment
Share on other sites

  • 0

@zygot

 The ADC which I am using is 16-bit dual channel so there will be two IF input signal one is taken as reference signal which is generated onboard using PLL and another signal is received from RF receiver  from which I have to calculate the phase of the each signal and then have to find the difference between them.

IF1 = 23.5MHz with 45degree phase

IF2=23.5MHz with unknown phase

From this two signals I have to find the phase difference and gain difference.

Link to comment
Share on other sites

  • 0
OK, now we have what appears to me to be 3 distinct versions of a description of what appears to be a lab assignment. It's hard to tell whether the assignment description is changing based on my questions or a half-hearted attempt at being more detailed without actually revealing the goals for why you are completing your assignment.

I might be leaning toward the idea that you are an engineering student taking a behavioral psychology course and the people responding to your post are the lab rats... I have an open mind based on past experiences.

Well, finding the relative phase between a reference sine or cosine signal and a second sine or cosine signal with a fixed phase offset is quite different than the first two versions, but more realistic. presumably, both waveforms are either a sine or cosine but not different. This at least resolves some difficulties with respect to time. As far as relative amplitude goes there's gain, but also offset. Both gain and offset are unlikely to be fixed from cycle to cycle, at the ADC input pins.

BTW the 45 degree phase shift for IF1 is not relevant. The current version of the story is that you have two signals with an unknown (presumably fixed) phase offset, and an unknown difference in amplitude at the source as well as an unknown offset which is different for each signal. Presumably, there are similar anti-aliasing filters between the signal source and the ADC analog input pins for each channel. I presume that you know the relationship between the ADC output codes and the ADC analog input(s) as well as the ENOB for your ADC. I guess that for a lab assignment you can assume that you have ideal waveform sources and ADC conversion, but detecting relative phase within +/- 45 degrees is a different problem than within +/- 2 degrees.

So, what's the theory for how you intend to solve the problem? Edited by zygot
Link to comment
Share on other sites

  • 0

I don't know why you directed your post to a particular set of people but the fact is that everyone can read it and anyone can post a reply to it. I'm just the only person to take the time to reply so far.

The Digilent forum is not supposed to be a place where students can find people to do their work for them or try and get a grade that they aren't worthy of... but you'd be surprised how many try, and I imagine occasionally with success. You are certainly correct in suspecting that I'm testing you. I don't know what your motivations are or who you are. I can only ask for clarification.  It's all about what you say, and more importantly what you won't say, and about how the conversation progresses. Often, having a conversation is more appropriate than supplying direct answers to questions. Often there are clear signs that the question being posted is not what the real problem is. This is especially true when the questions don't make sense and the person asking for help is evasive when asked to clarify confusing detail that have been provided. Trying to be helpful in the context of this forum, without enabling cheaters, isn't an exact science.

Don't give up. Someone else might get involved with your threads. For what its worth I'm coming away from this experience only the more convinced that my approach so far has been the correct one. My view is that people asking for help have no right to complain about the service. Generally, it's all about the conversation and communication. If you are unhappy with how I'm handling your thread then I'm quite happy to end the conversation.

Edited by zygot
Link to comment
Share on other sites

  • 0
25 minutes ago, zygot said:

I don't know why you directed your post to a particular set of people but the fact is that everyone can read it and anyone can post a reply to it. I'm just the only person to take the time to reply so far.

The Digilent forum is not supposed to be a place where students can find people to do their work for them or try and get a grade that they aren't worthy of... but you'd be surprised how many try, and I imagine occasionally with success. You are certainly correct in suspecting that I'm testing you. I don't know what your motivatinos are or who you are. I can only ask for clarification.  It's all about what you say, and more importantly what you won't say, and about how the conversation progresses. Often, having a conversation is more important than supplying direct answers to questions. This is especially true when the questions don't make sense and the person asking for help is evasive when asked to clarify confusing detail that have been provided. Trying to be helpful in the context of this forum isn't an exact science.

Don't give up. Someone else might get involved with your threads. For what its worth I'm coming away from this experience only the more convinced that my approach so far has been the correct one. My view is that people asking for help have no right to complain about the service. Generally, it's all about the conversation and communication. If you are unhappy with how I'm handling your thread then I'm quite happy to end the conversation.

Thank you and I will find the solution shortly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...