DSPRelated.com
Forums

Calculating time intervals in multiple pulsetrains?

Started by Emil Tin June 27, 2003
Suppose we have several periodic pulsetrains, each with a different but
fixed frequency. Assume they all start with phase=0 at time=0.

If we combine all pulse trains into a single signal, would there be an
efficient way to compute time interval between pulses, without keeping
track of phases of  all individual pulsetrains?
The algorithm would not require the phase of each individual pusletrain
to be stored, but instead simply store frequencies, and produce a
series of intervals. (Perhaps using only a couple of counters.)


Any ideas?

Thanks,
Emil
Emil Tin wrote:
> > Suppose we have several periodic pulsetrains, each with a different but > fixed frequency. Assume they all start with phase=0 at time=0. > > If we combine all pulse trains into a single signal, would there be an > efficient way to compute time interval between pulses, without keeping > track of phases of all individual pulsetrains? > The algorithm would not require the phase of each individual pusletrain > to be stored, but instead simply store frequencies, and produce a > series of intervals. (Perhaps using only a couple of counters.) > > Any ideas? > > Thanks, > Emil
You need to define what you mean by phase in this context, and it would help if you provided a clearer description of what you expect to see. How many pulse trains do you contemplate? What are their duty cycles? At any instant, do you have the sum of the pulses, or does the amplitude saturate? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Use a single master clock, instead of many phases, like so:

For each generator, remember its frequency and time-of-next-pulse.

Keep generators in a priority queue, with the highest priority assigned to
the one with the soonest time-of-next-pulse.

Repeat: generate the pulse for the highest priority generator, and then
adjust that generator's time-of-next-pulse and priority.




Emil Tin wrote:
> > Suppose we have several periodic pulsetrains, each with a different but > fixed frequency. Assume they all start with phase=0 at time=0. > > If we combine all pulse trains into a single signal, would there be an > efficient way to compute time interval between pulses, without keeping > track of phases of all individual pulsetrains? > The algorithm would not require the phase of each individual pusletrain > to be stored, but instead simply store frequencies, and produce a > series of intervals. (Perhaps using only a couple of counters.) > > Any ideas? > > Thanks, > Emil
Dead Simple. Take an interval [n,n+1] as a period. Compare with the rest of sequence to see if it is matching this period. If yes, then you have determined one of the periods. If no, then take [n,n+2] as a period. Compare it. And so on until you find all periods. Vladimir Vassilevsky, Ph.D. DSP and Mixed Signal Design Consultant http://www.abvolt.com
"Emil Tin" <eti@homebase.dk> wrote in message
news:270620032004571804%eti@homebase.dk...
> > Suppose we have several periodic pulsetrains, each with a different but > fixed frequency. Assume they all start with phase=0 at time=0. > > If we combine all pulse trains into a single signal, would there be an > efficient way to compute time interval between pulses, without keeping > track of phases of all individual pulsetrains? > The algorithm would not require the phase of each individual pusletrain > to be stored, but instead simply store frequencies, and produce a > series of intervals. (Perhaps using only a couple of counters.) > > > Any ideas?
This is a pretty well-studied problem in EW. Do google search for "pulse train deinterleaving" or "pulse repetition interval estimation". See, for example, the reference list of: http://www.icspat.com/papers/357mfi.pdf Ciao, Peter K. -- Peter J. Kootsookos "Na, na na na na na na, na na na na" - 'Hey Jude', Lennon/McCartney
i'm thinking about simple pulse trains of pulses with amplitude 1
occuring at fixed intervals (the frequency of the pulse train).
they will not have any duty cycle (pulse width=0) - really its just the
start times of pulses i'm interested in calculating efficiently.

by saying thay all start with phase=0 at time=0 i mean all pulse trains
emit a pulse at time 0.

i would typically use less than 100 pulsetrains.

so we have a series of pulses spaced in time, and im interested in the
time between an event and the next event (a delta time value). the
absolute start times would work as well, but my guess is it would be
easier to work with delta times values.


as an example, look at two pulsetrains with freq 1.0 and 0.9.
pulses would occur at times:
0.0 (two pulses at the same time)
0.9
1.0
1.8
2.0
2.7
3.0 .... and so on

So therefore, the delta time between pulses would be:

0.0 (the first two pulses occur at the same time)
0.9
0.1
0.8
0.2
0.7
0.3
0.6
0.4   ... and so on...

clearly there is a simple pattern that can be generated
algorithmically. however for more complex examples, i'm not sure how to
do it, but feel there should be a way? for example by cycling thru the
list of frequencies and using these to calculate the next delta time.


