A Cycling & bikes forum. CycleBanter.com

Go Back   Home » CycleBanter.com forum » rec.bicycles » Techniques
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

GPS Units = Show road steepness?



 
 
Thread Tools Display Modes
  #161  
Old March 24th 19, 02:35 AM posted to rec.bicycles.tech
Mark J.
external usenet poster
 
Posts: 840
Default GPS Units = Show road steepness?

On 3/23/2019 11:09 AM, Ralph Barone wrote:
Mark J. wrote:
On 3/22/2019 5:01 PM, Ralph Barone wrote:
Radey Shouman wrote:
writes:

On Wednesday, March 20, 2019 at 5:53:52 PM UTC-7, Radey Shouman wrote:
James writes:

On 21/3/19 3:37 am,
wrote:
On Tuesday, March 19, 2019 at 1:58:13 PM UTC-7, James wrote:
On 20/3/19 4:20 am, Radey Shouman wrote:
writes: [ ... ]

averages in particular. And I think that it was Radey talking
about using IIR which would require a high end FPGA wouldn't
it? I'm buying a new, wireless VDO for $50.

An IIR can be very simple to implement. The "leaky integrator"
or "exponential filter" is probably the simplest digital low-pass
filter possible:

y_i = y_{i-1} + k (x_i - y_{i-1})

In C:

y += k*(x - y);

If you're not too fussed about the actual cutoff frequency the
multiplication can be done as a shift. The precision used for
the state, y, does need to be higher than that of the input.

If you need precise control over the frequency response then more
work in design and more expense in implementation is needed, but
not always.


y(i) = y(i-1) + k.x(i) - k.y(i-1)

y(i) = y(i-1) - k.y(i-1) + k.x(i)

k is usually a fraction, 0 k 1. To avoid floating point
arithmetic and division, if you make it a binary fraction (1/2,
1/4, 1/8, 1/16, etc), you can implement the filter with bit shifts,
and addition and subtraction only.

-- JS

Don't you think that it would all be a great deal easier to handle by
multiplying it enough to make them whole numbers and then displaying
them as if they had been fractional?


Can you illustrate your point with an example?

Sounds like fixed point arithmetic to me. Suppose you want to
represent signed numbers with 16 bits, 8 of them fractional.
1.0 is represented as 256. 0.5 is represented as 128.

If you multiply two 8.8 numbers together, you get a 16.16 number, shift
right by 8, check for overflow, and you have another 8.8 number.

--

Remember that multiplying and dividing in binary doesn't really exist
and is a pain in the butt. So there are all sorts of shortcuts to make
adding and subtracting operate using less time.

Multiplying and dividing in binary makes perfect sense. Students and
masochists do it on paper.

Of course MPU's do this all in hardware. Although I haven't looked
into it in a very long time I remember MPU's as being really hardware
intense.


Yeah, binary's not so bad. Try doing long division in hex or base 7 for
extra points.

For an instant migraine, I once read that a given number may not have a
unique representation in an irrational base.


Don't need an irrational base, you can even do it in base 10:

For example, 23.1999... (with the 9's repeating forever) equals 23.2,
exactly.

This topic is/was the source of endless arguments in ?sci.math? - it's
been so long I've forgotten the group name.

This is also a standard topic in a 3rd-4th year Real Analysis class, and
there are plenty of FAQ web pages if you'd like to review the many valid
arguments/proofs.

In fact, in any simple base (e.g. 2, 8, 16, 3, etc.) any terminating
(non-repeating) representation has an equivalent repeating
representation. I'd have to think a while as to whether this holds for,
say, irrational bases, though as I recall, some odd stuff happens there.

Finally, none of this has any relevance for microprocessors that
(inherently) carry a finite number of digits.

Mark J. (I taught this stuff for years)


Hi Mark. Math isn't my main thing, just a tool I keep in a box and pull out
sometimes, so I'd forgotten about the alternate representation for
terminating real numbers (that's probably not what they're actually called,
but I hope you get my gist). However, when trying to find the web page
that I'd gotten the original quote from, I came across this:

"A non-integer representation uses non-integer numbers as the radix, or
bases, of a positional numeral system.

The numbers di are non-negative integers less than β. This is also known as
a β-expansion, a notion introduced by Rényi (1957) and first studied in
detail by Parry (1960). Every real number has at least one (possibly
infinite) β-expansion."

So in a non-integer base, a given number may not just have two
representations, but an infinite number of them.


I think what your source meant here is that every real number has at
least one β-expansion, though it might (and often will) be infinitely
/long/ (infinitely many digits). I think (but am not 100% sure at the
moment) that the dual-representation trick I mentioned earlier for
integer bases often won't work (in fact, probably never) for irrational
bases.

Anyway, I do agree that this has nothing to do with cycling computers or
cycling at all, but it's at least a more civil discussion than who's going
to punch who in the head if they ever meet in person. Have a great day.


You too!

Mark J.


Ads
  #162  
Old March 25th 19, 07:56 PM posted to rec.bicycles.tech
[email protected]
external usenet poster
 
Posts: 1,261
Default GPS Units = Show road steepness?

On Saturday, March 23, 2019 at 1:55:57 PM UTC-7, James wrote:
On 24/3/19 5:02 am, wrote:


Try representing 15 in base 7.


21

--
JS


Good, then divide 15 by 7 in base 19.
  #163  
Old March 27th 19, 12:33 AM posted to rec.bicycles.tech
[email protected]
external usenet poster
 
Posts: 1,261
Default GPS Units = Show road steepness?

On Monday, March 25, 2019 at 11:56:27 AM UTC-7, wrote:
On Saturday, March 23, 2019 at 1:55:57 PM UTC-7, James wrote:
On 24/3/19 5:02 am, wrote:


Try representing 15 in base 7.


21

--
JS


Good, then divide 15 by 7 in base 19.


Rounded off it is 3.428571428571428571428571428571428574285714285742 857142857

You might see something about those numbers.
  #164  
Old March 27th 19, 12:36 AM posted to rec.bicycles.tech
[email protected]
external usenet poster
 
Posts: 1,261
Default GPS Units = Show road steepness?

On Monday, March 25, 2019 at 11:56:27 AM UTC-7, wrote:
On Saturday, March 23, 2019 at 1:55:57 PM UTC-7, James wrote:
On 24/3/19 5:02 am, wrote:


Try representing 15 in base 7.


21

--
JS


Good, then divide 15 by 7 in base 19.


The answer rounded off is
3.428571428574285714285742857142857428571428574285 71428574285714285742857142857

You might notice something about those numbers.
  #169  
Old March 27th 19, 11:14 PM posted to rec.bicycles.tech
James[_8_]
external usenet poster
 
Posts: 6,153
Default GPS Units = Show road steepness?

On 27/3/19 1:04 pm, Sir Ridesalot wrote:


I figure that any new thread is lucky to get three replies before it wanders way off topic.

Cheers


There's possibly a law for that.

--
JS
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pothole gardener stars on Road Rage TV show Alycidon UK 0 February 10th 16 02:12 PM
Show off now faces arrest after road damage Alycidon UK 5 October 5th 15 11:00 PM
gps units recycled[_2_] General 1 July 26th 09 11:59 PM
FS: 2 Polar Power units Andre Marketplace 0 June 17th 05 12:13 AM
FS: 2 polar power units Andre Marketplace 0 June 11th 05 10:49 PM


All times are GMT +1. The time now is 07:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 CycleBanter.com.
The comments are property of their posters.