mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-28 01:49:33 -06:00
Audio: new dsp_coef.bin with windowed sinc filter coefficients
This commit is contained in:
@ -1,3 +1,16 @@
|
||||
Legal GC/WII DSP IROM replacement (v0.2.1)
|
||||
-------------------------------------------------------
|
||||
|
||||
- coef: 4-tap polyphase FIR filters
|
||||
- irom: unchanged
|
||||
|
||||
Coefficients are roughly equivalent to those in the official DROM.
|
||||
Improves resampling quality greatly over linear interpolation.
|
||||
See generate_coefs.py for details.
|
||||
|
||||
stgn
|
||||
29/june/2015
|
||||
|
||||
Legal GC/WII DSP IROM replacement (v0.2)
|
||||
-------------------------------------------------------
|
||||
|
||||
|
25
docs/DSP/free_dsp_rom/generate_coefs.py
Normal file
25
docs/DSP/free_dsp_rom/generate_coefs.py
Normal file
@ -0,0 +1,25 @@
|
||||
from numpy import *
|
||||
from struct import pack
|
||||
|
||||
def pack_coefs(c):
|
||||
cw = list(zip(c[ :128][::-1],
|
||||
c[128:256][::-1],
|
||||
c[256:384][::-1],
|
||||
c[384: ][::-1]))
|
||||
m = max(sum(x) for x in cw)
|
||||
return b''.join(pack('>4h', *(int(round(n / m * 32767)) for n in x)) for x in cw)
|
||||
|
||||
x = linspace(-2, 2, 512, endpoint=False)
|
||||
|
||||
w1 = hamming(512)
|
||||
w2 = kaiser(512, pi * 9/4)
|
||||
|
||||
coef_1 = [sinc(n * 0.5) for n in x] * w1
|
||||
coef_2 = [sinc(n * 0.75) for n in x] * w2
|
||||
coef_3 = [sinc(n) for n in x] * w1
|
||||
|
||||
with open('dsp_coef.bin', 'wb') as f:
|
||||
f.write(pack_coefs(coef_1))
|
||||
f.write(pack_coefs(coef_2))
|
||||
f.write(pack_coefs(coef_3))
|
||||
f.write(b'\0' * 1024)
|
Reference in New Issue
Block a user