Division Operation with Newton's Method

Post Reply
User avatar
Logickin λ
Posts: 165
Joined: Sat Sep 08, 2018 8:31 pm
Contact:

Division Operation with Newton's Method

Post by Logickin λ »

I planned to included this module to my SunVox logic tool kit, but I think someone might need this module right now, so I decided to share the module here.

Division is one of the biggest problems when we do logic stuff in SunVox because division is common yet it is expensive. From common applications like dividing a sample into even portions, to theoretical experiments like physical modeling, it is impossible to escape division. Normally, depending on the number, division requires a long iteration to complete, so the performance is often slow and inconsistent; however, this is the thing of past in SunVox.

Introducing:

Newton's Method Inverter!

Newton's Method Inverter offers an ultra high precision division in audio rate. As the name suggested, this module is based on Newton's method with a lookup table, which calculates the result only using addition and multiplication. The module has been pre and post multiplied, so it has a relatively large operation range (decimal numbers ranged between 1 and 65535).

To use the module, all you need is to feed a divisor (denominator) into the inverter, finding the value of 1/x. After that, you only need to multiply the inverted signal with a dividend (numerator) to get the result.

Image

Want a finer division like 0.25 / 0.0625? All you need is to multiply a constant before and after the inverter!

Image

That's about the module, hope you guys find it useful when design a module. I will attach the module and the details down below.

Here is the detail:
https://logickin.net/docs/b4b-numerical ... -division/
Last edited by Logickin λ on Tue Dec 13, 2022 6:28 pm, edited 2 times in total.
User avatar
Logickin λ
Posts: 165
Joined: Sat Sep 08, 2018 8:31 pm
Contact:

Re: [Beta Test] Division Operation with Newton's Method

Post by Logickin λ »

Change log:
v0.1.1
- A bug in the compressor version has been fixed; the module should be more responsive.
- Due to the release behavior of compressor has the rate of change of 1ms, the optimal performance for the compressor inverter is up to 200Hz, not 1kHz.


The division modules have an update.
Thanks to fuzion_mixer finds out compressor modules have a built in division; now we have a new variant!

The compressor method breaks the range limit from the original waveshaper design, with lower CPU comsumption and smaller size, but the compressor sacrifices performance due to its 1ms release envelope; despite the slower performance, it is still great for implementing control signal for your metamodule controllers!

Meanwhile, I have omitted my name on the inverter modules simply because these modules will belong to the 3xLog Logic Processing toolkit where 3xLog is built for the SunVox community who want to implement certain logic for their modules, so if I have released a module related to 3xLog before included in the package, I will use the name 3xLog instead (or without any name).

Here are the modules:
Waveshaper Inverter for division, audio rate performance with limit range:
3xLog - Newton Waveshaper Inverter.sunsynth
(11.6 KiB) Downloaded 102 times
Compressor Inverter for division, slower (under 200 Hz) but much more efficient:
3xLog - Newton Compressor Inverter.sunsynth
(5.8 KiB) Downloaded 94 times
Post Reply