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.

phase difference between to rectangular pulse trains

Status
Not open for further replies.

kalyansrinivas

Advanced Member level 4
Joined
Jul 7, 2007
Messages
100
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
1,910
phase difference between two rectangular pulse trains

Dear all

How to find the phase difference between two rectangular pulse trains which has same frequency but different phase

regards
M Kalyansrinivas
 

Hi kalyansrinivas,

If you want to do it using software, do as follows:

Wait for input A to become high and once A becomes high start a timer. If input B is already high, wait until it goes low and when it again goes high, stop the timer. The timer value will give the phase difference.

If you want an implementation using logic gates:

The simplest method is to connect the inputs to an XOR gate and measure the high time of the output which is done in the phase comparator of a PLL. But this needs both the inputs to be square pulses (50% duty cycle). Since you have rectangular pulses, you may first convert them to square pulses using D flip-flops wired as divide by 2 circuit and then feeding the outputs to XOR gate.
See the circuit diagram attached.

20_1294128863.jpg
 
Hi Thank you

But i am not looking for digital design side.

I am looking for mathematical model using matlab

I have taken 4 rectangular pulse trains using "pulsetran" function of matlab with a equal phase difference betwen them

Than i have taken the fft of the four pulse trains

Than i observed the phase differnce between the bins of fft

Please comment wether this method is correct for finding out the phase differnce between two rectangular pulsetrains

regards
M Kalyansrinivas
 

Hi kalyan srinivas,
Can you attach the images of the FFT for the four pulse trains ?

Hi matbob,
Which simulation software did you use for realizing digital logic ?

Thanks,
-sv
 

Hi sv1437,

I used Proteus(v7.5) from Labcenter Electronics.
 
  • Like
Reactions: sv1437

    sv1437

    Points: 2
    Helpful Answer Positive Rating
Hi sv
I am attaching the fft of pulsetrain waveform i obtained and also a sine wave

I see a lot of noise in the spectrum of pulsetrain compared to sine wave

Is there a method to supress this noise in the spectrum of rectangular pulse train

regards
M Kalyansrinivas
 

Attachments

  • Sin_wave.JPG
    Sin_wave.JPG
    47.6 KB · Views: 124
  • rect_fft.JPG
    rect_fft.JPG
    56.1 KB · Views: 119
Last edited:

You can design some digital filter to suppress the harmonics. In matlab you can use "fdatool".
 

Hello,

I am recently searching on something similar to this, actually PFD architecture but unfortunately stuck in a very basic issue (due to my poor knowledge in digital electronics). I was going through a document where writer discussed on XOR gate.

The document says "XOR response can be split into a 2X term and a residual term"; can someone elaborate this? A XOR B = (A+B)(AB bar) right? but can't figure out which term is what and how to take average of "residual" term?

Thanks in advance,
 

Hi all,

@ Kalyansrinivas: The spectrum is OK. That is no noise; you can see the harmonics of the signal and the effect that the sampling frequency is not a multiple of the fundamental. It seems you are not using windowing before the FFT.

@ Sudip: It should be seen in the context, but I guess that "XOR response can be split into a 2X term and a residual term" refers to tha fact that the ouput contains a component of double-frequency (2X term) and a d.c. component (residual).

Regards

Z
 
  • Like
Reactions: sudip

    sudip

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top