Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

mul vs div

DSP related issues, mathematics, processing and techniques

mul vs div

Postby MichaelBenjamin » Wed Jun 10, 2020 9:55 pm

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:50 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: mul vs div

Postby wlangfor@uoguelph.ca » Thu Jun 11, 2020 2:30 pm

excellent thanks :) I needed something like this
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: mul vs div

Postby MichaelBenjamin » Tue Jun 16, 2020 9:39 pm

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:51 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: mul vs div

Postby HughBanton » Wed Jun 17, 2020 2:59 pm

In FS 3.06, if you substitute a double precision subtract in the final position the error goes away.

Curiously in FS64 you have to substitute all 3 elements (mult, div, sub) to get the same result.

Just an observation .. I'm not much of yer maths guy :?. But all is clearly not quite as it seems.

H
User avatar
HughBanton
 
Posts: 265
Joined: Sat Apr 12, 2008 3:10 pm
Location: Evesham, Worcestershire

Re: mul vs div

Postby wlangfor@uoguelph.ca » Wed Jun 17, 2020 9:21 pm

Indeed, when working with co-efficents it becomes very clear that only using a divisible float value is realistic, but like you said; anything beyond a bipolar .5 is erratic. I was trying to get a negative pi to round more effectively and was sobered by only being able to find a suitable balance. But the balance will never be good, and especially after seeing the results in the highest sample rates; lesser sample rates suffer for the compensation.

Actually I'd come up with something interesting and if I remember in the correct way I'll let you know. I think I was rounding larger numbers into 100'ths and then using mere floats with three decimals, maybe. It's been so long since I gave it any thought; but at the time I mused that perhaps it was practical. Because only in the float's spectrum is it viable.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: mul vs div

Postby wlangfor@uoguelph.ca » Thu Jun 18, 2020 8:29 pm

I gave it more thought, convert all floats to one thousand million so as to increase amounts of decimals and then when done divide to the right number. Double precision without double precision!

Whoa woot!
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: mul vs div

Postby MichaelBenjamin » Fri Jun 19, 2020 1:42 am

.
Last edited by MichaelBenjamin on Mon Sep 21, 2020 10:52 am, edited 1 time in total.
MichaelBenjamin
 
Posts: 275
Joined: Tue Jul 13, 2010 1:32 pm

Re: mul vs div

Postby trogluddite » Fri Jun 19, 2020 2:34 pm

I gave it more thought, convert all floats to one thousand million so as to increase amounts of decimals and then when done divide to the right number. Double precision without double precision!

If that worked, there would be no need for double precision! The precision of floats is best thought of as a number of "significant digits", not as a number of "decimal places". Single-precision float have about 6-7 significant decimal digits; so if you multiply a single-precision float by one thousand million, the final three integer digits and everything after the decimal point will always be zeros.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: mul vs div

Postby wlangfor@uoguelph.ca » Fri Jun 19, 2020 9:30 pm

trogluddite wrote:
I gave it more thought, convert all floats to one thousand million so as to increase amounts of decimals and then when done divide to the right number. Double precision without double precision!

If that worked, there would be no need for double precision! The precision of floats is best thought of as a number of "significant digits", not as a number of "decimal places". Single-precision float have about 6-7 significant decimal digits; so if you multiply a single-precision float by one thousand million, the final three integer digits and everything after the decimal point will always be zeros.


If you make sure every number is that way then there's more decimal points when divided by the same number afrter the fact. it's the same as double, because there is less decimals involved.
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: mul vs div

Postby trogluddite » Sat Jun 20, 2020 2:25 pm

You can't change the precision of multiplication or division by "moving the decimal point" (unless the infinity or denormal zones are involved). That's the entire point of floating point numbers - the error is always approximately relative to the magnitude (an epsilon, not a delta). Your proposed scaling would do nothing more than insert two more operations where rounding errors could occur.

Michael has already shown you an ideal way to test this - you can experiment with different scaling methods on one path of his schematic to see the results very plainly.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Next

Return to DSP

Who is online

Users browsing this forum: No registered users and 22 guests