Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21609 Discussions

phase difference 2 signals.

Altera_Forum
Honored Contributor II
4,426 Views

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
0 Kudos
19 Replies
Altera_Forum
Honored Contributor II
3,599 Views

1) time domain option is unlikely to have good resolution since 60MHz running at sampling freq of say 240MHz means only 4 samples per cycle. 

 

2) fft option may be better. You can model that in matlab: generate stimulus then apply fft and see phase.
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

Is there any reason why these two signals are pulsed sinusoids? 

 

If this is a ranging application, then an FM chirp (linear FM pulse) would be more appropriate. Pulse compression of the FM chirp (correlation) then results in delta-function like responses (with a width determined by the pulse bandwidth). The 'time delay' between the delta functions can then be determined. 

 

Pseudo-random sequences can also be transmitted and pulse compressed in this manner. 

 

What are you trying to do? 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

tnx to all! 

i must analize 3 (or 4) PULSED-RADAR-signals. The minimum duration of signals is 0,5 uSEC (typ 1 uSEC). i need to measure the amplitude and and the phase of these signals, referenced at 1 CW (continuos sinusoidal wave) generated by 1 reference-local-oscillator (60 MHz). 

 

In analogic circuit i have not problem, using AD8302(analog devices chip), but i need do it in digital world whit fpga.. 

 

tnx!!
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

If you have matlab, you can try this code (not tested): 

 

%assuming Fs = 240Msps 

%signal 1 

offset = 100; 

x1 = sin(2*pi*(0+offset:200000+offset)*60/240); 

x1(1000:1000:end) = 0; %switch off 

 

%ref 

xref = sin(2*pi*(0:200000)*60/240); 

 

y1 = fft(x1,1024); 

y2 = fft(xref,1024); 

 

A1 = abs(y1); 

A2 = abs(y2); 

ph1 = angle(y1); 

ph2 = angle(y2); 

 

you will then check A/ph at relevant bin
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

In my opinion, FFT is a rather longwinded method to analyze the phase of a known frequency sine signal. Quadrature demodulation would allow an accurate amplitude and phase measurement.

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

That is a good point. You mean demodulate signal to its two I/Q components and demodulate reference similarly then check phase/amplitude. 

 

It eventually depends on application resolution and noise level. Demodulation may need filtering the sideband.
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

but do i need a IQ anoligic demodulator?

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

you can do digital one if you afford the speed

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

I/Q demodulation is done my multiplying the input signal with 0° and 90° reference sine. If you manage to sample the input at fs = 240 MHz, the operation simplifies to processing the odd and even samples. Gating according to the signal enevlope would be necessary in any case.

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

at 240MSPS and 60MHz I/Q reference signal, can i measure phase veriation of 1 degree and amplitude variation of 1 db?

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

tnx. 

i see AD8348 datasheet, I/Q demodulator chip. 

 

You think that could work, for my application?
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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.

0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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?
0 Kudos
Altera_Forum
Honored Contributor II
3,599 Views

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.
0 Kudos
Reply