DSPRelated.com
Forums

Simulating Sample Jitter

Started by pnachtwey February 9, 2010
Does anybody have a good way of simulating sample jitter?
I want to beef up my simulations.  Normal distribution isn't good
enough because the distribution isn't skewed and it doesn't allow one
to have a zero probability at 0 and almost 0 at some point in the
future like 25 microseconds and then be able to adjust the where the
peak probability is in between like at 6 microseconds.

Gamma or Beta distributions may work but they required a whole lot of
calculations which slow down a simulation.  Also they are hard to
scale.

I have seen articles on the topic not specifically about the
simulation function used, at least not good ones.

Peter Nachtwey
On Feb 9, 8:03&#4294967295;pm, pnachtwey <pnacht...@gmail.com> wrote:
> Does anybody have a good way of simulating sample jitter? > I want to beef up my simulations. &#4294967295;Normal distribution isn't good > enough because the distribution isn't skewed and it doesn't allow one > to have a zero probability at 0 and almost 0 at some point in the > future like 25 microseconds and then be able to adjust the where the > peak probability is in between like at 6 microseconds. > > Gamma or Beta distributions may work but they required a whole lot of > calculations which slow down a simulation. &#4294967295;Also they are hard to > scale. > > I have seen articles on the topic not specifically about the > simulation function used, at least not good ones. > > Peter Nachtwey
Hi, Peter: If a normal distribution doesn't work for you, and controlling the peaks is important, how about using a pdf that is the sum of two (or more) normal density functions (skewed, if you wish by putting unequal weights under the two bell curves). regards, chip P.S. Note that the sum of the pdf's is not the pdf of the sum of two normally distributed random variables (which would again have a normal distribution).
"pnachtwey" <pnachtwey@gmail.com> wrote in message 
news:07d168e2-a5c1-43d8-ae78-e5f9735a1fd5@t31g2000prh.googlegroups.com...
> Does anybody have a good way of simulating sample jitter? > I want to beef up my simulations. Normal distribution isn't good > enough because the distribution isn't skewed and it doesn't allow one > to have a zero probability at 0 and almost 0 at some point in the > future like 25 microseconds and then be able to adjust the where the > peak probability is in between like at 6 microseconds. > > Gamma or Beta distributions may work but they required a whole lot of > calculations which slow down a simulation. Also they are hard to > scale. > > I have seen articles on the topic not specifically about the > simulation function used, at least not good ones. > > Peter Nachtwey
Depends highly on what your noise source is, or what your channel is. If driven by a clock in a microprocessor, it can be modeled as a flat distribution. a scaled Poisson like may be what you are looking for, with 0 at 0 and 0 at 25
On Feb 9, 5:03 pm, pnachtwey <pnacht...@gmail.com> wrote:
> Does anybody have a good way of simulating sample jitter? > I want to beef up my simulations. Normal distribution isn't good > enough because the distribution isn't skewed and it doesn't allow > one to have a zero probability at 0 and almost 0 at some point > in the future like 25 microseconds and then be able to adjust the > where the peak probability is in between like at 6 microseconds. > > Gamma or Beta distributions may work but they required a whole > lot of calculations which slow down a simulation. Also they are > hard to scale. > > I have seen articles on the topic not specifically about the > simulation function used, at least not good ones. > > Peter Nachtwey
The following pseudocode will give a triangular density on (0,1) with a peak at c. It scales easily: to get it on (0,t) with a peak at s, use c = s/t, then multiply the returned value by t. generate x and y independent uniform(0,1) if x < c then if c*y > x then return c-x else return x else if (1-c)*y > 1-x then return 1-x+c else return x
On Feb 9, 6:10&#4294967295;pm, "harry" <nos...@invalid.com> wrote:
> "pnachtwey" <pnacht...@gmail.com> wrote in message > > news:07d168e2-a5c1-43d8-ae78-e5f9735a1fd5@t31g2000prh.googlegroups.com... > > > Does anybody have a good way of simulating sample jitter? > > I want to beef up my simulations. &#4294967295;Normal distribution isn't good > > enough because the distribution isn't skewed and it doesn't allow one > > to have a zero probability at 0 and almost 0 at some point in the > > future like 25 microseconds and then be able to adjust the where the > > peak probability is in between like at 6 microseconds. > > > Gamma or Beta distributions may work but they required a whole lot of > > calculations which slow down a simulation. &#4294967295;Also they are hard to > > scale. > > > I have seen articles on the topic not specifically about the > > simulation function used, at least not good ones. > > > Peter Nachtwey > > Depends highly on what your noise source is, or what your channel is. > > If driven by a clock in a microprocessor, it can be modeled as a flat > distribution.
Yes, think if responding to interrupts generated by the on board timer of a micro-controller. There will be a distribution of sample times after the interrupt. I doubt is will be flat but more like the poisson distribution you mention below.
> > a scaled Poisson like may be what you are looking for, with 0 at 0 and 0 at > 25
Poisson has the right look but it isn't continuous. Peter Nachtwey I am trying to simulate sample jitter. A CPU generates interrupts at fixed intervals but interrupts may be turned off. Normally interrupts are off for only a short period of time but sometimes they are off long than others.

