February 9, 2010, 8:03 pm
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
Re: Simulating Sample Jitter
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).
Re: Simulating Sample Jitter
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.
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Re: Simulating Sample Jitter
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
Site Timeline
- » Draft paper submission deadline is extended: ARCS-10, Orlando, USA
- — Next thread in » Industrial Control Group
-

- » Engineering Vibration 3rd Edition Inman Solutions Manual
- — Previous thread in » Industrial Control Group
-

- » Measurement validation for process signals
- — Newest thread in » Industrial Control Group
-

- » A new attraction : "Velo-rail"
- — The site's Newest Thread. Posted in » Model railroading in the UK
-

- » Re: Gegensaetze zwischen Bund und Laender beim Thema Energiewende
- — The site's Last Updated Thread. Posted in » Electrical Engineering (German)
-


Subject







