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

Ruby related euler constant question

For general discussion related FlowStone

Ruby related euler constant question

Postby wlangfor@uoguelph.ca » Fri Aug 23, 2019 2:28 pm

Download VST: LA Bands 15 Band EQ
My Website http://www.leattol.com
User avatar
wlangfor@uoguelph.ca
 
Posts: 584
Joined: Tue Apr 03, 2018 5:50 pm
Location: Penetanguishene, Ontario, Canada

Re: Ruby related euler constant question

Postby trogluddite » Fri Aug 23, 2019 6:55 pm

TBH, I have to agree with what Quora says - it's not at all clear what you're asking. You seem to want to know how to translate some algebra into code; but then, rather than providing an example of an algebraic formula that you're trying to translate, you provide some (broken?) code with no indication of what you expect it to do nor what you intend to use it for.

If you want a specific formula translating for a specific application, then you need to say what those are, and then we can try to help you. OTOH, if you want to know in general how Euler's constant is used, no answer is possible without using algebra - and when it's used in DSP equations, that usually means having to understand the maths of imaginary/complex numbers (it's a bit of a circular problem*, I realise, but unfortunately there's no avoiding that.)

(* Maths geek pun unintentional!)
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: 1282
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby related euler constant question

Postby wlangfor@uoguelph.ca » Fri Aug 23, 2019 7:31 pm

Well, it only converts the numbers into a float using euler's. My real question is why it deviates.

Please check My limiter called esquire for a working example. It would seem that would be the best way of explaining:
http://dsprobotics.com/support/viewtopic.php?f=3&t=16533&p=52541&hilit=esquire#p52541

I was in a rush when posting, sorry. But You'll see what I am saying. I'll make some images etc so as to make it clearer if that is required.
Download VST: LA Bands 15 Band EQ
My Website http://www.leattol.com
User avatar
wlangfor@uoguelph.ca
 
Posts: 584
Joined: Tue Apr 03, 2018 5:50 pm
Location: Penetanguishene, Ontario, Canada

Re: Ruby related euler constant question

Postby trogluddite » Fri Aug 23, 2019 8:12 pm

Aah, yes I see now - not so bad then. It's just that the Quora code example looked very similar to one of the very common Euler equations which is much more complex* to explain mathematically.

If you're seeing a difference in value between Ruby and, say, the same calculation done with 'green' floats, it's probably just because of number precision. Ruby Float numbers are always 64-bit ("double-precision"), even in 32-bit versions of FlowStone, and Ruby might also use a different version of the function for raising to a power. Because of that, there will be slight differences in the result depending which method you use to do the calculation, because they will round-off the values differently. This can be a problem sometimes for very small numbers, because a small 64-bit number might get rounded down to zero (or a denormal number) when truncated to 32-bits - and zero is often a bit of a problem number for mathematical equations!

If you need to use Euler's constant in 'green' maths, you can just put its value into a 'float' box, but 32-bit green will always round it to roughly 6 significant digits in practice (2.71828).

(* Maths geek pun intended this time!)
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: 1282
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby related euler constant question

Postby wlangfor@uoguelph.ca » Sat Aug 24, 2019 2:05 am

Yep, I just have to find a practical solution.
Download VST: LA Bands 15 Band EQ
My Website http://www.leattol.com
User avatar
wlangfor@uoguelph.ca
 
Posts: 584
Joined: Tue Apr 03, 2018 5:50 pm
Location: Penetanguishene, Ontario, Canada


Return to General

Who is online

Users browsing this forum: Lex248, Majestic-12 [Bot] and 10 guests