View Single Post
Old 01-12-2021, 06:43 PM   #1
Human being with feelings
Join Date: Aug 2008
Posts: 37
Default JSFX Autocorellation

*EDIT* This is pretty much working now, making this the everything autocorellation thread!

Hi everyone, new to the JS forums but been messing about in JSFX for a good while now and am becoming comfortable with it. I am currently trying to implement an algorithm that accumulates total energy across a certain timespan. To do this efficiently, it needs to add the latest sample, and subtract that sample's value back out later using a delay line.

In trying to get this working, I am seeing some drifty numerical wackiness, which I am blaming on the inaccuracies that result from adding tiny floating point numbers to the rather large accumulated one.

As far as I can tell, JS uses exclusively 64-bit floats for everything. Is there some way I can force it to a use a certain fixed precision for this?

Last edited by noouch; 01-14-2021 at 12:37 AM.
noouch is offline   Reply With Quote