# Simulating Sample Jitter

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
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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).
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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.

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.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

.
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
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
very crude, but true!

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
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
pnachtwey wrote:

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
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

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

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Sorry, I thought I was in the image processing group.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

we usually modeled Jitter as a flat distribution
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On Tue, 09 Feb 2010 17:03:56 -0800, pnachtwey wrote:

It sounds like you know the _way_ you want to simulate jitter, but are looking for good distributions to use that won't bring your simulation speed to it's knees -- is this correct?
You could probably get by with something approximate -- what about a three or four point, piecewise linear function that operates on a uniform RV such as you'd get from 'rand'?
--
www.wescottdesign.com

<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Yes
OK, I have found out that what I am trying to do is not something that is cook book. I will probably using the technique Vladimir suggested where a random number generated is used to generate a number between 0 to 1 and then use that to index into a cumulative distribution function ( CDF ) that provides a profile I like that provides delays of 0 to say 25 microseconds with a peak around 6 microseconds.
I agree that the distribution may be multi modal but like Tim said I don't to slow down my simulation too much.
Peter Nachtwey
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

Hmmm... so you prefer to have a fast simulation of a questionable distribution than a slower simulation of a more realistic distribution...
Can I ask what you plan to do with this simulation? Can you explain what you are trying to understand from your simulations? That may make it more clear how much of a compromise you can safely make.
Rick
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

I/we have two uses. I want to use if for simulating sample jitter. Another person has said it would be interesting do see the effects of delay between the sample time and the output time.
As far as being realistic I would say none are realistic. The executed code changes the distribution changes. I have used this information is the past is to estimate a measurement error covariance for Kalman filters.
I think this deserves another thread. A poll.
Peter Nachtwey
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
On Tue, 9 Feb 2010 17:03:56 -0800 (PST), pnachtwey

You might consider the Weibull distribution. It's quite simple, being defined by an exponential function, it's one sided, and it has a 'slope' parameter that yields a variety of distribution shapes.
dave y.
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

I like it. The best part is that the inverse cumulative distribution function is easy to implement and shouldn't take too much time and scale parameter makes it easy to adjust the where the peak probability occurs. http://en.wikipedia.org/wiki/Weibull_distribution
Peter Nachtwey