pnachtwey wrote:
> Does anybody have a good way of simulating sample jitter? > I want to beef up my simulations. Normal distribution isn't good > enough because the distribution isn't skewed and it doesn't allow one > to have a zero probability at 0 and almost 0 at some point in the > future like 25 microseconds and then be able to adjust the where the > peak probability is in between like at 6 microseconds. > > Gamma or Beta distributions may work but they required a whole lot of > calculations which slow down a simulation. Also they are hard to > scale. > > I have seen articles on the topic not specifically about the > simulation function used, at least not good ones.
Calculate a polynomial using uniformly distributed random number as an argument. Chose polynomial coefficients so the result would be an approximation of the desired PDF. A polynomial of the order 3...5 would be probably good enough for practical purpose. In my experience, the pdf is not very important; it is mostly the RMS value that matters. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
On Feb 10, 1:50&#4294967295;am, pnachtwey <pnacht...@gmail.com> wrote:
> On Feb 9, 6:10&#4294967295;pm, "harry" <nos...@invalid.com> wrote: > > > "pnachtwey" <pnacht...@gmail.com> wrote in message > > >news:07d168e2-a5c1-43d8-ae78-e5f9735a1fd5@t31g2000prh.googlegroups.com... > > > > Does anybody have a good way of simulating sample jitter? > > > I want to beef up my simulations. &#4294967295;Normal distribution isn't good > > > enough because the distribution isn't skewed and it doesn't allow one > > > to have a zero probability at 0 and almost 0 at some point in the > > > future like 25 microseconds and then be able to adjust the where the > > > peak probability is in between like at 6 microseconds. > > > > Gamma or Beta distributions may work but they required a whole lot of > > > calculations which slow down a simulation. &#4294967295;Also they are hard to > > > scale. > > > > I have seen articles on the topic not specifically about the > > > simulation function used, at least not good ones. > > > > Peter Nachtwey > > > Depends highly on what your noise source is, or what your channel is. > > > If driven by a clock in a microprocessor, it can be modeled as a flat > > distribution. > > Yes, &#4294967295;think if responding to interrupts generated by the on board > timer of a micro-controller. There will be a distribution of sample > times after the interrupt. &#4294967295;I doubt is will be flat but more like the > poisson distribution you mention below. > > > > > a scaled Poisson like may be what you are looking for, with 0 at 0 and 0 at > > 25 > > Poisson has the right look but it isn't continuous. > > Peter Nachtwey > > I am trying to simulate sample jitter. &#4294967295;A CPU generates interrupts at > fixed intervals but interrupts may be turned off. &#4294967295;Normally interrupts > are off for only a short period of time but sometimes they are off > long than others.
The distribution you are trying to model is not likely to be any of the standard curves. It will likely be multi-modal with small distributions around each mode. For each location in the code where you turn off interrupts for a set time period, you will see a mode in the data for this time period plus the interrupt response time of the processor (which is likely a distribution of its own). If the code has lots of these interrupt disabling code segments which act for different amounts of time, then it may average out to something like a normal distribution. But you are also going to have a number of interrupt responses with interrupts enabled at the time of the interrupt giving a mode corresponding to the native interrupt response time of the processor. I expect it may be a bit like time duration of telephone calls. http://www.bbc.co.uk/dna/h2g2/A956289 scroll to bottom of page. A mode for very short calls, a mode for calls a bit longer (faxes) and the rest tailing off to long times. You case may be even more complex with multiple longer modes corresponding to the different sections of code where interrupts are disabled. Rickfor
very crude, but true!

