Hi,
On 19/12/2019 20:01, IOhannes m zmölnig wrote:
the high-performance phase-wrapping algorithm
For reference: https://github.com/pure-data/pure-data/blob/e3a78da5b7d825bf8b9f5d313e4ea55e... (current master at time of writing)
Using a [phasor~] with x -= floor(x); for wrapping is about twice as slow as the built-in tabfudge version, provided I compile with -march=native on my AMD Ryzen 7 2700X Eight-Core Processor. When compiled with pd-lib-builder's default -march=core2, the floor version is over five times slower. I can run tests on other hardware in early January if more data points are desired.
Benchmark methodology: time how long running 1000 copies of [phasor~ 440] takes in pd -batch, with a timeout.pd that quits pd after 1 minute of logical time. The tabfudge version finishes in 3 seconds. I used the /usr/bin/pd in 0.49.0-3 (Debian Buster).
I suppose it's not so hard to load a custom phasor~ library (source attached), if you need the extra accuracy of the floor version, and can live with the slowdown. I did this already in one project for a vcf~ with internal double precision feedback state.
Claude