Skip to content

Instantly share code, notes, and snippets.

@ingoogni
ingoogni / goertzel_bench.nim
Created November 12, 2023 11:50 — forked from Moaneschien/goertzel.nim
Compare sine wave oscillators for speed and accuracy. Goertzel, Rotating Vector vs. sin()
#nim.cfg
#-d:release
#-d:danger
#-d:samplerate=44100
# Result (12th Gen Intel(R) Core(TM) i9-12900 2.40 GHz):
#
# GSinOsc : (seconds: 0, nanosecond: 516204700)
# RVSinOsc : (seconds: 1, nanosecond: 672888300)
# STDSinOsc: (seconds: 5, nanosecond: 908334300)