i hope this makes it clearer. i wish a had a clear mathematical way of
expressing what i want to do, but i'm afraid i don't...


thanks in advance,
emil





In article <3EFC93F0.FD131757@ieee.org>, Jerry Avins <jya@ieee.org>
wrote:

> Emil Tin wrote: > > > > Suppose we have several periodic pulsetrains, each with a different but > > fixed frequency. Assume they all start with phase=0 at time=0. > > > > If we combine all pulse trains into a single signal, would there be an > > efficient way to compute time interval between pulses, without keeping > > track of phases of all individual pulsetrains? > > The algorithm would not require the phase of each individual pusletrain > > to be stored, but instead simply store frequencies, and produce a > > series of intervals. (Perhaps using only a couple of counters.) > > > > Any ideas? > > > > Thanks, > > Emil > > You need to define what you mean by phase in this context, and it would > help if you provided a clearer description of what you expect to see. > > How many pulse trains do you contemplate? > > What are their duty cycles? > > At any instant, do you have the sum of the pulses, or does the amplitude > saturate? > > Jerry
yes, that would surely work!

however, i'm wondering if there's a way of doing it, that would not
require time-of-next-pulse to be stored and manipulated for each pulse
train?

consider this simple algorithm:

freq1 =  1.0;
freq2 =   0.9;

k           =  freq2;         //used to alternate between freq1 and 2
delta    =  0;

for(....)
{
   //generate next delta:
   delta    =     k-delta;

   //alternate between freqs:
   if( k==freq1)
      k  =  freq2;
   else
      k  =  freq1;
}

it will generate this sequence of deltas:

0.9
0.1
0.8
0.2
0.7
0.3
0.6
0.4......... and so on.

which happens to be the correct time deltas for two combined pulse
trains with freq 1.0 and 0.9 - but only for the first little while, so
the algorithm is not fully useful, but hopefully it shows where i'm
hoping to go.


thanks,
emil

In article <Qz5La.5767$iM4.908328@news20.bellglobal.com>, Matt
Timmermans <mt0000@sympatico.nospam-remove.ca> wrote:

> Use a single master clock, instead of many phases, like so: > > For each generator, remember its frequency and time-of-next-pulse. > > Keep generators in a priority queue, with the highest priority assigned to > the one with the soonest time-of-next-pulse. > > Repeat: generate the pulse for the highest priority generator, and then > adjust that generator's time-of-next-pulse and priority.
In article <3EFD1E85.343DAFBE@abvolt.com>, Vladimir Vassilevsky
<vlv@abvolt.com> wrote:

> Emil Tin wrote: > > > > Suppose we have several periodic pulsetrains, each with a different but > > fixed frequency. Assume they all start with phase=0 at time=0. > > > > If we combine all pulse trains into a single signal, would there be an > > efficient way to compute time interval between pulses, without keeping > > track of phases of all individual pulsetrains? > > The algorithm would not require the phase of each individual pusletrain > > to be stored, but instead simply store frequencies, and produce a > > series of intervals. (Perhaps using only a couple of counters.) > > > > Any ideas? > > > > Thanks, > > Emil > > Dead Simple. > > Take an interval [n,n+1] as a period. Compare with the rest of sequence > to see if it is matching this period. If yes, then you have determined > one of the periods. If no, then take [n,n+2] as a period. Compare it. > And so on until you find all periods. > > Vladimir Vassilevsky, Ph.D. > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com
i'm sure i understand that..? it would be great of you could explain a little more. thanks, emil
In article <270620032004571804%eti@homebase.dk>, Emil Tin
<eti@homebase.dk> wrote:

> Suppose we have several periodic pulsetrains, each with a different but > fixed frequency. Assume they all start with phase=0 at time=0. > > If we combine all pulse trains into a single signal, would there be an > efficient way to compute time interval between pulses, without keeping > track of phases of all individual pulsetrains? > The algorithm would not require the phase of each individual pusletrain > to be stored, but instead simply store frequencies, and produce a > series of intervals. (Perhaps using only a couple of counters.) > > > Any ideas? > > Thanks, > Emil
perhaps i should make it clear that i'm not trying to analyze a signal, and determine what pulsetrains are present. rather, i want to synthesize a signal containing pulsetrains with frequencies i control. sorry if this was unclear. -emil
"Emil Tin" <eti@homebase.dk> wrote in message
news:280620032145247959%eti@homebase.dk...
> > yes, that would surely work! > > however, i'm wondering if there's a way of doing it, that would not > require time-of-next-pulse to be stored and manipulated for each pulse > train?
Why?