Forum Discussion

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

phase difference 2 signals.

is possible whit fpga FFT or similar metod measure a phase difference from 2 PULSED-sinusoidals signals?

the freq of signals is 60MHz but the duration of signals is 0.5uSEC, and the PRF of pulsed signals is 1800Hz.

tnx Luca

19 Replies

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

    That is difficult to judge unless you model you case.

    Demodulation as FvM mentioned imply (as I believe sin at 0,1,0,-1 and cos at 1,0,-1,0) i.e. multiplying by 60 MHz and thus you get your frequency moved to zero(60 - 60) with an image at 120 (60 + 60) and this will need filtering I believe.

    If you multiply by +1/-1 sine instead then you get your frequency at 60MHz with image folding on your frequency and no need for filtering But you can't generate sin/cos at +1/-1.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    tnx.

    i see AD8348 datasheet, I/Q demodulator chip.

    You think that could work, for my application?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    In principle it should work. in terms of resolution it depends...

    You can think of the idea in simple time domain terms as follows:

    your ref is: sin = 0,1,0,-1, cos = 1,0,-1,0

    if your signal is exactly in phase with sin then you get:

    Re = 0,1,0,1, im = 0 i.e. double frequency (120) plus dc

    if your signal is exactly in phase with cos then you get:

    Re = 0, im = 1,0,1,0

    if your signal is in between then you get a value indicating where it is in phase.

    As regard amplitude, the same applies in relative sense to sin/cos amplitude.

    To read the phase you can either compare the vertical components (Re/Im) directly or have an LUT to convert to degrees.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Achievable phase resolultion depends on AD resolution and linearity and also harmonic distortion of the input signal. Assuming an ideal sine input, I expect about 0.1° resolution with 10 a Bit ADC.

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

    in this mode can i measure phase difference range from -180 to 180, or only from 0 to 180?

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

    My estimate is that it will detect phase difference across -180 ~ 180:

        
                  
    ref: sin=0,1,0,-1            cos=1,0,-1,0   
                  
    sig: 0,1,0,-1                 re=0,1,0,1         im=0
          1,0,-1,0                 re=0                 im=1,0,1,0
           0,-1,0,1                re=0,-1,0,-1       im=0
          -1,0,1,0                 re=0                  im=-1,0,-1,0
    

    Thus if you filter off the 120MHz(averaging) you get +dc or -dc of various values within +/-1
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You get the phase as atan(Vim/Vre), by evaluating the sign of Vim and Vre, you get an unique result for the full 0..360° range.

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

    This is the IQ signal graph, for a signal with 0 degree phase.

    The blue line is Vre, and the violet line is the Vim.

    you write "You get the phase as atan(Vim/Vre)".

    Can i get 2 point at any abscissa time, for apply this formula?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I will let FvM answer your question but since I am still awake I will point to these issues:

    your signal seems sort of bipolar ref cos/-sin rather than cos/sin with dc.

    The idea of atan per every sample will give you cyclic results that do not mean much unless you then compare it directly with ref.

    My view is that you need to average the result of demod to remove the 120 MHz tone leaving only dc value that translates to phase through atan im/re and you should therefore settle at a fixed phase value eventually.

    by the way atan is not easy to compute in hardware and you may resort to Lookup table use.