wavetable oscillator with lanczos2 resampling

This commit is contained in:
2026-07-26 04:55:39 -07:00
parent 3e41930e7d
commit 66bea462e7
4 changed files with 134 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
# lanczos2 kernel interval -2:0
# generating 512 point LUT
# 511 is centerpoint
# lanczos defined as sinc(x) * sinc(x/a)
# a is order (2)
# sinc(x) = sin(x) / x
# output format:
# 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN, 0xNNNN,
# x32 lines
import numpy as np
for j in range(0, 512, 16):
lineString = ""
for k in range(16):
i = j + k
x = (i - 511) / 256
y = np.sinc(x) * np.sinc(x / 2)
y *= 32767
lineString += hex(int(y))
lineString += ", "
print(lineString)