1 parent b92dc73 commit 02aa9c7Copy full SHA for 02aa9c7
1 file changed
content/sync.rst
@@ -73,8 +73,8 @@ We can easily simulate a delay by shifting samples, but it only simulates a dela
73
74
# Create and apply fractional delay filter
75
delay = 0.4 # fractional delay, in samples
76
- N = 21 # number of taps
77
- n = np.arange(-N//2, N//2) # ...-3,-2,-1,0,1,2,3...
+ N = 21 # number of taps, keep this odd
+ n = np.arange(-(N-1)//2, N//2+1) # -10,-9,...,0,...,9,10
78
h = np.sinc(n - delay) # calc filter taps
79
h *= np.hamming(N) # window the filter to make sure it decays to 0 on both sides
80
h /= np.sum(h) # normalize to get unity gain, we don't want to change the amplitude/power
0 commit comments