mirror of
https://github.com/romanz/amodem.git
synced 2026-04-20 21:26:39 +08:00
sampling: N should a variable
This commit is contained in:
@@ -10,9 +10,9 @@ class Interpolator(object):
|
|||||||
def __init__(self, resolution=10000, width=128):
|
def __init__(self, resolution=10000, width=128):
|
||||||
self.width = width
|
self.width = width
|
||||||
self.resolution = resolution
|
self.resolution = resolution
|
||||||
self.N = resolution * width
|
N = resolution * width
|
||||||
u = np.arange(-self.N, self.N, dtype=float)
|
u = np.arange(-N, N, dtype=float)
|
||||||
window = (1 + np.cos(0.5 * np.pi * u / self.N)) / 2.0
|
window = (1 + np.cos(0.5 * np.pi * u / N)) / 2.0
|
||||||
h = np.sinc(u / resolution) * window
|
h = np.sinc(u / resolution) * window
|
||||||
self.filt = []
|
self.filt = []
|
||||||
for index in range(resolution): # split into multiphase filters
|
for index in range(resolution): # split into multiphase filters
|
||||||
|
|||||||
Reference in New Issue
Block a user