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
  #151  
Old March 23rd 19, 12:01 AM posted to rec.bicycles.tech
Ralph Barone[_4_]
external usenet poster
 
Posts: 853
Default GPS Units = Show road steepness?

Radey Shouman wrote:
Sir Ridesalot writes:

On Friday, March 22, 2019 at 4:58:23 PM UTC-4, wrote:
On Thursday, March 21, 2019 at 6:15:52 AM UTC-7, AMuzi wrote:
On 3/20/2019 8:28 PM, Radey Shouman wrote:
Ralph Barone writes:

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.


Or just use hundredths of a km as your internal unit and do integer math,
then put the decimal point in the "wrong" place. Judicious choice of units
can sometimes save you some expensive math.

True, if they're using a 4-bit micro it's likely they're using decimal
arithmetic. The fly in the ointment is that if you want to sell in the
US you need to support miles.


Popular bike computers use input in cm (rollout for a road
bike is about 2012cm)and offer choice of either unit for
display. That seems to indicate number manipulation is
metric until final display if miles are selected.

--
Andrew Muzi
www.yellowjersey.org/
Open every day since 1 April, 1971

I agree completely. Metric is so much easier to manipulate. Too bad
here in the US we retain statute measurements.


Here in Canada it used to be simple to figure out how much longer a
car trip would be. That's because the speed limits were 60mph on the
major highways. For every minute you traveled you went one mile. Now
that it's metric it's 100kph. In some instances I prefer the old
measurements.


But officer, I had to do 120 kph to make the arithmetic work out!
Nice hat, by the way.


Let's say that it's 397 km to Sicamous. Slide the decimal point over and
it's 3.97 hours to Sicamous. Call it 4 hours. I don't consider that
particularly mentally taxing.

On the other hand, I've had some spectacular math failures while trying to
do calculations while half-bonked during a bike ride.

Ads
  #152  
Old March 23rd 19, 12:01 AM posted to rec.bicycles.tech
Ralph Barone[_4_]
external usenet poster
 
Posts: 853
Default GPS Units = Show road steepness?

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.

  #153  
Old March 23rd 19, 05:17 PM posted to rec.bicycles.tech
Mark J.
external usenet poster
 
Posts: 840
Default GPS Units = Show road steepness?

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)


  #154  
Old March 23rd 19, 06:02 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 10:17:55 AM UTC-7, 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)


Try representing 15 in base 7.
  #155  
Old March 23rd 19, 06:05 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 10:17:55 AM UTC-7, 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)


Now I'm lost at what we were talking about, but my original point was that it is quite easy to use whole numbers to represent fractions. And you needn't worry about irrational numbers simply by limiting your max number of decimal points displayed.

  #156  
Old March 23rd 19, 06:09 PM posted to rec.bicycles.tech
Ralph Barone[_4_]
external usenet poster
 
Posts: 853
Default GPS Units = Show road steepness?

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.

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.

  #157  
Old March 23rd 19, 08:55 PM posted to rec.bicycles.tech
James[_8_]
external usenet poster
 
Posts: 6,153
Default GPS Units = Show road steepness?

On 24/3/19 5:02 am, wrote:


Try representing 15 in base 7.


21

--
JS
  #158  
Old March 23rd 19, 09:08 PM posted to rec.bicycles.tech
JBeattie
external usenet poster
 
Posts: 5,870
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


Yah, I thought I was missing something.

-- Jay Beattie.
  #159  
Old March 23rd 19, 09:43 PM posted to rec.bicycles.tech
Duane[_4_]
external usenet poster
 
Posts: 1,546
Default GPS Units = Show road steepness?

James wrote:
On 24/3/19 5:02 am, wrote:


Try representing 15 in base 7.


21


Yes but only for some values of 7.



--
duane
  #160  
Old March 23rd 19, 11:08 PM posted to rec.bicycles.tech
Ralph Barone[_4_]
external usenet poster
 
Posts: 853
Default GPS Units = Show road steepness?

jbeattie 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


Yah, I thought I was missing something.

-- Jay Beattie.


For a while now, my wife has been quoting her age in hexadecimal. Between
the ages of 48 and 57, it's quite flattering.

 




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 01: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 08:48 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.