Re: pseudo random number between X and Y?
- From: Jon Kirwan <jonk@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Nov 2009 17:39:53 -0800
On Wed, 18 Nov 2009 15:23:39 -0800 (PST), rickman <gnuarm@xxxxxxxxx>
wrote:
On Nov 18, 5:43 pm, Jon Kirwan <j...@xxxxxxxxxxxxxxxxxxx> wrote:
On Wed, 18 Nov 2009 12:18:20 -0800 (PST), rickman <gnu...@xxxxxxxxx>
wrote:
On Nov 17, 9:33 am, Vladimir Vassilevsky <nos...@xxxxxxxxxxx> wrote:
Abandon this task. It is not for the sorrow programmers like you.
Vladimir Vassilevsky
DSP and Mixed Signal Design Consultanthttp://www.abvolt.com
Even with all the spam I have to parse through on the Google groups
page, I have never considered going back to a newsreader. But this
might just be a good reason, to be able to killfile someone... I
wonder who...
But then I am just feeding the troll, so maybe I should killfile
myself...
Rick
I've wondered why he bothers. It doesn't often appear to be for
teaching anyone.
He has a point if you take his assumptions. It's kind of a sad
comment on the general state of embedded programming affairs, if you
assume the OP is someone who is charged with the engineering of a
system of RF boards and is then asking about how to generate a random
delay. The assumption may be false, though. It's possible this is
someone who knows their application space well but isn't an engineer
-- more of an integrator?? -- and who could use a gentle clue. It's
also possible that the OP is asking for practical experience and just
stating it poorly. Still, it does beg a few questions.
Since I've now bothered writing at all, the OP may google up "linear
congruential generator" (LCG) and keep in mind also the basic idea of
a linear expression that yields something within a specified range,
X+(Y-X)*(R-Rmin)/(Rmax-Rmin+1), where the X and Y are his own values
from his post and the Rmax and Rmin are the minimum and maximum values
that the LCG produces. Rmin is often 0, but not always. The
expression assumes real numbers. If integers are exclusively used,
finding an LCG with a nice (Rmax-Rmin+1)=2^N, with N a positive
integer, might help somewhat. Scaling to produce a desired precision
in milliseconds may also be warranted. Also, I very much support
another poster's comment about reading Donald Knuth's volume on
Seminumerical Algorithms from the early 1970's (I completely read his
three books, cover to cover including the long discussions on tape
sorting, when they came out and they added a lot to my earlier
education.)
Jon
I don't care what the issue is, VV's approach is rude and accomplishes
nothing. I wish he would just go away unless he is willing to
actually help someone. There are any number of things I am ignorant
about in the field of EE which I have been earning a living in for 30
years. Does that make me stupid? That is why we are here for the
most part I think, to learn things we don't know.
I know that school taught me a lot of basics, but I have learned all
the practical stuff while working. Does that mean my schooling was
lacking?
There are any number of reasons why someone posts angry replies.
Regardless, they reflect badly on the poster and annoy the rest of
us.
Gotcha, Rick, and understood. Largely agreed.
* While I'm at it, to the OP: You can combine the LCG's equation with
the linear one used to provide a chosen range into a single linear
expression with the same operation count as only one would require.
Some care may be needed, though, to retain bits appropriately.
Jon
.
- References:
- pseudo random number between X and Y?
- From: Go Rf
- Re: pseudo random number between X and Y?
- From: Vladimir Vassilevsky
- Re: pseudo random number between X and Y?
- From: rickman
- Re: pseudo random number between X and Y?
- From: Jon Kirwan
- Re: pseudo random number between X and Y?
- From: rickman
- pseudo random number between X and Y?
- Prev by Date: Re: pseudo random number between X and Y?
- Next by Date: Re: NIOS and ftoa()
- Previous by thread: Re: pseudo random number between X and Y?
- Next by thread: Re: pseudo random number between X and Y?
- Index(es):
Relevant Pages
|