> The distribution you are trying to model is not likely to be any of > the standard curves. &#4294967295;It will likely be multi-modal with small > distributions around each mode. &#4294967295;For each location in the code where > you turn off interrupts for a set time period, you will see a mode in > the data for this time period plus the interrupt response time of the > processor (which is likely a distribution of its own). &#4294967295;If the code > has lots of these interrupt disabling code segments which act for > different amounts of time, then it may average out to something like a > normal distribution. &#4294967295;But you are also going to have a number of > interrupt responses with interrupts enabled at the time of the > interrupt giving a mode corresponding to the native interrupt response > time of the processor. &#4294967295;I expect it may be a bit like time duration of > telephone calls. > > http://www.bbc.co.uk/dna/h2g2/A956289&#4294967295;scroll to bottom of page. > > A mode for very short calls, a mode for calls a bit longer (faxes) and > the rest tailing off to long times. &#4294967295;You case may be even more complex > with multiple longer modes corresponding to the different sections of > code where interrupts are disabled.
thus: doc EEE doesn't want to believe, that Simon Stevin *defined* _The Decimals_ to have a sole ambiguity: 3.14159999... is the same "real" number as 3.14160000... it also appears in "Dedikind cuts," I think; thus, the Surreals! thus: I did not follow the meaning of your terms, but it seems like a good approach, using the mean-value theorem; however, "the" fixed-point th. is an easy proof in, what?, analysis texts (but I'm not allowed to googol that .-) and, there are probably dozens or hundreds of kinds of FP theorems; eh? --les Oeuvres! http://wlym.com
"Vladimir Vassilevsky" <nospam@nowhere.com> wrote in message 
news:Cc6dnUQ_mqH5R-_WnZ2dnUVZ_tqdnZ2d@giganews.com...
>
>In my experience, the pdf is not very important; it is mostly the RMS value >that matters.
agree - It dosent have to match exactly, but generally, also checkout Erlang queing (a,b and c) may be overkill "Poisson like" is what you need wiki "poisson distribution" - has a generator there
> > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultant > http://www.abvolt.com
On Feb 9, 7:03&#4294967295;pm, pnachtwey <pnacht...@gmail.com> wrote:
> Does anybody have a good way of simulating sample jitter? > I want to beef up my simulations. &#4294967295;Normal distribution isn't good > enough because the distribution isn't skewed and it doesn't allow one > to have a zero probability at 0 and almost 0 at some point in the > future like 25 microseconds and then be able to adjust the where the > peak probability is in between like at 6 microseconds. > > Gamma or Beta distributions may work but they required a whole lot of > calculations which slow down a simulation. &#4294967295;Also they are hard to > scale. > > I have seen articles on the topic not specifically about the > simulation function used, at least not good ones. > > Peter Nachtwey
Jitter PSFs are often, if not typically, spatially variant. Spatial variance can be seen in this example: http://www.general-cathexis.com/images/DSC00115.png